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

AArch64: Fix matching predication for cbz/cbnz

XMLWordPrintable

    • b02
    • aarch64
    • generic

      Array length check, like below:

      ```
          void test(int ia[]) {
              if (ia.length > 0) {
                  result += 0x88;
              } else {
                  result -= 1;
              }
          }
      ```

      c2 will generate code like:
      ```
      ldr w11, [x2, #12]
      cmp w11, #0x0
      b.ls 0x0000ffff9c487ed0 // b.plast ;;
      ldr w11, [x1, #12]
      add w10, w11, #0x88
      str w10, [x1, #12]
      ...
      ```

      On aarch64 port, for certain unsigned integral comparisons, like:
      ```
      cmp w11, #0x0
      b.ls 0x0000ffff9c487ed0 // b.plast ;;
      ```
      we can convert to:
      ```
      cbz w11, 0x0000ffff9c487ed0
      ```

            fgao Fei Gao
            fgao Fei Gao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: