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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 8u60, 9
    • hotspot
    • None
    • b140
    • x86
    • generic
    • Not verified

      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.

            vdeshpande Vivek Deshpande (Inactive)
            kvn Vladimir Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: