• zhengxing.li's avatar
    X87: Change the test case for X87 RunTruncateFloat32ToUint32. · d5ffbfef
    zhengxing.li authored
      The CL #35651 (https://codereview.chromium.org/1858323003) exposed one hiden issue in RunTruncateFloat32ToUint32 test cases and X87 failed at it.
    
      Here is the issue in RunTruncateFloat32ToUint32:
      For float input = static_cast<float>(*i), the x87 GCC would optimize the input viariable in float floating register for release build.
    
      The problem is:
      SSE float register has single precision rounding semantic While X87 register hasn't when directly use floating register value. It will cause the value of input viariable has
      different precision for IA32 and X87 port. So static_cast<uint32_t>(input) will be different for IA32 and X87 port too.
      This led to CHECK_EQ(static_cast<uint32_t>(input), m.Call(input)) fail although V8 turbofan JITTed code m.Call(input) has exactly same result in both X87 and IA32 port.
    
      So we add the following sentence to do type cast to keep the single precision for RunTruncateFloat32ToUint32 by forcing the input viariable get value from memory insread of
      floating register.
      Such as: volatile float input = static_cast<float>(*i).
    
    BUG=
    
    Review URL: https://codereview.chromium.org/1905883002
    
    Cr-Commit-Position: refs/heads/master@{#35689}
    d5ffbfef
test-run-machops.cc 189 KB