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

YMM registers upper 128 bits may get clobbered by a JNI call on windows

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8u60, 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b140
    • CPU:
      x86
    • OS:
      generic
    • Verification:
      Not verified

      Description

      The windows calling convention says that only XMM6-XMM15 are SOE(callee save), whereas upper 128 bits of YMM6-15 are SOC(caller save):
      https://msdn.microsoft.com/en-us/library/9z1stfyw.aspx

      The x86.ad file does not reflect this and shows the windows native calling convention as SOE for the entire YMM6-15.
      The following excerpt from x86.ad file:
      #ifdef _WIN64
      reg_def XMM6 ( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg());
      reg_def XMM6b( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(1));
      reg_def XMM6c( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(2));
      reg_def XMM6d( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(3));
      reg_def XMM6e( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(4));
      reg_def XMM6f( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(5));
      reg_def XMM6g( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(6));
      reg_def XMM6h( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(7));
      ...
      #endif

      If partial register spilling is not supported, one solution would be to declare the entire register as SOC.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vdeshpande Vivek Deshpande
                Reporter:
                kvn Vladimir Kozlov
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: