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

RISC-V: avoid unnecessary slli in the vectorized arraycopy stubs for bytes

XMLWordPrintable

    • b26
    • riscv
    • linux

      The vectorized arraycopy stub for jbytes looks like this:

              0x000000401b41e9c8: mv t6,a1
              0x000000401b41e9ca: mv t5,a0
              0x000000401b41e9cc: mv a5,a2
              0x000000401b41e9ce: vsetvli a4, a5, e8, m8, tu, mu
              0x000000401b41e9d2: vle8.v v0, (t5)
              0x000000401b41e9d6: sub a5,a5,a4
              0x000000401b41e9d8: slli a4,a4,0x0
              0x000000401b41e9dc: add t5,t5,a4
              0x000000401b41e9de: vse8.v v0, (t6)
              0x000000401b41e9e2: add t6,t6,a4
              0x000000401b41e9e4: bnez a5,0x000000401b41e9ce

      Note the unnecessary slli a4,a4,0x0 instruction. This is needed if the elem size is > 1 but here it's a nop. Worth eliminating? The fix is trivial.

            tonyp Tony Printezis
            tonyp Tony Printezis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: