@@ -807,12 +807,45 @@ DEF_BUILTIN_HANDLER(emscripten_float64x2_fromInt32x4Bits, SIMD_Float64x2_fromInt
807
807
DEF_BUILTIN_HANDLER (emscripten_float64x2_fromInt32x4, SIMD_Float64x2_fromInt32x4);
808
808
DEF_BUILTIN_HANDLER (emscripten_float64x2_fromFloat32x4Bits, SIMD_Float64x2_fromFloat32x4Bits);
809
809
DEF_BUILTIN_HANDLER (emscripten_float64x2_fromFloat32x4, SIMD_Float64x2_fromFloat32x4);
810
+
811
+ static std::string castBool64x2ToInt32x4 (const std::string &valueStr) {
812
+ return std::string (" SIMD_Int32x4_fromBool64x2Bits(" ) + valueStr + ' )' ;
813
+ }
814
+
815
+ DEF_CALL_HANDLER (emscripten_float64x2_equal, {
816
+ return getAssign (CI) + castBool64x2ToInt32x4 (" SIMD_Float64x2_equal(" + getValueAsStr (CI->getOperand (0 )) + " , " + getValueAsStr (CI->getOperand (1 )) + " )" );
817
+ })
818
+
819
+ DEF_CALL_HANDLER(emscripten_float64x2_notEqual, {
820
+ return getAssign (CI) + castBool64x2ToInt32x4 (" SIMD_Float64x2_notEqual(" + getValueAsStr (CI->getOperand (0 )) + " , " + getValueAsStr (CI->getOperand (1 )) + " )" );
821
+ })
822
+
823
+ DEF_CALL_HANDLER(emscripten_float64x2_lessThan, {
824
+ return getAssign (CI) + castBool64x2ToInt32x4 (" SIMD_Float64x2_lessThan(" + getValueAsStr (CI->getOperand (0 )) + " , " + getValueAsStr (CI->getOperand (1 )) + " )" );
825
+ })
826
+
827
+ DEF_CALL_HANDLER(emscripten_float64x2_lessThanOrEqual, {
828
+ return getAssign (CI) + castBool64x2ToInt32x4 (" SIMD_Float64x2_lessThanOrEqual(" + getValueAsStr (CI->getOperand (0 )) + " , " + getValueAsStr (CI->getOperand (1 )) + " )" );
829
+ })
830
+
831
+ DEF_CALL_HANDLER(emscripten_float64x2_greaterThan, {
832
+ return getAssign (CI) + castBool64x2ToInt32x4 (" SIMD_Float64x2_greaterThan(" + getValueAsStr (CI->getOperand (0 )) + " , " + getValueAsStr (CI->getOperand (1 )) + " )" );
833
+ })
834
+
835
+ DEF_CALL_HANDLER(emscripten_float64x2_greaterThanOrEqual, {
836
+ return getAssign (CI) + castBool64x2ToInt32x4 (" SIMD_Float64x2_greaterThanOrEqual(" + getValueAsStr (CI->getOperand (0 )) + " , " + getValueAsStr (CI->getOperand (1 )) + " )" );
837
+ })
838
+
839
+ // The above code to handle Float64x2 comparisons to a booleans is temporary. Once Bool64x2 is in the spec and SpiderMonkey has the type, revert to the code below.
840
+ #if 0
810
841
DEF_BUILTIN_HANDLER(emscripten_float64x2_equal, SIMD_Float64x2_equal);
811
842
DEF_BUILTIN_HANDLER(emscripten_float64x2_notEqual, SIMD_Float64x2_notEqual);
812
843
DEF_BUILTIN_HANDLER(emscripten_float64x2_lessThan, SIMD_Float64x2_lessThan);
813
844
DEF_BUILTIN_HANDLER(emscripten_float64x2_lessThanOrEqual, SIMD_Float64x2_lessThanOrEqual);
814
845
DEF_BUILTIN_HANDLER(emscripten_float64x2_greaterThan, SIMD_Float64x2_greaterThan);
815
846
DEF_BUILTIN_HANDLER(emscripten_float64x2_greaterThanOrEqual, SIMD_Float64x2_greaterThanOrEqual);
847
+ #endif
848
+
816
849
DEF_BUILTIN_HANDLER (emscripten_float64x2_and, SIMD_Float64x2_and);
817
850
DEF_BUILTIN_HANDLER (emscripten_float64x2_or, SIMD_Float64x2_or);
818
851
DEF_BUILTIN_HANDLER (emscripten_float64x2_xor, SIMD_Float64x2_xor);
0 commit comments