Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8239914

AArch64: Combine add/sub with comparison against zero

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Fix
    • P4
    • 15
    • 14
    • hotspot
    • aarch64
    • linux

    Description

      For Java code block like "if (a + b > 0) {...}", currently add+cmp instructions are generated.
        add w10, w2, w1
        cmp w10, #0x0
        b.gt 0x0000ffff790d5274
      Indeed, these two instructions can be combined into "cmn w2, w1" (alias of adds); sub+cmp can be combined into a single cmp (alias of subs) as well.

      Attachments

        Activity

          People

            pli Pengfei Li
            pli Pengfei Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: