Ver Fonte

Remove JavascriptSSE2MathOperators.cpp

Michael Ferris há 8 anos atrás
pai
commit
cd5d544a36

+ 1 - 0
lib/Backend/IR.cpp

@@ -3,6 +3,7 @@
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 #include "Backend.h"
+#include "RuntimeMathPch.h"
 
 namespace IR
 {

+ 1 - 29
lib/Backend/JnHelperMethod.cpp

@@ -10,10 +10,9 @@
 #include "Library/RegexHelper.h"
 
 #include "Debug/DiagHelperMethodWrapper.h"
-#include "Math/JavascriptSSE2MathOperators.h"
-#include "Math/JavascriptSSE2MathOperators.inl"
 #include "Math/CrtSSE2Math.h"
 #include "Library/JavascriptGeneratorFunction.h"
+#include "RuntimeMathPch.h"
 
 namespace IR
 {
@@ -29,34 +28,10 @@ intptr_t const JnHelperMethodAddresses[] =
     NULL
 };
 
-#if defined(_M_IX86)
-intptr_t const JnHelperMethodAddresses_SSE2[] =
-{
-#define SSE2MATH
-#define HELPERCALL(Name, Address, Attributes) reinterpret_cast<intptr_t>(Address),
-// Because of order-of-initialization problems with the vtable address static field
-// and this array, we're going to have to fill these in as we go along.
-#include "JnHelperMethodList.h"
-#undef HELPERCALL
-#undef SSE2MATH
-    NULL
-};
-
-intptr_t const *GetHelperMethods()
-{
-    if (AutoSystemInfo::Data.SSE2Available())
-    {
-        return JnHelperMethodAddresses_SSE2;
-    }
-    return JnHelperMethodAddresses;
-}
-#else
-
 intptr_t const *GetHelperMethods()
 {
     return JnHelperMethodAddresses;
 }
-#endif
 
 #if ENABLE_DEBUG_CONFIG_OPTIONS && defined(_CONTROL_FLOW_GUARD)
 class HelperTableCheck
@@ -64,9 +39,6 @@ class HelperTableCheck
 public:
     HelperTableCheck() {
         CheckJnHelperTable(JnHelperMethodAddresses);
-#if defined(_M_IX86)
-        CheckJnHelperTable(JnHelperMethodAddresses_SSE2);
-#endif
     }
 };
 

+ 42 - 49
lib/Backend/JnHelperMethodList.h

@@ -11,17 +11,10 @@
     HELPERCALL(Name##_Full, Address##_Full, Attributes) \
     HELPERCALL(Name##InPlace, Address##_InPlace, Attributes)
 
-#if defined(SSE2MATH)
-#define HELPERCALL_MATH(Name, Address, SSE2Address, Attributes) \
-    HELPERCALL(Name##, SSE2Address##, Attributes)
-#define HELPERCALL_FULL_OR_INPLACE_MATH(Name, Address, SSE2Address, Attributes) \
-    HELPERCALL_FULL_OR_INPLACE(Name##, SSE2Address##, Attributes)
-#else
-#define HELPERCALL_MATH(Name, Address, SSE2Address, Attributes) \
+#define HELPERCALL_MATH(Name, Address, Attributes) \
     HELPERCALL(Name##, Address##, Attributes)
-#define HELPERCALL_FULL_OR_INPLACE_MATH(Name, Address, SSE2Address, Attributes) \
+#define HELPERCALL_FULL_OR_INPLACE_MATH(Name, Address, Attributes) \
     HELPERCALL_FULL_OR_INPLACE(Name##, Address##, Attributes)
-#endif
 
 //HELPERCALL(Name, Address, Attributes)
 
@@ -93,45 +86,45 @@ HELPERCALL(Op_WasmMemoryTraceWrite, Js::WebAssemblyMemory::TraceMemWrite, 0)
 #endif
 #endif
 
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Increment, Js::JavascriptMath::Increment, Js::SSE2::JavascriptMath::Increment, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Decrement, Js::JavascriptMath::Decrement, Js::SSE2::JavascriptMath::Decrement, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Negate, Js::JavascriptMath::Negate, Js::SSE2::JavascriptMath::Negate, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Not, Js::JavascriptMath::Not, Js::SSE2::JavascriptMath::Not, AttrCanThrow)
-
-HELPERCALL_MATH(Op_AddLeftDead, Js::JavascriptMath::AddLeftDead, Js::SSE2::JavascriptMath::AddLeftDead, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Add, Js::JavascriptMath::Add, Js::SSE2::JavascriptMath::Add, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Divide, Js::JavascriptMath::Divide, Js::SSE2::JavascriptMath::Divide, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Modulus, Js::JavascriptMath::Modulus, Js::SSE2::JavascriptMath::Modulus, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Multiply, Js::JavascriptMath::Multiply, Js::SSE2::JavascriptMath::Multiply, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Subtract, Js::JavascriptMath::Subtract, Js::SSE2::JavascriptMath::Subtract, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Exponentiation, Js::JavascriptMath::Exponentiation, Js::SSE2::JavascriptMath::Exponentiation, AttrCanThrow)
-
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_And, Js::JavascriptMath::And, Js::SSE2::JavascriptMath::And, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Or, Js::JavascriptMath::Or, Js::SSE2::JavascriptMath::Or, AttrCanThrow)
-HELPERCALL_FULL_OR_INPLACE_MATH(Op_Xor, Js::JavascriptMath::Xor, Js::SSE2::JavascriptMath::Xor, AttrCanThrow)
-
-HELPERCALL_MATH(Op_MulAddLeft, Js::JavascriptMath::MulAddLeft, Js::SSE2::JavascriptMath::MulAddLeft, AttrCanThrow)
-HELPERCALL_MATH(Op_MulAddRight, Js::JavascriptMath::MulAddRight, Js::SSE2::JavascriptMath::MulAddRight, AttrCanThrow)
-HELPERCALL_MATH(Op_MulSubLeft, Js::JavascriptMath::MulSubLeft, Js::SSE2::JavascriptMath::MulSubLeft, AttrCanThrow)
-HELPERCALL_MATH(Op_MulSubRight, Js::JavascriptMath::MulSubRight, Js::SSE2::JavascriptMath::MulSubRight, AttrCanThrow)
-
-HELPERCALL_MATH(Op_ShiftLeft, Js::JavascriptMath::ShiftLeft, Js::SSE2::JavascriptMath::ShiftLeft, AttrCanThrow)
-HELPERCALL_MATH(Op_ShiftLeft_Full, Js::JavascriptMath::ShiftLeft_Full, Js::SSE2::JavascriptMath::ShiftLeft_Full, AttrCanThrow)
-HELPERCALL_MATH(Op_ShiftRight, Js::JavascriptMath::ShiftRight, Js::SSE2::JavascriptMath::ShiftRight, AttrCanThrow)
-HELPERCALL_MATH(Op_ShiftRight_Full, Js::JavascriptMath::ShiftRight_Full, Js::SSE2::JavascriptMath::ShiftRight_Full, AttrCanThrow)
-HELPERCALL_MATH(Op_ShiftRightU, Js::JavascriptMath::ShiftRightU, Js::SSE2::JavascriptMath::ShiftRightU, AttrCanThrow)
-HELPERCALL_MATH(Op_ShiftRightU_Full, Js::JavascriptMath::ShiftRightU_Full, Js::SSE2::JavascriptMath::ShiftRightU_Full, AttrCanThrow)
-
-HELPERCALL_MATH(Conv_ToInt32_Full, Js::JavascriptMath::ToInt32_Full, Js::SSE2::JavascriptMath::ToInt32_Full, AttrCanThrow)
-HELPERCALL_MATH(Conv_ToInt32, (int32 (*)(Js::Var, Js::ScriptContext *))Js::JavascriptMath::ToInt32, (int32 (*)(Js::Var, Js::ScriptContext *))Js::SSE2::JavascriptMath::ToInt32, AttrCanThrow)
-HELPERCALL_MATH(Conv_ToInt32_NoObjects, Js::JavascriptMath::ToInt32_NoObjects, Js::SSE2::JavascriptMath::ToInt32_NoObjects, AttrCanThrow)
-
-HELPERCALL_MATH(Op_FinishOddDivByPow2, Js::JavascriptMath::FinishOddDivByPow2, Js::SSE2::JavascriptMath::FinishOddDivByPow2, 0)
-HELPERCALL_MATH(Op_FinishOddDivByPow2InPlace, Js::JavascriptMath::FinishOddDivByPow2_InPlace, Js::SSE2::JavascriptMath::FinishOddDivByPow2_InPlace, 0)
-HELPERCALL_MATH(Conv_ToInt32Core, (int32 (*)(double))Js::JavascriptMath::ToInt32Core, (int32 (*)(double))Js::SSE2::JavascriptMath::ToInt32Core, 0)
-HELPERCALL_MATH(Conv_ToUInt32Core, (uint32(*)(double))Js::JavascriptMath::ToUInt32, (uint32(*)(double))Js::SSE2::JavascriptMath::ToUInt32, 0)
-HELPERCALL_MATH(Op_MaxInAnArray, Js::JavascriptMath::MaxInAnArray, Js::SSE2::JavascriptMath::MaxInAnArray, AttrCanThrow)
-HELPERCALL_MATH(Op_MinInAnArray, Js::JavascriptMath::MinInAnArray, Js::SSE2::JavascriptMath::MinInAnArray, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Increment, Js::JavascriptMath::Increment, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Decrement, Js::JavascriptMath::Decrement, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Negate, Js::JavascriptMath::Negate, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Not, Js::JavascriptMath::Not, AttrCanThrow)
+
+HELPERCALL_MATH(Op_AddLeftDead, Js::JavascriptMath::AddLeftDead, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Add, Js::JavascriptMath::Add, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Divide, Js::JavascriptMath::Divide, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Modulus, Js::JavascriptMath::Modulus, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Multiply, Js::JavascriptMath::Multiply, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Subtract, Js::JavascriptMath::Subtract, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Exponentiation, Js::JavascriptMath::Exponentiation, AttrCanThrow)
+
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_And, Js::JavascriptMath::And, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Or, Js::JavascriptMath::Or, AttrCanThrow)
+HELPERCALL_FULL_OR_INPLACE_MATH(Op_Xor, Js::JavascriptMath::Xor, AttrCanThrow)
+
+HELPERCALL_MATH(Op_MulAddLeft, Js::JavascriptMath::MulAddLeft, AttrCanThrow)
+HELPERCALL_MATH(Op_MulAddRight, Js::JavascriptMath::MulAddRight, AttrCanThrow)
+HELPERCALL_MATH(Op_MulSubLeft, Js::JavascriptMath::MulSubLeft, AttrCanThrow)
+HELPERCALL_MATH(Op_MulSubRight, Js::JavascriptMath::MulSubRight, AttrCanThrow)
+
+HELPERCALL_MATH(Op_ShiftLeft, Js::JavascriptMath::ShiftLeft, AttrCanThrow)
+HELPERCALL_MATH(Op_ShiftLeft_Full, Js::JavascriptMath::ShiftLeft_Full, AttrCanThrow)
+HELPERCALL_MATH(Op_ShiftRight, Js::JavascriptMath::ShiftRight, AttrCanThrow)
+HELPERCALL_MATH(Op_ShiftRight_Full, Js::JavascriptMath::ShiftRight_Full, AttrCanThrow)
+HELPERCALL_MATH(Op_ShiftRightU, Js::JavascriptMath::ShiftRightU, AttrCanThrow)
+HELPERCALL_MATH(Op_ShiftRightU_Full, Js::JavascriptMath::ShiftRightU_Full, AttrCanThrow)
+
+HELPERCALL_MATH(Conv_ToInt32_Full, Js::JavascriptMath::ToInt32_Full, AttrCanThrow)
+HELPERCALL_MATH(Conv_ToInt32, (int32 (*)(Js::Var, Js::ScriptContext *))Js::JavascriptMath::ToInt32, AttrCanThrow)
+HELPERCALL_MATH(Conv_ToInt32_NoObjects, Js::JavascriptMath::ToInt32_NoObjects, AttrCanThrow)
+
+HELPERCALL_MATH(Op_FinishOddDivByPow2, Js::JavascriptMath::FinishOddDivByPow2, 0)
+HELPERCALL_MATH(Op_FinishOddDivByPow2InPlace, Js::JavascriptMath::FinishOddDivByPow2_InPlace, 0)
+HELPERCALL_MATH(Conv_ToInt32Core, (int32 (*)(double))Js::JavascriptMath::ToInt32Core, 0)
+HELPERCALL_MATH(Conv_ToUInt32Core, (uint32(*)(double))Js::JavascriptMath::ToUInt32, 0)
+HELPERCALL_MATH(Op_MaxInAnArray, Js::JavascriptMath::MaxInAnArray, AttrCanThrow)
+HELPERCALL_MATH(Op_MinInAnArray, Js::JavascriptMath::MinInAnArray, AttrCanThrow)
 
 HELPERCALL(Op_ConvString, Js::JavascriptConversion::ToString, AttrCanThrow)
 HELPERCALL(Op_CoerseString, Js::JavascriptConversion::CoerseString, AttrCanThrow)
@@ -530,7 +523,7 @@ HELPERCALL(IsNegZero, Js::JavascriptNumber::IsNegZero, 0)
 HELPERCALL(DirectMath_PowIntInt, (double(*)(double, int32))Js::JavascriptNumber::DirectPowIntInt, 0)
 HELPERCALL(DirectMath_PowDoubleInt, (double(*)(double, int32))Js::JavascriptNumber::DirectPowDoubleInt, 0)
 HELPERCALL(DirectMath_Pow, (double(*)(double, double))Js::JavascriptNumber::DirectPow, 0)
-HELPERCALL_MATH(DirectMath_Random,  (double(*)(Js::ScriptContext*))Js::JavascriptMath::Random, (double(*)(Js::ScriptContext*))Js::SSE2::JavascriptMath::Random, 0)
+HELPERCALL_MATH(DirectMath_Random,  (double(*)(Js::ScriptContext*))Js::JavascriptMath::Random, 0)
 
 //
 // Putting dllimport function ptr in JnHelperMethodAddresses will cause the table to be allocated in read-write memory

+ 1 - 0
lib/Runtime/Language/AsmJsEncoder.cpp

@@ -3,6 +3,7 @@
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 #include "RuntimeLanguagePch.h"
+#include "RuntimeMathPch.h"
 
 #ifdef ASMJS_PLAT
 

+ 1 - 0
lib/Runtime/Language/InterpreterStackFrame.cpp

@@ -4,6 +4,7 @@
 //-------------------------------------------------------------------------------------------------------
 
 #include "RuntimeLanguagePch.h"
+#include "RuntimeMathPch.h"
 #include "EHBailoutData.h"
 #include "Library/JavascriptRegularExpression.h"
 #if DBG_DUMP

+ 1 - 0
lib/Runtime/Language/JavascriptConversion.cpp

@@ -3,6 +3,7 @@
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 #include "RuntimeLanguagePch.h"
+#include "RuntimeMathPch.h"
 #include "Library/JavascriptNumberObject.h"
 #include "Library/JavascriptStringObject.h"
 #include "Library/JavascriptSimdObject.h"

+ 1 - 0
lib/Runtime/Language/i386/AsmJsJitTemplate.cpp

@@ -4,6 +4,7 @@
 //-------------------------------------------------------------------------------------------------------
 
 #include "RuntimeLanguagePch.h"
+#include "RuntimeMathPch.h"
 
 #if ENABLE_NATIVE_CODEGEN
 

+ 0 - 5
lib/Runtime/Math/Chakra.Runtime.Math.vcxproj

@@ -45,9 +45,6 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="$(MSBuildThisFileDirectory)AsmJsMath.cpp" />
-    <ClCompile Include="$(MSBuildThisFileDirectory)JavascriptSSE2MathOperators.cpp">
-      <ExcludedFromBuild Condition="'$(Platform)'!='Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="$(MSBuildThisFileDirectory)RuntimeMathPch.cpp">
       <PrecompiledHeader>Create</PrecompiledHeader>
     </ClCompile>
@@ -59,13 +56,11 @@
     <ClInclude Include="CrtSSE2Math.h" />
     <ClInclude Include="RuntimeMathPch.h" />
     <ClInclude Include="JavascriptMath.h" />
-    <ClInclude Include="JavascriptSSE2MathOperators.h" />
     <ClInclude Include="WasmMath.inl" />
   </ItemGroup>
   <ItemGroup>
     <None Include="AsmJsMath.inl" />
     <None Include="JavascriptMath.inl" />
-    <None Include="JavascriptSSE2MathOperators.inl" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\JITIDL\Chakra.JITIDL.vcxproj">

+ 0 - 9
lib/Runtime/Math/JavascriptSSE2MathOperators.cpp

@@ -1,9 +0,0 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-#include "RuntimeMathPch.h"
-
-#define SSE2MATH
-#include "JavascriptMath.cpp"
-#undef SSE2MATH

+ 0 - 10
lib/Runtime/Math/JavascriptSSE2MathOperators.h

@@ -1,10 +0,0 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-#pragma once
-
-
-#define SSE2MATH
-#include "JavascriptMath.h"
-#undef SSE2MATH

+ 0 - 9
lib/Runtime/Math/JavascriptSSE2MathOperators.inl

@@ -1,9 +0,0 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-#pragma once
-
-#define SSE2MATH
-#include "JavascriptMath.inl"
-#undef SSE2MATH

+ 0 - 2
lib/Runtime/Math/RuntimeMathPch.h

@@ -4,7 +4,5 @@
 //-------------------------------------------------------------------------------------------------------
 #pragma once
 #include "Runtime.h"
-#include "Math/JavascriptSSE2MathOperators.h"
-#include "Math/JavascriptSSE2MathOperators.inl"
 #include "AsmJsMath.h"
 #include "WasmMath.h"