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

AArch64: Fix encoding error in sve_cpy for negative floats

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • hotspot

      The "sve_cpy" instruction is not correctly implemented for negative floating-point values.

      When a negative floating-point number is passed (e.g., __sve_cpy($dst$FloatRegister, size, $mask$PRegister, -1.0);) , the checked_cast<int8_t>(pack(d)) check fails.

      For example, assume d = -1.0; pack(-1.0) returns an unsigned int with the 7th bit set, i.e., 0xf0. "checked_cast<int8_t>(0xf0)" casts 0xf0 to an int8_t value, which is -16.
      Casting this int8_t -16 back to unsigned int results in 0xfffffff0. The check compares 0xf0 to 0xfffffff0, which obviously fails.

      Additionally, the encoding of the negative floating-point number is incorrect. The imm8 field can fall outside the valid range of [-128, 127]. Bit 13 should be encoded as 0 for floating-point numbers.

            xgong Xiaohong Gong
            xgong Xiaohong Gong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: