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

RISC-V: small improvements to shift immediate instructions

XMLWordPrintable

    • b07
    • riscv
    • linux

        We sometimes emit this code in risc-v backend:
        slli Rd, Rs, 0
        (for example we do this in String.IndexOf intrinsic)

        it's an equivalent of addi Rd, Rs, 0 ( a synonym for mv Rd, Rs)

        addi with 0 has higher chances to be just a register renaming in decoder and not utilise ALU.
        We observed some positive effect of replacing slli by 0 with addi on hifive.

              vkempik Vladimir Kempik
              vkempik Vladimir Kempik
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: