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

riscv: Unnecessary sign extension in BigInteger intrinsics

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-riscv-port
    • repo-riscv-port
    • hotspot
    • riscv
    • linux

      Reference: https://github.com/riscv-non-isa/riscv-elf-psabi-doc

      " Scalars that are at most XLEN bits wide are passed in a single argument register, or on the stack by value if none is available.
      When passed in registers or on the stack, integer scalars narrower than XLEN bits are widened according to the sign of their type up to 32 bits, then sign-extended to XLEN bits.
      When passed in registers or on the stack, floating-point types narrower than XLEN bits are widened to XLEN bits, with the upper bits undefined."

      So there is no need to do sign extension for signed integer input parameters.

            yzhu Yanhong Zhu
            yzhu Yanhong Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: