Begin organizing b3 tests
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Aug 2019 05:58:09 +0000 (05:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Aug 2019 05:58:09 +0000 (05:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200330

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-31
Reviewed by Keith Miller.

* b3/testb3.h:
* b3/testb3_1.cpp:
(run):
(zero): Deleted.
(negativeZero): Deleted.
* b3/testb3_2.cpp:
(testBitXorTreeArgs):
(testBitXorTreeArgsEven):
(testBitXorTreeArgImm):
(testBitAndTreeArg32):
(testBitOrTreeArg32):
(testBitAndArgs):
(testBitAndSameArg):
(testBitAndNotNot):
(testBitAndNotImm):
(testBitAndImms):
(testBitAndArgImm):
(testBitAndImmArg):
(testBitAndBitAndArgImmImm):
(testBitAndImmBitAndArgImm):
(testBitAndArgs32):
(testBitAndSameArg32):
(testBitAndImms32):
(testBitAndArgImm32):
(testBitAndImmArg32):
(testBitAndBitAndArgImmImm32):
(testBitAndImmBitAndArgImm32):
(testBitAndWithMaskReturnsBooleans):
(testBitAndArgDouble):
(testBitAndArgsDouble):
(testBitAndArgImmDouble):
(testBitAndImmsDouble):
(testBitAndArgFloat):
(testBitAndArgsFloat):
(testBitAndArgImmFloat):
(testBitAndImmsFloat):
(testBitAndArgsFloatWithUselessDoubleConversion):
(testBitOrArgs):
(testBitOrSameArg):
(testBitOrAndAndArgs):
(testBitOrAndSameArgs):
(testBitOrNotNot):
(testBitOrNotImm):
(testBitOrImms):
(testBitOrArgImm):
(testBitOrImmArg):
(testBitOrBitOrArgImmImm):
(testBitOrImmBitOrArgImm):
(testBitOrArgs32):
(testBitOrSameArg32):
(testBitOrImms32):
(testBitOrArgImm32):
(testBitOrImmArg32):
(addBitTests):
* b3/testb3_3.cpp:
(testSShrArgs):
(testSShrImms):
(testSShrArgImm):
(testSShrArg32):
(testSShrArgs32):
(testSShrImms32):
(testSShrArgImm32):
(testZShrArgs):
(testZShrImms):
(testZShrArgImm):
(testZShrArg32):
(testZShrArgs32):
(testZShrImms32):
(testZShrArgImm32):
(zero):
(negativeZero):
(addArgTests):
(addCallTests):
(addShrTests):
* b3/testb3_4.cpp:
(addSExtTests):
* b3/testb3_6.cpp:
(testSShrShl32):
(testSShrShl64):
(addSShrShTests):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248098 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/b3/testb3.h
Source/JavaScriptCore/b3/testb3_1.cpp
Source/JavaScriptCore/b3/testb3_2.cpp
Source/JavaScriptCore/b3/testb3_3.cpp
Source/JavaScriptCore/b3/testb3_4.cpp
Source/JavaScriptCore/b3/testb3_6.cpp

index 4df32e4..1949ee7 100644 (file)
@@ -1,3 +1,91 @@
+2019-07-31  Alex Christensen  <achristensen@webkit.org>
+
+        Begin organizing b3 tests
+        https://bugs.webkit.org/show_bug.cgi?id=200330
+
+        Reviewed by Keith Miller.
+
+        * b3/testb3.h:
+        * b3/testb3_1.cpp:
+        (run):
+        (zero): Deleted.
+        (negativeZero): Deleted.
+        * b3/testb3_2.cpp:
+        (testBitXorTreeArgs):
+        (testBitXorTreeArgsEven):
+        (testBitXorTreeArgImm):
+        (testBitAndTreeArg32):
+        (testBitOrTreeArg32):
+        (testBitAndArgs):
+        (testBitAndSameArg):
+        (testBitAndNotNot):
+        (testBitAndNotImm):
+        (testBitAndImms):
+        (testBitAndArgImm):
+        (testBitAndImmArg):
+        (testBitAndBitAndArgImmImm):
+        (testBitAndImmBitAndArgImm):
+        (testBitAndArgs32):
+        (testBitAndSameArg32):
+        (testBitAndImms32):
+        (testBitAndArgImm32):
+        (testBitAndImmArg32):
+        (testBitAndBitAndArgImmImm32):
+        (testBitAndImmBitAndArgImm32):
+        (testBitAndWithMaskReturnsBooleans):
+        (testBitAndArgDouble):
+        (testBitAndArgsDouble):
+        (testBitAndArgImmDouble):
+        (testBitAndImmsDouble):
+        (testBitAndArgFloat):
+        (testBitAndArgsFloat):
+        (testBitAndArgImmFloat):
+        (testBitAndImmsFloat):
+        (testBitAndArgsFloatWithUselessDoubleConversion):
+        (testBitOrArgs):
+        (testBitOrSameArg):
+        (testBitOrAndAndArgs):
+        (testBitOrAndSameArgs):
+        (testBitOrNotNot):
+        (testBitOrNotImm):
+        (testBitOrImms):
+        (testBitOrArgImm):
+        (testBitOrImmArg):
+        (testBitOrBitOrArgImmImm):
+        (testBitOrImmBitOrArgImm):
+        (testBitOrArgs32):
+        (testBitOrSameArg32):
+        (testBitOrImms32):
+        (testBitOrArgImm32):
+        (testBitOrImmArg32):
+        (addBitTests):
+        * b3/testb3_3.cpp:
+        (testSShrArgs):
+        (testSShrImms):
+        (testSShrArgImm):
+        (testSShrArg32):
+        (testSShrArgs32):
+        (testSShrImms32):
+        (testSShrArgImm32):
+        (testZShrArgs):
+        (testZShrImms):
+        (testZShrArgImm):
+        (testZShrArg32):
+        (testZShrArgs32):
+        (testZShrImms32):
+        (testZShrArgImm32):
+        (zero):
+        (negativeZero):
+        (addArgTests):
+        (addCallTests):
+        (addShrTests):
+        * b3/testb3_4.cpp:
+        (addSExtTests):
+        * b3/testb3_6.cpp:
+        (testSShrShl32):
+        (testSShrShl64):
+        (addSShrShTests):
+
 2019-07-31  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Debugger: support emulateUserGesture parameter in Debugger.evaluateOnCallFrame
index 6f014bb..687262a 100644 (file)
@@ -404,8 +404,6 @@ void testBranch64EqualMem(int64_t left, int64_t right);
 void testBranch64EqualMemImm(int64_t left, int64_t right);
 void testStore8Load8Z(int32_t value);
 void testStore16Load16Z(int32_t value);
-void testSShrShl32(int32_t value, int32_t sshrAmount, int32_t shlAmount);
-void testSShrShl64(int64_t value, int32_t sshrAmount, int32_t shlAmount);
 void testTrivialInfiniteLoop();
 void testFoldPathEqual();
 void testLShiftSelf32();
@@ -488,20 +486,6 @@ void testShlArgs32(int32_t, int32_t);
 void testShlImms32(int32_t, int32_t);
 void testShlArgImm32(int32_t, int32_t);
 void testShlZShrArgImm32(int32_t, int32_t);
-void testSShrArgs(int64_t, int64_t);
-void testSShrImms(int64_t, int64_t);
-void testSShrArgImm(int64_t, int64_t);
-void testSShrArg32(int32_t);
-void testSShrArgs32(int32_t, int32_t);
-void testSShrImms32(int32_t, int32_t);
-void testSShrArgImm32(int32_t, int32_t);
-void testZShrArgs(uint64_t, uint64_t);
-void testZShrImms(uint64_t, uint64_t);
-void testZShrArgImm(uint64_t, uint64_t);
-void testZShrArg32(uint32_t);
-void testZShrArgs32(uint32_t, uint32_t);
-void testZShrImms32(uint32_t, uint32_t);
-void testZShrArgImm32(uint32_t, uint32_t);
 void testClzArg64(int64_t);
 void testClzMem64(int64_t);
 void testClzArg32(int32_t);
@@ -745,13 +729,8 @@ void testLoadOffsetImm9Min();
 void testLoadOffsetImm9MinMinusOne();
 void testLoadOffsetScaledUnsignedImm12Max();
 void testLoadOffsetScaledUnsignedOverImm12Max();
-void testBitXorTreeArgs(int64_t, int64_t);
-void testBitXorTreeArgsEven(int64_t, int64_t);
-void testBitXorTreeArgImm(int64_t, int64_t);
 void testAddTreeArg32(int32_t);
 void testMulTreeArg32(int32_t);
-void testBitAndTreeArg32(int32_t);
-void testBitOrTreeArg32(int32_t);
 void testArg(int argument);
 void testReturnConst64(int64_t value);
 void testReturnVoid();
@@ -1023,51 +1002,16 @@ void testTernarySubInstructionSelection(B3::Opcode valueModifier, Type valueType
 void testNegDouble(double);
 void testNegFloat(float);
 void testNegFloatWithUselessDoubleConversion(float);
-void testBitAndArgs(int64_t, int64_t);
-void testBitAndSameArg(int64_t);
-void testBitAndNotNot(int64_t, int64_t);
-void testBitAndNotImm(int64_t, int64_t);
-void testBitAndImms(int64_t, int64_t);
-void testBitAndArgImm(int64_t, int64_t);
-void testBitAndImmArg(int64_t, int64_t);
-void testBitAndBitAndArgImmImm(int64_t, int64_t, int64_t c);
-void testBitAndImmBitAndArgImm(int64_t, int64_t, int64_t c);
-void testBitAndArgs32(int, int);
-void testBitAndSameArg32(int);
-void testBitAndImms32(int, int);
-void testBitAndArgImm32(int, int);
-void testBitAndImmArg32(int, int);
-void testBitAndBitAndArgImmImm32(int, int, int c);
-void testBitAndImmBitAndArgImm32(int, int, int c);
-void testBitAndWithMaskReturnsBooleans(int64_t, int64_t);
-void testBitAndArgDouble(double);
-void testBitAndArgsDouble(double, double);
-void testBitAndArgImmDouble(double, double);
-void testBitAndImmsDouble(double, double);
-void testBitAndArgFloat(float);
-void testBitAndArgsFloat(float, float);
-void testBitAndArgImmFloat(float, float);
-void testBitAndImmsFloat(float, float);
-void testBitAndArgsFloatWithUselessDoubleConversion(float, float);
-void testBitOrArgs(int64_t, int64_t);
-void testBitOrSameArg(int64_t);
-void testBitOrAndAndArgs(int64_t, int64_t, int64_t c);
-void testBitOrAndSameArgs(int64_t, int64_t);
-void testBitOrNotNot(int64_t, int64_t);
-void testBitOrNotImm(int64_t, int64_t);
-void testBitOrImms(int64_t, int64_t);
-void testBitOrArgImm(int64_t, int64_t);
-void testBitOrImmArg(int64_t, int64_t);
-void testBitOrBitOrArgImmImm(int64_t, int64_t, int64_t c);
-void testBitOrImmBitOrArgImm(int64_t, int64_t, int64_t c);
-void testBitOrArgs32(int, int);
-void testBitOrSameArg32(int);
-void testBitOrImms32(int, int);
-void testBitOrArgImm32(int, int);
-void testBitOrImmArg32(int, int);
 
-void addAtomicTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>& tasks);
-void addLoadTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>& tasks);
+void addArgTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&);
+void addBitTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&);
+void addCallTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&);
+void addSExtTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&);
+void addSShrShTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&);
+void addShrTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&);
+void addAtomicTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&);
+void addLoadTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&);
+
 bool shouldRun(const char* filter, const char* testName);
 
 #endif // ENABLE(B3_JIT)
index 383112a..82dea35 100644 (file)
 
 Lock crashLock;
 
-// Make sure the compiler does not try to optimize anything out.
-static NEVER_INLINE double zero()
-{
-    return 0.;
-}
-
-static double negativeZero()
-{
-    return -zero();
-}
-
 bool shouldRun(const char* filter, const char* testName)
 {
     // FIXME: These tests fail <https://bugs.webkit.org/show_bug.cgi?id=199330>.
@@ -168,455 +157,16 @@ void run(const char* filter)
     RUN(testReturnConst64(-42));
     RUN(testReturnVoid());
 
-    RUN_BINARY(testBitXorTreeArgs, int64Operands(), int64Operands());
-    RUN_BINARY(testBitXorTreeArgsEven, int64Operands(), int64Operands());
-    RUN_BINARY(testBitXorTreeArgImm, int64Operands(), int64Operands());
     RUN_UNARY(testAddTreeArg32, int32Operands());
     RUN_UNARY(testMulTreeArg32, int32Operands());
-    RUN_UNARY(testBitAndTreeArg32, int32Operands());
-    RUN_UNARY(testBitOrTreeArg32, int32Operands());
-
-    RUN(testAddArg(111));
-    RUN(testAddArgs(1, 1));
-    RUN(testAddArgs(1, 2));
-    RUN(testAddArgImm(1, 2));
-    RUN(testAddArgImm(0, 2));
-    RUN(testAddArgImm(1, 0));
-    RUN(testAddImmArg(1, 2));
-    RUN(testAddImmArg(0, 2));
-    RUN(testAddImmArg(1, 0));
-    RUN_BINARY(testAddArgMem, int64Operands(), int64Operands());
-    RUN_BINARY(testAddMemArg, int64Operands(), int64Operands());
-    RUN_BINARY(testAddImmMem, int64Operands(), int64Operands());
-    RUN_UNARY(testAddArg32, int32Operands());
-    RUN(testAddArgs32(1, 1));
-    RUN(testAddArgs32(1, 2));
-    RUN_BINARY(testAddArgMem32, int32Operands(), int32Operands());
-    RUN_BINARY(testAddMemArg32, int32Operands(), int32Operands());
-    RUN_BINARY(testAddImmMem32, int32Operands(), int32Operands());
-    RUN_BINARY(testAddNeg1, int32Operands(), int32Operands());
-    RUN_BINARY(testAddNeg2, int32Operands(), int32Operands());
-    RUN(testAddArgZeroImmZDef());
-    RUN(testAddLoadTwice());
-    RUN_TERNARY(testAddMulMulArgs, int64Operands(), int64Operands(), int64Operands());
-
-    RUN(testAddArgDouble(M_PI));
-    RUN(testAddArgsDouble(M_PI, 1));
-    RUN(testAddArgsDouble(M_PI, -M_PI));
-    RUN(testAddArgImmDouble(M_PI, 1));
-    RUN(testAddArgImmDouble(M_PI, 0));
-    RUN(testAddArgImmDouble(M_PI, negativeZero()));
-    RUN(testAddArgImmDouble(0, 0));
-    RUN(testAddArgImmDouble(0, negativeZero()));
-    RUN(testAddArgImmDouble(negativeZero(), 0));
-    RUN(testAddArgImmDouble(negativeZero(), negativeZero()));
-    RUN(testAddImmArgDouble(M_PI, 1));
-    RUN(testAddImmArgDouble(M_PI, 0));
-    RUN(testAddImmArgDouble(M_PI, negativeZero()));
-    RUN(testAddImmArgDouble(0, 0));
-    RUN(testAddImmArgDouble(0, negativeZero()));
-    RUN(testAddImmArgDouble(negativeZero(), 0));
-    RUN(testAddImmArgDouble(negativeZero(), negativeZero()));
-    RUN(testAddImmsDouble(M_PI, 1));
-    RUN(testAddImmsDouble(M_PI, 0));
-    RUN(testAddImmsDouble(M_PI, negativeZero()));
-    RUN(testAddImmsDouble(0, 0));
-    RUN(testAddImmsDouble(0, negativeZero()));
-    RUN(testAddImmsDouble(negativeZero(), negativeZero()));
-    RUN_UNARY(testAddArgFloat, floatingPointOperands<float>());
-    RUN_BINARY(testAddArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testAddFPRArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testAddArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testAddImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testAddImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_UNARY(testAddArgFloatWithUselessDoubleConversion, floatingPointOperands<float>());
-    RUN_BINARY(testAddArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testAddArgsFloatWithEffectfulDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
-
-    RUN(testMulArg(5));
-    RUN(testMulAddArg(5));
-    RUN(testMulAddArg(85));
-    RUN(testMulArgStore(5));
-    RUN(testMulArgStore(85));
-    RUN(testMulArgs(1, 1));
-    RUN(testMulArgs(1, 2));
-    RUN(testMulArgs(3, 3));
-    RUN(testMulArgImm(1, 2));
-    RUN(testMulArgImm(1, 4));
-    RUN(testMulArgImm(1, 8));
-    RUN(testMulArgImm(1, 16));
-    RUN(testMulArgImm(1, 0x80000000llu));
-    RUN(testMulArgImm(1, 0x800000000000llu));
-    RUN(testMulArgImm(7, 2));
-    RUN(testMulArgImm(7, 4));
-    RUN(testMulArgImm(7, 8));
-    RUN(testMulArgImm(7, 16));
-    RUN(testMulArgImm(7, 0x80000000llu));
-    RUN(testMulArgImm(7, 0x800000000000llu));
-    RUN(testMulArgImm(-42, 2));
-    RUN(testMulArgImm(-42, 4));
-    RUN(testMulArgImm(-42, 8));
-    RUN(testMulArgImm(-42, 16));
-    RUN(testMulArgImm(-42, 0x80000000llu));
-    RUN(testMulArgImm(-42, 0x800000000000llu));
-    RUN(testMulArgImm(0, 2));
-    RUN(testMulArgImm(1, 0));
-    RUN(testMulArgImm(3, 3));
-    RUN(testMulArgImm(3, -1));
-    RUN(testMulArgImm(-3, -1));
-    RUN(testMulArgImm(0, -1));
-    RUN(testMulImmArg(1, 2));
-    RUN(testMulImmArg(0, 2));
-    RUN(testMulImmArg(1, 0));
-    RUN(testMulImmArg(3, 3));
-    RUN(testMulImm32SignExtend(1, 2));
-    RUN(testMulImm32SignExtend(0, 2));
-    RUN(testMulImm32SignExtend(1, 0));
-    RUN(testMulImm32SignExtend(3, 3));
-    RUN(testMulImm32SignExtend(0xFFFFFFFF, 0xFFFFFFFF));
-    RUN(testMulImm32SignExtend(0xFFFFFFFE, 0xFFFFFFFF));
-    RUN(testMulImm32SignExtend(0xFFFFFFFF, 0xFFFFFFFE));
-    RUN(testMulArgs32(1, 1));
-    RUN(testMulArgs32(1, 2));
-    RUN(testMulArgs32(0xFFFFFFFF, 0xFFFFFFFF));
-    RUN(testMulArgs32(0xFFFFFFFE, 0xFFFFFFFF));
-    RUN(testMulArgs32SignExtend(1, 1));
-    RUN(testMulArgs32SignExtend(1, 2));
-    RUN(testMulArgs32SignExtend(0xFFFFFFFF, 0xFFFFFFFF));
-    RUN(testMulArgs32SignExtend(0xFFFFFFFE, 0xFFFFFFFF));
-    RUN(testMulLoadTwice());
-    RUN(testMulAddArgsLeft());
-    RUN(testMulAddArgsRight());
-    RUN(testMulAddArgsLeft32());
-    RUN(testMulAddArgsRight32());
-    RUN(testMulSubArgsLeft());
-    RUN(testMulSubArgsRight());
-    RUN(testMulSubArgsLeft32());
-    RUN(testMulSubArgsRight32());
-    RUN(testMulNegArgs());
-    RUN(testMulNegArgs32());
-
-    RUN_BINARY(testMulArgNegArg, int64Operands(), int64Operands())
-    RUN_BINARY(testMulNegArgArg, int64Operands(), int64Operands())
-    RUN_UNARY(testMulArgDouble, floatingPointOperands<double>());
-    RUN_BINARY(testMulArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testMulArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testMulImmArgDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testMulImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_UNARY(testMulArgFloat, floatingPointOperands<float>());
-    RUN_BINARY(testMulArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testMulArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testMulImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testMulImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_UNARY(testMulArgFloatWithUselessDoubleConversion, floatingPointOperands<float>());
-    RUN_BINARY(testMulArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testMulArgsFloatWithEffectfulDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
-
-    RUN(testDivArgDouble(M_PI));
-    RUN(testDivArgsDouble(M_PI, 1));
-    RUN(testDivArgsDouble(M_PI, -M_PI));
-    RUN(testDivArgImmDouble(M_PI, 1));
-    RUN(testDivArgImmDouble(M_PI, 0));
-    RUN(testDivArgImmDouble(M_PI, negativeZero()));
-    RUN(testDivArgImmDouble(0, 0));
-    RUN(testDivArgImmDouble(0, negativeZero()));
-    RUN(testDivArgImmDouble(negativeZero(), 0));
-    RUN(testDivArgImmDouble(negativeZero(), negativeZero()));
-    RUN(testDivImmArgDouble(M_PI, 1));
-    RUN(testDivImmArgDouble(M_PI, 0));
-    RUN(testDivImmArgDouble(M_PI, negativeZero()));
-    RUN(testDivImmArgDouble(0, 0));
-    RUN(testDivImmArgDouble(0, negativeZero()));
-    RUN(testDivImmArgDouble(negativeZero(), 0));
-    RUN(testDivImmArgDouble(negativeZero(), negativeZero()));
-    RUN(testDivImmsDouble(M_PI, 1));
-    RUN(testDivImmsDouble(M_PI, 0));
-    RUN(testDivImmsDouble(M_PI, negativeZero()));
-    RUN(testDivImmsDouble(0, 0));
-    RUN(testDivImmsDouble(0, negativeZero()));
-    RUN(testDivImmsDouble(negativeZero(), negativeZero()));
-    RUN_UNARY(testDivArgFloat, floatingPointOperands<float>());
-    RUN_BINARY(testDivArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testDivArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testDivImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testDivImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_UNARY(testDivArgFloatWithUselessDoubleConversion, floatingPointOperands<float>());
-    RUN_BINARY(testDivArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testDivArgsFloatWithEffectfulDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
-
-    RUN_BINARY(testUDivArgsInt32, int32Operands(), int32Operands());
-    RUN_BINARY(testUDivArgsInt64, int64Operands(), int64Operands());
-
-    RUN_UNARY(testModArgDouble, floatingPointOperands<double>());
-    RUN_BINARY(testModArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testModArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testModImmArgDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testModImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_UNARY(testModArgFloat, floatingPointOperands<float>());
-    RUN_BINARY(testModArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testModArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testModImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testModImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-
-    RUN_BINARY(testUModArgsInt32, int32Operands(), int32Operands());
-    RUN_BINARY(testUModArgsInt64, int64Operands(), int64Operands());
-
-    RUN(testSubArg(24));
-    RUN(testSubArgs(1, 1));
-    RUN(testSubArgs(1, 2));
-    RUN(testSubArgs(13, -42));
-    RUN(testSubArgs(-13, 42));
-    RUN(testSubArgImm(1, 1));
-    RUN(testSubArgImm(1, 2));
-    RUN(testSubArgImm(13, -42));
-    RUN(testSubArgImm(-13, 42));
-    RUN(testSubArgImm(42, 0));
-    RUN(testSubImmArg(1, 1));
-    RUN(testSubImmArg(1, 2));
-    RUN(testSubImmArg(13, -42));
-    RUN(testSubImmArg(-13, 42));
-    RUN_BINARY(testSubArgMem, int64Operands(), int64Operands());
-    RUN_BINARY(testSubMemArg, int64Operands(), int64Operands());
-    RUN_BINARY(testSubImmMem, int32Operands(), int32Operands());
-    RUN_BINARY(testSubMemImm, int32Operands(), int32Operands());
-    RUN_BINARY(testSubNeg, int32Operands(), int32Operands());
-    RUN_BINARY(testNegSub, int32Operands(), int32Operands());
-    RUN_UNARY(testNegValueSubOne, int32Operands());
-    RUN_BINARY(testNegMulArgImm, int64Operands(), int64Operands());
-    RUN_TERNARY(testSubMulMulArgs, int64Operands(), int64Operands(), int64Operands());
-
-    RUN_TERNARY(testSubSub, int32Operands(), int32Operands(), int32Operands());
-    RUN_TERNARY(testSubSub2, int32Operands(), int32Operands(), int32Operands());
-    RUN_TERNARY(testSubAdd, int32Operands(), int32Operands(), int32Operands());
-    RUN_BINARY(testSubFirstNeg, int32Operands(), int32Operands());
-
-    RUN(testSubArgs32(1, 1));
-    RUN(testSubArgs32(1, 2));
-    RUN(testSubArgs32(13, -42));
-    RUN(testSubArgs32(-13, 42));
-    RUN(testSubArgImm32(1, 1));
-    RUN(testSubArgImm32(1, 2));
-    RUN(testSubArgImm32(13, -42));
-    RUN(testSubArgImm32(-13, 42));
-    RUN(testSubImmArg32(1, 1));
-    RUN(testSubImmArg32(1, 2));
-    RUN(testSubImmArg32(13, -42));
-    RUN(testSubImmArg32(-13, 42));
-    RUN_BINARY(testSubArgMem32, int32Operands(), int32Operands());
-    RUN_BINARY(testSubMemArg32, int32Operands(), int32Operands());
-    RUN_BINARY(testSubImmMem32, int32Operands(), int32Operands());
-    RUN_BINARY(testSubMemImm32, int32Operands(), int32Operands());
-    RUN_UNARY(testNegValueSubOne32, int64Operands());
-
-    RUN_UNARY(testSubArgDouble, floatingPointOperands<double>());
-    RUN_BINARY(testSubArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testSubArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testSubImmArgDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testSubImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_UNARY(testSubArgFloat, floatingPointOperands<float>());
-    RUN_BINARY(testSubArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testSubArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testSubImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testSubImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_UNARY(testSubArgFloatWithUselessDoubleConversion, floatingPointOperands<float>());
-    RUN_BINARY(testSubArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testSubArgsFloatWithEffectfulDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+
+    addArgTests(filter, tasks);
 
     RUN_UNARY(testNegDouble, floatingPointOperands<double>());
     RUN_UNARY(testNegFloat, floatingPointOperands<float>());
     RUN_UNARY(testNegFloatWithUselessDoubleConversion, floatingPointOperands<float>());
 
-    RUN(testBitAndArgs(43, 43));
-    RUN(testBitAndArgs(43, 0));
-    RUN(testBitAndArgs(10, 3));
-    RUN(testBitAndArgs(42, 0xffffffffffffffff));
-    RUN(testBitAndSameArg(43));
-    RUN(testBitAndSameArg(0));
-    RUN(testBitAndSameArg(3));
-    RUN(testBitAndSameArg(0xffffffffffffffff));
-    RUN(testBitAndImms(43, 43));
-    RUN(testBitAndImms(43, 0));
-    RUN(testBitAndImms(10, 3));
-    RUN(testBitAndImms(42, 0xffffffffffffffff));
-    RUN(testBitAndArgImm(43, 43));
-    RUN(testBitAndArgImm(43, 0));
-    RUN(testBitAndArgImm(10, 3));
-    RUN(testBitAndArgImm(42, 0xffffffffffffffff));
-    RUN(testBitAndArgImm(42, 0xff));
-    RUN(testBitAndArgImm(300, 0xff));
-    RUN(testBitAndArgImm(-300, 0xff));
-    RUN(testBitAndArgImm(42, 0xffff));
-    RUN(testBitAndArgImm(40000, 0xffff));
-    RUN(testBitAndArgImm(-40000, 0xffff));
-    RUN(testBitAndImmArg(43, 43));
-    RUN(testBitAndImmArg(43, 0));
-    RUN(testBitAndImmArg(10, 3));
-    RUN(testBitAndImmArg(42, 0xffffffffffffffff));
-    RUN(testBitAndBitAndArgImmImm(2, 7, 3));
-    RUN(testBitAndBitAndArgImmImm(1, 6, 6));
-    RUN(testBitAndBitAndArgImmImm(0xffff, 24, 7));
-    RUN(testBitAndImmBitAndArgImm(7, 2, 3));
-    RUN(testBitAndImmBitAndArgImm(6, 1, 6));
-    RUN(testBitAndImmBitAndArgImm(24, 0xffff, 7));
-    RUN(testBitAndArgs32(43, 43));
-    RUN(testBitAndArgs32(43, 0));
-    RUN(testBitAndArgs32(10, 3));
-    RUN(testBitAndArgs32(42, 0xffffffff));
-    RUN(testBitAndSameArg32(43));
-    RUN(testBitAndSameArg32(0));
-    RUN(testBitAndSameArg32(3));
-    RUN(testBitAndSameArg32(0xffffffff));
-    RUN(testBitAndImms32(43, 43));
-    RUN(testBitAndImms32(43, 0));
-    RUN(testBitAndImms32(10, 3));
-    RUN(testBitAndImms32(42, 0xffffffff));
-    RUN(testBitAndArgImm32(43, 43));
-    RUN(testBitAndArgImm32(43, 0));
-    RUN(testBitAndArgImm32(10, 3));
-    RUN(testBitAndArgImm32(42, 0xffffffff));
-    RUN(testBitAndImmArg32(43, 43));
-    RUN(testBitAndImmArg32(43, 0));
-    RUN(testBitAndImmArg32(10, 3));
-    RUN(testBitAndImmArg32(42, 0xffffffff));
-    RUN(testBitAndImmArg32(42, 0xff));
-    RUN(testBitAndImmArg32(300, 0xff));
-    RUN(testBitAndImmArg32(-300, 0xff));
-    RUN(testBitAndImmArg32(42, 0xffff));
-    RUN(testBitAndImmArg32(40000, 0xffff));
-    RUN(testBitAndImmArg32(-40000, 0xffff));
-    RUN(testBitAndBitAndArgImmImm32(2, 7, 3));
-    RUN(testBitAndBitAndArgImmImm32(1, 6, 6));
-    RUN(testBitAndBitAndArgImmImm32(0xffff, 24, 7));
-    RUN(testBitAndImmBitAndArgImm32(7, 2, 3));
-    RUN(testBitAndImmBitAndArgImm32(6, 1, 6));
-    RUN(testBitAndImmBitAndArgImm32(24, 0xffff, 7));
-    RUN_BINARY(testBitAndWithMaskReturnsBooleans, int64Operands(), int64Operands());
-    RUN_UNARY(testBitAndArgDouble, floatingPointOperands<double>());
-    RUN_BINARY(testBitAndArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testBitAndArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testBitAndImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_UNARY(testBitAndArgFloat, floatingPointOperands<float>());
-    RUN_BINARY(testBitAndArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testBitAndArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testBitAndImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testBitAndArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testBitAndNotNot, int64Operands(), int64Operands());
-    RUN_BINARY(testBitAndNotImm, int64Operands(), int64Operands());
-
-    RUN(testBitOrArgs(43, 43));
-    RUN(testBitOrArgs(43, 0));
-    RUN(testBitOrArgs(10, 3));
-    RUN(testBitOrArgs(42, 0xffffffffffffffff));
-    RUN(testBitOrSameArg(43));
-    RUN(testBitOrSameArg(0));
-    RUN(testBitOrSameArg(3));
-    RUN(testBitOrSameArg(0xffffffffffffffff));
-    RUN(testBitOrImms(43, 43));
-    RUN(testBitOrImms(43, 0));
-    RUN(testBitOrImms(10, 3));
-    RUN(testBitOrImms(42, 0xffffffffffffffff));
-    RUN(testBitOrArgImm(43, 43));
-    RUN(testBitOrArgImm(43, 0));
-    RUN(testBitOrArgImm(10, 3));
-    RUN(testBitOrArgImm(42, 0xffffffffffffffff));
-    RUN(testBitOrImmArg(43, 43));
-    RUN(testBitOrImmArg(43, 0));
-    RUN(testBitOrImmArg(10, 3));
-    RUN(testBitOrImmArg(42, 0xffffffffffffffff));
-    RUN(testBitOrBitOrArgImmImm(2, 7, 3));
-    RUN(testBitOrBitOrArgImmImm(1, 6, 6));
-    RUN(testBitOrBitOrArgImmImm(0xffff, 24, 7));
-    RUN(testBitOrImmBitOrArgImm(7, 2, 3));
-    RUN(testBitOrImmBitOrArgImm(6, 1, 6));
-    RUN(testBitOrImmBitOrArgImm(24, 0xffff, 7));
-    RUN(testBitOrArgs32(43, 43));
-    RUN(testBitOrArgs32(43, 0));
-    RUN(testBitOrArgs32(10, 3));
-    RUN(testBitOrArgs32(42, 0xffffffff));
-    RUN(testBitOrSameArg32(43));
-    RUN(testBitOrSameArg32(0));
-    RUN(testBitOrSameArg32(3));
-    RUN(testBitOrSameArg32(0xffffffff));
-    RUN(testBitOrImms32(43, 43));
-    RUN(testBitOrImms32(43, 0));
-    RUN(testBitOrImms32(10, 3));
-    RUN(testBitOrImms32(42, 0xffffffff));
-    RUN(testBitOrArgImm32(43, 43));
-    RUN(testBitOrArgImm32(43, 0));
-    RUN(testBitOrArgImm32(10, 3));
-    RUN(testBitOrArgImm32(42, 0xffffffff));
-    RUN(testBitOrImmArg32(43, 43));
-    RUN(testBitOrImmArg32(43, 0));
-    RUN(testBitOrImmArg32(10, 3));
-    RUN(testBitOrImmArg32(42, 0xffffffff));
-    RUN(testBitOrBitOrArgImmImm32(2, 7, 3));
-    RUN(testBitOrBitOrArgImmImm32(1, 6, 6));
-    RUN(testBitOrBitOrArgImmImm32(0xffff, 24, 7));
-    RUN(testBitOrImmBitOrArgImm32(7, 2, 3));
-    RUN(testBitOrImmBitOrArgImm32(6, 1, 6));
-    RUN(testBitOrImmBitOrArgImm32(24, 0xffff, 7));
-    RUN_UNARY(testBitOrArgDouble, floatingPointOperands<double>());
-    RUN_BINARY(testBitOrArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testBitOrArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_BINARY(testBitOrImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
-    RUN_UNARY(testBitOrArgFloat, floatingPointOperands<float>());
-    RUN_BINARY(testBitOrArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testBitOrArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testBitOrImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_BINARY(testBitOrArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN_TERNARY(testBitOrAndAndArgs, int64Operands(), int64Operands(), int64Operands());
-    RUN_BINARY(testBitOrAndSameArgs, int64Operands(), int64Operands());
-    RUN_BINARY(testBitOrNotNot, int64Operands(), int64Operands());
-    RUN_BINARY(testBitOrNotImm, int64Operands(), int64Operands());
-
-    RUN_BINARY(testBitXorArgs, int64Operands(), int64Operands());
-    RUN_UNARY(testBitXorSameArg, int64Operands());
-    RUN_BINARY(testBitXorImms, int64Operands(), int64Operands());
-    RUN_BINARY(testBitXorArgImm, int64Operands(), int64Operands());
-    RUN_BINARY(testBitXorImmArg, int64Operands(), int64Operands());
-    RUN(testBitXorBitXorArgImmImm(2, 7, 3));
-    RUN(testBitXorBitXorArgImmImm(1, 6, 6));
-    RUN(testBitXorBitXorArgImmImm(0xffff, 24, 7));
-    RUN(testBitXorImmBitXorArgImm(7, 2, 3));
-    RUN(testBitXorImmBitXorArgImm(6, 1, 6));
-    RUN(testBitXorImmBitXorArgImm(24, 0xffff, 7));
-    RUN(testBitXorArgs32(43, 43));
-    RUN(testBitXorArgs32(43, 0));
-    RUN(testBitXorArgs32(10, 3));
-    RUN(testBitXorArgs32(42, 0xffffffff));
-    RUN(testBitXorSameArg32(43));
-    RUN(testBitXorSameArg32(0));
-    RUN(testBitXorSameArg32(3));
-    RUN(testBitXorSameArg32(0xffffffff));
-    RUN(testBitXorImms32(43, 43));
-    RUN(testBitXorImms32(43, 0));
-    RUN(testBitXorImms32(10, 3));
-    RUN(testBitXorImms32(42, 0xffffffff));
-    RUN(testBitXorArgImm32(43, 43));
-    RUN(testBitXorArgImm32(43, 0));
-    RUN(testBitXorArgImm32(10, 3));
-    RUN(testBitXorArgImm32(42, 0xffffffff));
-    RUN(testBitXorImmArg32(43, 43));
-    RUN(testBitXorImmArg32(43, 0));
-    RUN(testBitXorImmArg32(10, 3));
-    RUN(testBitXorImmArg32(42, 0xffffffff));
-    RUN(testBitXorBitXorArgImmImm32(2, 7, 3));
-    RUN(testBitXorBitXorArgImmImm32(1, 6, 6));
-    RUN(testBitXorBitXorArgImmImm32(0xffff, 24, 7));
-    RUN(testBitXorImmBitXorArgImm32(7, 2, 3));
-    RUN(testBitXorImmBitXorArgImm32(6, 1, 6));
-    RUN(testBitXorImmBitXorArgImm32(24, 0xffff, 7));
-    RUN_TERNARY(testBitXorAndAndArgs, int64Operands(), int64Operands(), int64Operands());
-    RUN_BINARY(testBitXorAndSameArgs, int64Operands(), int64Operands());
-
-    RUN_UNARY(testBitNotArg, int64Operands());
-    RUN_UNARY(testBitNotImm, int64Operands());
-    RUN_UNARY(testBitNotMem, int64Operands());
-    RUN_UNARY(testBitNotArg32, int32Operands());
-    RUN_UNARY(testBitNotImm32, int32Operands());
-    RUN_UNARY(testBitNotMem32, int32Operands());
-    RUN_BINARY(testNotOnBooleanAndBranch32, int32Operands(), int32Operands());
-    RUN_BINARY(testBitNotOnBooleanAndBranch32, int32Operands(), int32Operands());
+    addBitTests(filter, tasks);
 
     RUN(testShlArgs(1, 0));
     RUN(testShlArgs(1, 1));
@@ -675,89 +225,7 @@ void run(const char* filter)
     RUN(testShlZShrArgImm32(0xffffffff, 1));
     RUN(testShlZShrArgImm32(0xffffffff, 63));
 
-    RUN(testSShrArgs(1, 0));
-    RUN(testSShrArgs(1, 1));
-    RUN(testSShrArgs(1, 62));
-    RUN(testSShrArgs(0xffffffffffffffff, 0));
-    RUN(testSShrArgs(0xffffffffffffffff, 1));
-    RUN(testSShrArgs(0xffffffffffffffff, 63));
-    RUN(testSShrImms(1, 0));
-    RUN(testSShrImms(1, 1));
-    RUN(testSShrImms(1, 62));
-    RUN(testSShrImms(1, 65));
-    RUN(testSShrImms(0xffffffffffffffff, 0));
-    RUN(testSShrImms(0xffffffffffffffff, 1));
-    RUN(testSShrImms(0xffffffffffffffff, 63));
-    RUN(testSShrArgImm(1, 0));
-    RUN(testSShrArgImm(1, 1));
-    RUN(testSShrArgImm(1, 62));
-    RUN(testSShrArgImm(1, 65));
-    RUN(testSShrArgImm(0xffffffffffffffff, 0));
-    RUN(testSShrArgImm(0xffffffffffffffff, 1));
-    RUN(testSShrArgImm(0xffffffffffffffff, 63));
-    RUN(testSShrArg32(32));
-    RUN(testSShrArgs32(1, 0));
-    RUN(testSShrArgs32(1, 1));
-    RUN(testSShrArgs32(1, 62));
-    RUN(testSShrArgs32(1, 33));
-    RUN(testSShrArgs32(0xffffffff, 0));
-    RUN(testSShrArgs32(0xffffffff, 1));
-    RUN(testSShrArgs32(0xffffffff, 63));
-    RUN(testSShrImms32(1, 0));
-    RUN(testSShrImms32(1, 1));
-    RUN(testSShrImms32(1, 62));
-    RUN(testSShrImms32(1, 33));
-    RUN(testSShrImms32(0xffffffff, 0));
-    RUN(testSShrImms32(0xffffffff, 1));
-    RUN(testSShrImms32(0xffffffff, 63));
-    RUN(testSShrArgImm32(1, 0));
-    RUN(testSShrArgImm32(1, 1));
-    RUN(testSShrArgImm32(1, 62));
-    RUN(testSShrArgImm32(0xffffffff, 0));
-    RUN(testSShrArgImm32(0xffffffff, 1));
-    RUN(testSShrArgImm32(0xffffffff, 63));
-
-    RUN(testZShrArgs(1, 0));
-    RUN(testZShrArgs(1, 1));
-    RUN(testZShrArgs(1, 62));
-    RUN(testZShrArgs(0xffffffffffffffff, 0));
-    RUN(testZShrArgs(0xffffffffffffffff, 1));
-    RUN(testZShrArgs(0xffffffffffffffff, 63));
-    RUN(testZShrImms(1, 0));
-    RUN(testZShrImms(1, 1));
-    RUN(testZShrImms(1, 62));
-    RUN(testZShrImms(1, 65));
-    RUN(testZShrImms(0xffffffffffffffff, 0));
-    RUN(testZShrImms(0xffffffffffffffff, 1));
-    RUN(testZShrImms(0xffffffffffffffff, 63));
-    RUN(testZShrArgImm(1, 0));
-    RUN(testZShrArgImm(1, 1));
-    RUN(testZShrArgImm(1, 62));
-    RUN(testZShrArgImm(1, 65));
-    RUN(testZShrArgImm(0xffffffffffffffff, 0));
-    RUN(testZShrArgImm(0xffffffffffffffff, 1));
-    RUN(testZShrArgImm(0xffffffffffffffff, 63));
-    RUN(testZShrArg32(32));
-    RUN(testZShrArgs32(1, 0));
-    RUN(testZShrArgs32(1, 1));
-    RUN(testZShrArgs32(1, 62));
-    RUN(testZShrArgs32(1, 33));
-    RUN(testZShrArgs32(0xffffffff, 0));
-    RUN(testZShrArgs32(0xffffffff, 1));
-    RUN(testZShrArgs32(0xffffffff, 63));
-    RUN(testZShrImms32(1, 0));
-    RUN(testZShrImms32(1, 1));
-    RUN(testZShrImms32(1, 62));
-    RUN(testZShrImms32(1, 33));
-    RUN(testZShrImms32(0xffffffff, 0));
-    RUN(testZShrImms32(0xffffffff, 1));
-    RUN(testZShrImms32(0xffffffff, 63));
-    RUN(testZShrArgImm32(1, 0));
-    RUN(testZShrArgImm32(1, 1));
-    RUN(testZShrArgImm32(1, 62));
-    RUN(testZShrArgImm32(0xffffffff, 0));
-    RUN(testZShrArgImm32(0xffffffff, 1));
-    RUN(testZShrArgImm32(0xffffffff, 63));
+    addShrTests(filter, tasks);
 
     RUN_UNARY(testClzArg64, int64Operands());
     RUN_UNARY(testClzMem64, int64Operands());
@@ -1074,23 +542,7 @@ void run(const char* filter)
     RUN(testInt32ToDoublePartialRegisterStall());
     RUN(testInt32ToDoublePartialRegisterWithoutStall());
 
-    RUN(testCallSimple(1, 2));
-    RUN(testCallRare(1, 2));
-    RUN(testCallRareLive(1, 2, 3));
-    RUN(testCallSimplePure(1, 2));
-    RUN(testCallFunctionWithHellaArguments());
-    RUN(testCallFunctionWithHellaArguments2());
-    RUN(testCallFunctionWithHellaArguments3());
-
-    RUN(testReturnDouble(0.0));
-    RUN(testReturnDouble(negativeZero()));
-    RUN(testReturnDouble(42.5));
-    RUN_UNARY(testReturnFloat, floatingPointOperands<float>());
-
-    RUN(testCallSimpleDouble(1, 2));
-    RUN(testCallFunctionWithHellaDoubleArguments());
-    RUN_BINARY(testCallSimpleFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
-    RUN(testCallFunctionWithHellaFloatArguments());
+    addCallTests(filter, tasks);
 
     RUN(testLinearScanWithCalleeOnStack());
 
@@ -1194,200 +646,7 @@ void run(const char* filter)
     RUN(testTruncSExt32(1000000000ll));
     RUN(testTruncSExt32(-1000000000ll));
 
-    RUN(testSExt8(0));
-    RUN(testSExt8(1));
-    RUN(testSExt8(42));
-    RUN(testSExt8(-1));
-    RUN(testSExt8(0xff));
-    RUN(testSExt8(0x100));
-    RUN(testSExt8Fold(0));
-    RUN(testSExt8Fold(1));
-    RUN(testSExt8Fold(42));
-    RUN(testSExt8Fold(-1));
-    RUN(testSExt8Fold(0xff));
-    RUN(testSExt8Fold(0x100));
-    RUN(testSExt8SExt8(0));
-    RUN(testSExt8SExt8(1));
-    RUN(testSExt8SExt8(42));
-    RUN(testSExt8SExt8(-1));
-    RUN(testSExt8SExt8(0xff));
-    RUN(testSExt8SExt8(0x100));
-    RUN(testSExt8SExt16(0));
-    RUN(testSExt8SExt16(1));
-    RUN(testSExt8SExt16(42));
-    RUN(testSExt8SExt16(-1));
-    RUN(testSExt8SExt16(0xff));
-    RUN(testSExt8SExt16(0x100));
-    RUN(testSExt8SExt16(0xffff));
-    RUN(testSExt8SExt16(0x10000));
-    RUN(testSExt8BitAnd(0, 0));
-    RUN(testSExt8BitAnd(1, 0));
-    RUN(testSExt8BitAnd(42, 0));
-    RUN(testSExt8BitAnd(-1, 0));
-    RUN(testSExt8BitAnd(0xff, 0));
-    RUN(testSExt8BitAnd(0x100, 0));
-    RUN(testSExt8BitAnd(0xffff, 0));
-    RUN(testSExt8BitAnd(0x10000, 0));
-    RUN(testSExt8BitAnd(0, 0xf));
-    RUN(testSExt8BitAnd(1, 0xf));
-    RUN(testSExt8BitAnd(42, 0xf));
-    RUN(testSExt8BitAnd(-1, 0xf));
-    RUN(testSExt8BitAnd(0xff, 0xf));
-    RUN(testSExt8BitAnd(0x100, 0xf));
-    RUN(testSExt8BitAnd(0xffff, 0xf));
-    RUN(testSExt8BitAnd(0x10000, 0xf));
-    RUN(testSExt8BitAnd(0, 0xff));
-    RUN(testSExt8BitAnd(1, 0xff));
-    RUN(testSExt8BitAnd(42, 0xff));
-    RUN(testSExt8BitAnd(-1, 0xff));
-    RUN(testSExt8BitAnd(0xff, 0xff));
-    RUN(testSExt8BitAnd(0x100, 0xff));
-    RUN(testSExt8BitAnd(0xffff, 0xff));
-    RUN(testSExt8BitAnd(0x10000, 0xff));
-    RUN(testSExt8BitAnd(0, 0x80));
-    RUN(testSExt8BitAnd(1, 0x80));
-    RUN(testSExt8BitAnd(42, 0x80));
-    RUN(testSExt8BitAnd(-1, 0x80));
-    RUN(testSExt8BitAnd(0xff, 0x80));
-    RUN(testSExt8BitAnd(0x100, 0x80));
-    RUN(testSExt8BitAnd(0xffff, 0x80));
-    RUN(testSExt8BitAnd(0x10000, 0x80));
-    RUN(testBitAndSExt8(0, 0xf));
-    RUN(testBitAndSExt8(1, 0xf));
-    RUN(testBitAndSExt8(42, 0xf));
-    RUN(testBitAndSExt8(-1, 0xf));
-    RUN(testBitAndSExt8(0xff, 0xf));
-    RUN(testBitAndSExt8(0x100, 0xf));
-    RUN(testBitAndSExt8(0xffff, 0xf));
-    RUN(testBitAndSExt8(0x10000, 0xf));
-    RUN(testBitAndSExt8(0, 0xff));
-    RUN(testBitAndSExt8(1, 0xff));
-    RUN(testBitAndSExt8(42, 0xff));
-    RUN(testBitAndSExt8(-1, 0xff));
-    RUN(testBitAndSExt8(0xff, 0xff));
-    RUN(testBitAndSExt8(0x100, 0xff));
-    RUN(testBitAndSExt8(0xffff, 0xff));
-    RUN(testBitAndSExt8(0x10000, 0xff));
-    RUN(testBitAndSExt8(0, 0xfff));
-    RUN(testBitAndSExt8(1, 0xfff));
-    RUN(testBitAndSExt8(42, 0xfff));
-    RUN(testBitAndSExt8(-1, 0xfff));
-    RUN(testBitAndSExt8(0xff, 0xfff));
-    RUN(testBitAndSExt8(0x100, 0xfff));
-    RUN(testBitAndSExt8(0xffff, 0xfff));
-    RUN(testBitAndSExt8(0x10000, 0xfff));
-
-    RUN(testSExt16(0));
-    RUN(testSExt16(1));
-    RUN(testSExt16(42));
-    RUN(testSExt16(-1));
-    RUN(testSExt16(0xffff));
-    RUN(testSExt16(0x10000));
-    RUN(testSExt16Fold(0));
-    RUN(testSExt16Fold(1));
-    RUN(testSExt16Fold(42));
-    RUN(testSExt16Fold(-1));
-    RUN(testSExt16Fold(0xffff));
-    RUN(testSExt16Fold(0x10000));
-    RUN(testSExt16SExt8(0));
-    RUN(testSExt16SExt8(1));
-    RUN(testSExt16SExt8(42));
-    RUN(testSExt16SExt8(-1));
-    RUN(testSExt16SExt8(0xffff));
-    RUN(testSExt16SExt8(0x10000));
-    RUN(testSExt16SExt16(0));
-    RUN(testSExt16SExt16(1));
-    RUN(testSExt16SExt16(42));
-    RUN(testSExt16SExt16(-1));
-    RUN(testSExt16SExt16(0xffff));
-    RUN(testSExt16SExt16(0x10000));
-    RUN(testSExt16SExt16(0xffffff));
-    RUN(testSExt16SExt16(0x1000000));
-    RUN(testSExt16BitAnd(0, 0));
-    RUN(testSExt16BitAnd(1, 0));
-    RUN(testSExt16BitAnd(42, 0));
-    RUN(testSExt16BitAnd(-1, 0));
-    RUN(testSExt16BitAnd(0xffff, 0));
-    RUN(testSExt16BitAnd(0x10000, 0));
-    RUN(testSExt16BitAnd(0xffffff, 0));
-    RUN(testSExt16BitAnd(0x1000000, 0));
-    RUN(testSExt16BitAnd(0, 0xf));
-    RUN(testSExt16BitAnd(1, 0xf));
-    RUN(testSExt16BitAnd(42, 0xf));
-    RUN(testSExt16BitAnd(-1, 0xf));
-    RUN(testSExt16BitAnd(0xffff, 0xf));
-    RUN(testSExt16BitAnd(0x10000, 0xf));
-    RUN(testSExt16BitAnd(0xffffff, 0xf));
-    RUN(testSExt16BitAnd(0x1000000, 0xf));
-    RUN(testSExt16BitAnd(0, 0xffff));
-    RUN(testSExt16BitAnd(1, 0xffff));
-    RUN(testSExt16BitAnd(42, 0xffff));
-    RUN(testSExt16BitAnd(-1, 0xffff));
-    RUN(testSExt16BitAnd(0xffff, 0xffff));
-    RUN(testSExt16BitAnd(0x10000, 0xffff));
-    RUN(testSExt16BitAnd(0xffffff, 0xffff));
-    RUN(testSExt16BitAnd(0x1000000, 0xffff));
-    RUN(testSExt16BitAnd(0, 0x8000));
-    RUN(testSExt16BitAnd(1, 0x8000));
-    RUN(testSExt16BitAnd(42, 0x8000));
-    RUN(testSExt16BitAnd(-1, 0x8000));
-    RUN(testSExt16BitAnd(0xffff, 0x8000));
-    RUN(testSExt16BitAnd(0x10000, 0x8000));
-    RUN(testSExt16BitAnd(0xffffff, 0x8000));
-    RUN(testSExt16BitAnd(0x1000000, 0x8000));
-    RUN(testBitAndSExt16(0, 0xf));
-    RUN(testBitAndSExt16(1, 0xf));
-    RUN(testBitAndSExt16(42, 0xf));
-    RUN(testBitAndSExt16(-1, 0xf));
-    RUN(testBitAndSExt16(0xffff, 0xf));
-    RUN(testBitAndSExt16(0x10000, 0xf));
-    RUN(testBitAndSExt16(0xffffff, 0xf));
-    RUN(testBitAndSExt16(0x1000000, 0xf));
-    RUN(testBitAndSExt16(0, 0xffff));
-    RUN(testBitAndSExt16(1, 0xffff));
-    RUN(testBitAndSExt16(42, 0xffff));
-    RUN(testBitAndSExt16(-1, 0xffff));
-    RUN(testBitAndSExt16(0xffff, 0xffff));
-    RUN(testBitAndSExt16(0x10000, 0xffff));
-    RUN(testBitAndSExt16(0xffffff, 0xffff));
-    RUN(testBitAndSExt16(0x1000000, 0xffff));
-    RUN(testBitAndSExt16(0, 0xfffff));
-    RUN(testBitAndSExt16(1, 0xfffff));
-    RUN(testBitAndSExt16(42, 0xfffff));
-    RUN(testBitAndSExt16(-1, 0xfffff));
-    RUN(testBitAndSExt16(0xffff, 0xfffff));
-    RUN(testBitAndSExt16(0x10000, 0xfffff));
-    RUN(testBitAndSExt16(0xffffff, 0xfffff));
-    RUN(testBitAndSExt16(0x1000000, 0xfffff));
-
-    RUN(testSExt32BitAnd(0, 0));
-    RUN(testSExt32BitAnd(1, 0));
-    RUN(testSExt32BitAnd(42, 0));
-    RUN(testSExt32BitAnd(-1, 0));
-    RUN(testSExt32BitAnd(0x80000000, 0));
-    RUN(testSExt32BitAnd(0, 0xf));
-    RUN(testSExt32BitAnd(1, 0xf));
-    RUN(testSExt32BitAnd(42, 0xf));
-    RUN(testSExt32BitAnd(-1, 0xf));
-    RUN(testSExt32BitAnd(0x80000000, 0xf));
-    RUN(testSExt32BitAnd(0, 0x80000000));
-    RUN(testSExt32BitAnd(1, 0x80000000));
-    RUN(testSExt32BitAnd(42, 0x80000000));
-    RUN(testSExt32BitAnd(-1, 0x80000000));
-    RUN(testSExt32BitAnd(0x80000000, 0x80000000));
-    RUN(testBitAndSExt32(0, 0xf));
-    RUN(testBitAndSExt32(1, 0xf));
-    RUN(testBitAndSExt32(42, 0xf));
-    RUN(testBitAndSExt32(-1, 0xf));
-    RUN(testBitAndSExt32(0xffff, 0xf));
-    RUN(testBitAndSExt32(0x10000, 0xf));
-    RUN(testBitAndSExt32(0xffffff, 0xf));
-    RUN(testBitAndSExt32(0x1000000, 0xf));
-    RUN(testBitAndSExt32(0, 0xffff00000000llu));
-    RUN(testBitAndSExt32(1, 0xffff00000000llu));
-    RUN(testBitAndSExt32(42, 0xffff00000000llu));
-    RUN(testBitAndSExt32(-1, 0xffff00000000llu));
-    RUN(testBitAndSExt32(0x80000000, 0xffff00000000llu));
+    addSExtTests(filter, tasks);
 
     RUN(testBasicSelect());
     RUN(testSelectTest());
@@ -1446,94 +705,7 @@ void run(const char* filter)
     RUN(testStore16Load16Z(12345678));
     RUN(testStore16Load16Z(-123));
 
-    RUN(testSShrShl32(42, 24, 24));
-    RUN(testSShrShl32(-42, 24, 24));
-    RUN(testSShrShl32(4200, 24, 24));
-    RUN(testSShrShl32(-4200, 24, 24));
-    RUN(testSShrShl32(4200000, 24, 24));
-    RUN(testSShrShl32(-4200000, 24, 24));
-
-    RUN(testSShrShl32(42, 16, 16));
-    RUN(testSShrShl32(-42, 16, 16));
-    RUN(testSShrShl32(4200, 16, 16));
-    RUN(testSShrShl32(-4200, 16, 16));
-    RUN(testSShrShl32(4200000, 16, 16));
-    RUN(testSShrShl32(-4200000, 16, 16));
-
-    RUN(testSShrShl32(42, 8, 8));
-    RUN(testSShrShl32(-42, 8, 8));
-    RUN(testSShrShl32(4200, 8, 8));
-    RUN(testSShrShl32(-4200, 8, 8));
-    RUN(testSShrShl32(4200000, 8, 8));
-    RUN(testSShrShl32(-4200000, 8, 8));
-    RUN(testSShrShl32(420000000, 8, 8));
-    RUN(testSShrShl32(-420000000, 8, 8));
-
-    RUN(testSShrShl64(42, 56, 56));
-    RUN(testSShrShl64(-42, 56, 56));
-    RUN(testSShrShl64(4200, 56, 56));
-    RUN(testSShrShl64(-4200, 56, 56));
-    RUN(testSShrShl64(4200000, 56, 56));
-    RUN(testSShrShl64(-4200000, 56, 56));
-    RUN(testSShrShl64(420000000, 56, 56));
-    RUN(testSShrShl64(-420000000, 56, 56));
-    RUN(testSShrShl64(42000000000, 56, 56));
-    RUN(testSShrShl64(-42000000000, 56, 56));
-
-    RUN(testSShrShl64(42, 48, 48));
-    RUN(testSShrShl64(-42, 48, 48));
-    RUN(testSShrShl64(4200, 48, 48));
-    RUN(testSShrShl64(-4200, 48, 48));
-    RUN(testSShrShl64(4200000, 48, 48));
-    RUN(testSShrShl64(-4200000, 48, 48));
-    RUN(testSShrShl64(420000000, 48, 48));
-    RUN(testSShrShl64(-420000000, 48, 48));
-    RUN(testSShrShl64(42000000000, 48, 48));
-    RUN(testSShrShl64(-42000000000, 48, 48));
-
-    RUN(testSShrShl64(42, 32, 32));
-    RUN(testSShrShl64(-42, 32, 32));
-    RUN(testSShrShl64(4200, 32, 32));
-    RUN(testSShrShl64(-4200, 32, 32));
-    RUN(testSShrShl64(4200000, 32, 32));
-    RUN(testSShrShl64(-4200000, 32, 32));
-    RUN(testSShrShl64(420000000, 32, 32));
-    RUN(testSShrShl64(-420000000, 32, 32));
-    RUN(testSShrShl64(42000000000, 32, 32));
-    RUN(testSShrShl64(-42000000000, 32, 32));
-
-    RUN(testSShrShl64(42, 24, 24));
-    RUN(testSShrShl64(-42, 24, 24));
-    RUN(testSShrShl64(4200, 24, 24));
-    RUN(testSShrShl64(-4200, 24, 24));
-    RUN(testSShrShl64(4200000, 24, 24));
-    RUN(testSShrShl64(-4200000, 24, 24));
-    RUN(testSShrShl64(420000000, 24, 24));
-    RUN(testSShrShl64(-420000000, 24, 24));
-    RUN(testSShrShl64(42000000000, 24, 24));
-    RUN(testSShrShl64(-42000000000, 24, 24));
-
-    RUN(testSShrShl64(42, 16, 16));
-    RUN(testSShrShl64(-42, 16, 16));
-    RUN(testSShrShl64(4200, 16, 16));
-    RUN(testSShrShl64(-4200, 16, 16));
-    RUN(testSShrShl64(4200000, 16, 16));
-    RUN(testSShrShl64(-4200000, 16, 16));
-    RUN(testSShrShl64(420000000, 16, 16));
-    RUN(testSShrShl64(-420000000, 16, 16));
-    RUN(testSShrShl64(42000000000, 16, 16));
-    RUN(testSShrShl64(-42000000000, 16, 16));
-
-    RUN(testSShrShl64(42, 8, 8));
-    RUN(testSShrShl64(-42, 8, 8));
-    RUN(testSShrShl64(4200, 8, 8));
-    RUN(testSShrShl64(-4200, 8, 8));
-    RUN(testSShrShl64(4200000, 8, 8));
-    RUN(testSShrShl64(-4200000, 8, 8));
-    RUN(testSShrShl64(420000000, 8, 8));
-    RUN(testSShrShl64(-420000000, 8, 8));
-    RUN(testSShrShl64(42000000000, 8, 8));
-    RUN(testSShrShl64(-42000000000, 8, 8));
+    addSShrShTests(filter, tasks);
 
     RUN(testCheckMul64SShr());
 
index d75dc24..d3fb189 100644 (file)
@@ -141,7 +141,7 @@ void testLoadOffsetScaledUnsignedOverImm12Max()
     testLoadWithOffsetImpl(32768, 16384);
 }
 
-void testBitXorTreeArgs(int64_t a, int64_t b)
+static void testBitXorTreeArgs(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -156,7 +156,7 @@ void testBitXorTreeArgs(int64_t a, int64_t b)
     CHECK_EQ(compileAndRun<int64_t>(proc, a, b), (((a ^ b) ^ b) ^ a) ^ b);
 }
 
-void testBitXorTreeArgsEven(int64_t a, int64_t b)
+static void testBitXorTreeArgsEven(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -170,7 +170,7 @@ void testBitXorTreeArgsEven(int64_t a, int64_t b)
     CHECK_EQ(compileAndRun<int64_t>(proc, a, b), ((a ^ b) ^ b) ^ a);
 }
 
-void testBitXorTreeArgImm(int64_t a, int64_t b)
+static void testBitXorTreeArgImm(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -233,7 +233,7 @@ void testMulTreeArg32(int32_t a)
     CHECK_EQ(compileAndRun<int32_t>(proc, a), expectedResult);
 }
 
-void testBitAndTreeArg32(int32_t a)
+static void testBitAndTreeArg32(int32_t a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -250,7 +250,7 @@ void testBitAndTreeArg32(int32_t a)
     CHECK_EQ(compileAndRun<int32_t>(proc, a), a & 42);
 }
 
-void testBitOrTreeArg32(int32_t a)
+static void testBitOrTreeArg32(int32_t a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2518,7 +2518,7 @@ void testNegFloatWithUselessDoubleConversion(float a)
     CHECK(isIdentical(compileAndRun<float>(proc, bitwise_cast<int32_t>(a)), -a));
 }
 
-void testBitAndArgs(int64_t a, int64_t b)
+static void testBitAndArgs(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2532,7 +2532,7 @@ void testBitAndArgs(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc, a, b) == (a & b));
 }
 
-void testBitAndSameArg(int64_t a)
+static void testBitAndSameArg(int64_t a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2547,7 +2547,7 @@ void testBitAndSameArg(int64_t a)
     CHECK(compileAndRun<int64_t>(proc, a) == a);
 }
 
-void testBitAndNotNot(int64_t a, int64_t b)
+static void testBitAndNotNot(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2565,7 +2565,7 @@ void testBitAndNotNot(int64_t a, int64_t b)
     CHECK_EQ(compileAndRun<int64_t>(proc, a, b), (~a & ~b));
 }
 
-void testBitAndNotImm(int64_t a, int64_t b)
+static void testBitAndNotImm(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2582,7 +2582,7 @@ void testBitAndNotImm(int64_t a, int64_t b)
     CHECK_EQ(compileAndRun<int64_t>(proc, a, b), (~a & b));
 }
 
-void testBitAndImms(int64_t a, int64_t b)
+static void testBitAndImms(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2596,7 +2596,7 @@ void testBitAndImms(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc) == (a & b));
 }
 
-void testBitAndArgImm(int64_t a, int64_t b)
+static void testBitAndArgImm(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2610,7 +2610,7 @@ void testBitAndArgImm(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc, a) == (a & b));
 }
 
-void testBitAndImmArg(int64_t a, int64_t b)
+static void testBitAndImmArg(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2624,7 +2624,7 @@ void testBitAndImmArg(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc, b) == (a & b));
 }
 
-void testBitAndBitAndArgImmImm(int64_t a, int64_t b, int64_t c)
+static void testBitAndBitAndArgImmImm(int64_t a, int64_t b, int64_t c)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2642,7 +2642,7 @@ void testBitAndBitAndArgImmImm(int64_t a, int64_t b, int64_t c)
     CHECK(compileAndRun<int64_t>(proc, a) == ((a & b) & c));
 }
 
-void testBitAndImmBitAndArgImm(int64_t a, int64_t b, int64_t c)
+static void testBitAndImmBitAndArgImm(int64_t a, int64_t b, int64_t c)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2660,7 +2660,7 @@ void testBitAndImmBitAndArgImm(int64_t a, int64_t b, int64_t c)
     CHECK(compileAndRun<int64_t>(proc, b) == (a & (b & c)));
 }
 
-void testBitAndArgs32(int a, int b)
+static void testBitAndArgs32(int a, int b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2678,7 +2678,7 @@ void testBitAndArgs32(int a, int b)
     CHECK(compileAndRun<int>(proc, a, b) == (a & b));
 }
 
-void testBitAndSameArg32(int a)
+static void testBitAndSameArg32(int a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2694,7 +2694,7 @@ void testBitAndSameArg32(int a)
     CHECK(compileAndRun<int>(proc, a) == a);
 }
 
-void testBitAndImms32(int a, int b)
+static void testBitAndImms32(int a, int b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2708,7 +2708,7 @@ void testBitAndImms32(int a, int b)
     CHECK(compileAndRun<int>(proc) == (a & b));
 }
 
-void testBitAndArgImm32(int a, int b)
+static void testBitAndArgImm32(int a, int b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2724,7 +2724,7 @@ void testBitAndArgImm32(int a, int b)
     CHECK(compileAndRun<int>(proc, a) == (a & b));
 }
 
-void testBitAndImmArg32(int a, int b)
+static void testBitAndImmArg32(int a, int b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2740,7 +2740,7 @@ void testBitAndImmArg32(int a, int b)
     CHECK(compileAndRun<int>(proc, b) == (a & b));
 }
 
-void testBitAndBitAndArgImmImm32(int a, int b, int c)
+static void testBitAndBitAndArgImmImm32(int a, int b, int c)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2760,7 +2760,7 @@ void testBitAndBitAndArgImmImm32(int a, int b, int c)
     CHECK(compileAndRun<int>(proc, a) == ((a & b) & c));
 }
 
-void testBitAndImmBitAndArgImm32(int a, int b, int c)
+static void testBitAndImmBitAndArgImm32(int a, int b, int c)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2780,7 +2780,7 @@ void testBitAndImmBitAndArgImm32(int a, int b, int c)
     CHECK(compileAndRun<int>(proc, b) == (a & (b & c)));
 }
 
-void testBitAndWithMaskReturnsBooleans(int64_t a, int64_t b)
+static void testBitAndWithMaskReturnsBooleans(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2808,7 +2808,7 @@ static double bitAndDouble(double a, double b)
     return bitwise_cast<double>(bitwise_cast<uint64_t>(a) & bitwise_cast<uint64_t>(b));
 }
 
-void testBitAndArgDouble(double a)
+static void testBitAndArgDouble(double a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2819,7 +2819,7 @@ void testBitAndArgDouble(double a)
     CHECK(isIdentical(compileAndRun<double>(proc, a), bitAndDouble(a, a)));
 }
 
-void testBitAndArgsDouble(double a, double b)
+static void testBitAndArgsDouble(double a, double b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2831,7 +2831,7 @@ void testBitAndArgsDouble(double a, double b)
     CHECK(isIdentical(compileAndRun<double>(proc, a, b), bitAndDouble(a, b)));
 }
 
-void testBitAndArgImmDouble(double a, double b)
+static void testBitAndArgImmDouble(double a, double b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2843,7 +2843,7 @@ void testBitAndArgImmDouble(double a, double b)
     CHECK(isIdentical(compileAndRun<double>(proc, a, b), bitAndDouble(a, b)));
 }
 
-void testBitAndImmsDouble(double a, double b)
+static void testBitAndImmsDouble(double a, double b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2860,7 +2860,7 @@ static float bitAndFloat(float a, float b)
     return bitwise_cast<float>(bitwise_cast<uint32_t>(a) & bitwise_cast<uint32_t>(b));
 }
 
-void testBitAndArgFloat(float a)
+static void testBitAndArgFloat(float a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2873,7 +2873,7 @@ void testBitAndArgFloat(float a)
     CHECK(isIdentical(compileAndRun<float>(proc, bitwise_cast<int32_t>(a)), bitAndFloat(a, a)));
 }
 
-void testBitAndArgsFloat(float a, float b)
+static void testBitAndArgsFloat(float a, float b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2889,7 +2889,7 @@ void testBitAndArgsFloat(float a, float b)
     CHECK(isIdentical(compileAndRun<float>(proc, bitwise_cast<int32_t>(a), bitwise_cast<int32_t>(b)), bitAndFloat(a, b)));
 }
 
-void testBitAndArgImmFloat(float a, float b)
+static void testBitAndArgImmFloat(float a, float b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2903,7 +2903,7 @@ void testBitAndArgImmFloat(float a, float b)
     CHECK(isIdentical(compileAndRun<float>(proc, bitwise_cast<int32_t>(a), bitwise_cast<int32_t>(b)), bitAndFloat(a, b)));
 }
 
-void testBitAndImmsFloat(float a, float b)
+static void testBitAndImmsFloat(float a, float b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2915,7 +2915,7 @@ void testBitAndImmsFloat(float a, float b)
     CHECK(isIdentical(compileAndRun<float>(proc), bitAndFloat(a, b)));
 }
 
-void testBitAndArgsFloatWithUselessDoubleConversion(float a, float b)
+static void testBitAndArgsFloatWithUselessDoubleConversion(float a, float b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2937,7 +2937,7 @@ void testBitAndArgsFloatWithUselessDoubleConversion(float a, float b)
     CHECK(isIdentical(compileAndRun<float>(proc, bitwise_cast<int32_t>(a), bitwise_cast<int32_t>(b)), expected));
 }
 
-void testBitOrArgs(int64_t a, int64_t b)
+static void testBitOrArgs(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2951,7 +2951,7 @@ void testBitOrArgs(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc, a, b) == (a | b));
 }
 
-void testBitOrSameArg(int64_t a)
+static void testBitOrSameArg(int64_t a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2966,7 +2966,7 @@ void testBitOrSameArg(int64_t a)
     CHECK(compileAndRun<int64_t>(proc, a) == a);
 }
 
-void testBitOrAndAndArgs(int64_t a, int64_t b, int64_t c)
+static void testBitOrAndAndArgs(int64_t a, int64_t b, int64_t c)
 {
     // We want to check every possible ordering of arguments (to properly check every path in B3ReduceStrength):
     // ((a & b) | (a & c))
@@ -2994,7 +2994,7 @@ void testBitOrAndAndArgs(int64_t a, int64_t b, int64_t c)
     }
 }
 
-void testBitOrAndSameArgs(int64_t a, int64_t b)
+static void testBitOrAndSameArgs(int64_t a, int64_t b)
 {
     // We want to check every possible ordering of arguments (to properly check every path in B3ReduceStrength):
     // ((a & b) | a)
@@ -3016,7 +3016,7 @@ void testBitOrAndSameArgs(int64_t a, int64_t b)
     }
 }
 
-void testBitOrNotNot(int64_t a, int64_t b)
+static void testBitOrNotNot(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3034,7 +3034,7 @@ void testBitOrNotNot(int64_t a, int64_t b)
     CHECK_EQ(compileAndRun<int64_t>(proc, a, b), (~a | ~b));
 }
 
-void testBitOrNotImm(int64_t a, int64_t b)
+static void testBitOrNotImm(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3051,7 +3051,7 @@ void testBitOrNotImm(int64_t a, int64_t b)
     CHECK_EQ(compileAndRun<int64_t>(proc, a, b), (~a | b));
 }
 
-void testBitOrImms(int64_t a, int64_t b)
+static void testBitOrImms(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3065,7 +3065,7 @@ void testBitOrImms(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc) == (a | b));
 }
 
-void testBitOrArgImm(int64_t a, int64_t b)
+static void testBitOrArgImm(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3079,7 +3079,7 @@ void testBitOrArgImm(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc, a) == (a | b));
 }
 
-void testBitOrImmArg(int64_t a, int64_t b)
+static void testBitOrImmArg(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3093,7 +3093,7 @@ void testBitOrImmArg(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc, b) == (a | b));
 }
 
-void testBitOrBitOrArgImmImm(int64_t a, int64_t b, int64_t c)
+static void testBitOrBitOrArgImmImm(int64_t a, int64_t b, int64_t c)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3111,7 +3111,7 @@ void testBitOrBitOrArgImmImm(int64_t a, int64_t b, int64_t c)
     CHECK(compileAndRun<int64_t>(proc, a) == ((a | b) | c));
 }
 
-void testBitOrImmBitOrArgImm(int64_t a, int64_t b, int64_t c)
+static void testBitOrImmBitOrArgImm(int64_t a, int64_t b, int64_t c)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3129,7 +3129,7 @@ void testBitOrImmBitOrArgImm(int64_t a, int64_t b, int64_t c)
     CHECK(compileAndRun<int64_t>(proc, b) == (a | (b | c)));
 }
 
-void testBitOrArgs32(int a, int b)
+static void testBitOrArgs32(int a, int b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3147,7 +3147,7 @@ void testBitOrArgs32(int a, int b)
     CHECK(compileAndRun<int>(proc, a, b) == (a | b));
 }
 
-void testBitOrSameArg32(int a)
+static void testBitOrSameArg32(int a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3164,7 +3164,7 @@ void testBitOrSameArg32(int a)
     CHECK(compileAndRun<int>(proc, a) == a);
 }
 
-void testBitOrImms32(int a, int b)
+static void testBitOrImms32(int a, int b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3178,7 +3178,7 @@ void testBitOrImms32(int a, int b)
     CHECK(compileAndRun<int>(proc) == (a | b));
 }
 
-void testBitOrArgImm32(int a, int b)
+static void testBitOrArgImm32(int a, int b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3194,7 +3194,7 @@ void testBitOrArgImm32(int a, int b)
     CHECK(compileAndRun<int>(proc, a) == (a | b));
 }
 
-void testBitOrImmArg32(int a, int b)
+static void testBitOrImmArg32(int a, int b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -3210,4 +3210,205 @@ void testBitOrImmArg32(int a, int b)
     CHECK(compileAndRun<int>(proc, b) == (a | b));
 }
 
+void addBitTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>& tasks)
+{
+    RUN(testBitAndArgs(43, 43));
+    RUN(testBitAndArgs(43, 0));
+    RUN(testBitAndArgs(10, 3));
+    RUN(testBitAndArgs(42, 0xffffffffffffffff));
+    RUN(testBitAndSameArg(43));
+    RUN(testBitAndSameArg(0));
+    RUN(testBitAndSameArg(3));
+    RUN(testBitAndSameArg(0xffffffffffffffff));
+    RUN(testBitAndImms(43, 43));
+    RUN(testBitAndImms(43, 0));
+    RUN(testBitAndImms(10, 3));
+    RUN(testBitAndImms(42, 0xffffffffffffffff));
+    RUN(testBitAndArgImm(43, 43));
+    RUN(testBitAndArgImm(43, 0));
+    RUN(testBitAndArgImm(10, 3));
+    RUN(testBitAndArgImm(42, 0xffffffffffffffff));
+    RUN(testBitAndArgImm(42, 0xff));
+    RUN(testBitAndArgImm(300, 0xff));
+    RUN(testBitAndArgImm(-300, 0xff));
+    RUN(testBitAndArgImm(42, 0xffff));
+    RUN(testBitAndArgImm(40000, 0xffff));
+    RUN(testBitAndArgImm(-40000, 0xffff));
+    RUN(testBitAndImmArg(43, 43));
+    RUN(testBitAndImmArg(43, 0));
+    RUN(testBitAndImmArg(10, 3));
+    RUN(testBitAndImmArg(42, 0xffffffffffffffff));
+    RUN(testBitAndBitAndArgImmImm(2, 7, 3));
+    RUN(testBitAndBitAndArgImmImm(1, 6, 6));
+    RUN(testBitAndBitAndArgImmImm(0xffff, 24, 7));
+    RUN(testBitAndImmBitAndArgImm(7, 2, 3));
+    RUN(testBitAndImmBitAndArgImm(6, 1, 6));
+    RUN(testBitAndImmBitAndArgImm(24, 0xffff, 7));
+    RUN(testBitAndArgs32(43, 43));
+    RUN(testBitAndArgs32(43, 0));
+    RUN(testBitAndArgs32(10, 3));
+    RUN(testBitAndArgs32(42, 0xffffffff));
+    RUN(testBitAndSameArg32(43));
+    RUN(testBitAndSameArg32(0));
+    RUN(testBitAndSameArg32(3));
+    RUN(testBitAndSameArg32(0xffffffff));
+    RUN(testBitAndImms32(43, 43));
+    RUN(testBitAndImms32(43, 0));
+    RUN(testBitAndImms32(10, 3));
+    RUN(testBitAndImms32(42, 0xffffffff));
+    RUN(testBitAndArgImm32(43, 43));
+    RUN(testBitAndArgImm32(43, 0));
+    RUN(testBitAndArgImm32(10, 3));
+    RUN(testBitAndArgImm32(42, 0xffffffff));
+    RUN(testBitAndImmArg32(43, 43));
+    RUN(testBitAndImmArg32(43, 0));
+    RUN(testBitAndImmArg32(10, 3));
+    RUN(testBitAndImmArg32(42, 0xffffffff));
+    RUN(testBitAndImmArg32(42, 0xff));
+    RUN(testBitAndImmArg32(300, 0xff));
+    RUN(testBitAndImmArg32(-300, 0xff));
+    RUN(testBitAndImmArg32(42, 0xffff));
+    RUN(testBitAndImmArg32(40000, 0xffff));
+    RUN(testBitAndImmArg32(-40000, 0xffff));
+    RUN(testBitAndBitAndArgImmImm32(2, 7, 3));
+    RUN(testBitAndBitAndArgImmImm32(1, 6, 6));
+    RUN(testBitAndBitAndArgImmImm32(0xffff, 24, 7));
+    RUN(testBitAndImmBitAndArgImm32(7, 2, 3));
+    RUN(testBitAndImmBitAndArgImm32(6, 1, 6));
+    RUN(testBitAndImmBitAndArgImm32(24, 0xffff, 7));
+    RUN_BINARY(testBitAndWithMaskReturnsBooleans, int64Operands(), int64Operands());
+    RUN_UNARY(testBitAndArgDouble, floatingPointOperands<double>());
+    RUN_BINARY(testBitAndArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testBitAndArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testBitAndImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_UNARY(testBitAndArgFloat, floatingPointOperands<float>());
+    RUN_BINARY(testBitAndArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testBitAndArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testBitAndImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testBitAndArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testBitAndNotNot, int64Operands(), int64Operands());
+    RUN_BINARY(testBitAndNotImm, int64Operands(), int64Operands());
+    
+    RUN(testBitOrArgs(43, 43));
+    RUN(testBitOrArgs(43, 0));
+    RUN(testBitOrArgs(10, 3));
+    RUN(testBitOrArgs(42, 0xffffffffffffffff));
+    RUN(testBitOrSameArg(43));
+    RUN(testBitOrSameArg(0));
+    RUN(testBitOrSameArg(3));
+    RUN(testBitOrSameArg(0xffffffffffffffff));
+    RUN(testBitOrImms(43, 43));
+    RUN(testBitOrImms(43, 0));
+    RUN(testBitOrImms(10, 3));
+    RUN(testBitOrImms(42, 0xffffffffffffffff));
+    RUN(testBitOrArgImm(43, 43));
+    RUN(testBitOrArgImm(43, 0));
+    RUN(testBitOrArgImm(10, 3));
+    RUN(testBitOrArgImm(42, 0xffffffffffffffff));
+    RUN(testBitOrImmArg(43, 43));
+    RUN(testBitOrImmArg(43, 0));
+    RUN(testBitOrImmArg(10, 3));
+    RUN(testBitOrImmArg(42, 0xffffffffffffffff));
+    RUN(testBitOrBitOrArgImmImm(2, 7, 3));
+    RUN(testBitOrBitOrArgImmImm(1, 6, 6));
+    RUN(testBitOrBitOrArgImmImm(0xffff, 24, 7));
+    RUN(testBitOrImmBitOrArgImm(7, 2, 3));
+    RUN(testBitOrImmBitOrArgImm(6, 1, 6));
+    RUN(testBitOrImmBitOrArgImm(24, 0xffff, 7));
+    RUN(testBitOrArgs32(43, 43));
+    RUN(testBitOrArgs32(43, 0));
+    RUN(testBitOrArgs32(10, 3));
+    RUN(testBitOrArgs32(42, 0xffffffff));
+    RUN(testBitOrSameArg32(43));
+    RUN(testBitOrSameArg32(0));
+    RUN(testBitOrSameArg32(3));
+    RUN(testBitOrSameArg32(0xffffffff));
+    RUN(testBitOrImms32(43, 43));
+    RUN(testBitOrImms32(43, 0));
+    RUN(testBitOrImms32(10, 3));
+    RUN(testBitOrImms32(42, 0xffffffff));
+    RUN(testBitOrArgImm32(43, 43));
+    RUN(testBitOrArgImm32(43, 0));
+    RUN(testBitOrArgImm32(10, 3));
+    RUN(testBitOrArgImm32(42, 0xffffffff));
+    RUN(testBitOrImmArg32(43, 43));
+    RUN(testBitOrImmArg32(43, 0));
+    RUN(testBitOrImmArg32(10, 3));
+    RUN(testBitOrImmArg32(42, 0xffffffff));
+    RUN(testBitOrBitOrArgImmImm32(2, 7, 3));
+    RUN(testBitOrBitOrArgImmImm32(1, 6, 6));
+    RUN(testBitOrBitOrArgImmImm32(0xffff, 24, 7));
+    RUN(testBitOrImmBitOrArgImm32(7, 2, 3));
+    RUN(testBitOrImmBitOrArgImm32(6, 1, 6));
+    RUN(testBitOrImmBitOrArgImm32(24, 0xffff, 7));
+    RUN_UNARY(testBitOrArgDouble, floatingPointOperands<double>());
+    RUN_BINARY(testBitOrArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testBitOrArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testBitOrImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_UNARY(testBitOrArgFloat, floatingPointOperands<float>());
+    RUN_BINARY(testBitOrArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testBitOrArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testBitOrImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testBitOrArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_TERNARY(testBitOrAndAndArgs, int64Operands(), int64Operands(), int64Operands());
+    RUN_BINARY(testBitOrAndSameArgs, int64Operands(), int64Operands());
+    RUN_BINARY(testBitOrNotNot, int64Operands(), int64Operands());
+    RUN_BINARY(testBitOrNotImm, int64Operands(), int64Operands());
+    
+    RUN_BINARY(testBitXorArgs, int64Operands(), int64Operands());
+    RUN_UNARY(testBitXorSameArg, int64Operands());
+    RUN_BINARY(testBitXorImms, int64Operands(), int64Operands());
+    RUN_BINARY(testBitXorArgImm, int64Operands(), int64Operands());
+    RUN_BINARY(testBitXorImmArg, int64Operands(), int64Operands());
+    RUN(testBitXorBitXorArgImmImm(2, 7, 3));
+    RUN(testBitXorBitXorArgImmImm(1, 6, 6));
+    RUN(testBitXorBitXorArgImmImm(0xffff, 24, 7));
+    RUN(testBitXorImmBitXorArgImm(7, 2, 3));
+    RUN(testBitXorImmBitXorArgImm(6, 1, 6));
+    RUN(testBitXorImmBitXorArgImm(24, 0xffff, 7));
+    RUN(testBitXorArgs32(43, 43));
+    RUN(testBitXorArgs32(43, 0));
+    RUN(testBitXorArgs32(10, 3));
+    RUN(testBitXorArgs32(42, 0xffffffff));
+    RUN(testBitXorSameArg32(43));
+    RUN(testBitXorSameArg32(0));
+    RUN(testBitXorSameArg32(3));
+    RUN(testBitXorSameArg32(0xffffffff));
+    RUN(testBitXorImms32(43, 43));
+    RUN(testBitXorImms32(43, 0));
+    RUN(testBitXorImms32(10, 3));
+    RUN(testBitXorImms32(42, 0xffffffff));
+    RUN(testBitXorArgImm32(43, 43));
+    RUN(testBitXorArgImm32(43, 0));
+    RUN(testBitXorArgImm32(10, 3));
+    RUN(testBitXorArgImm32(42, 0xffffffff));
+    RUN(testBitXorImmArg32(43, 43));
+    RUN(testBitXorImmArg32(43, 0));
+    RUN(testBitXorImmArg32(10, 3));
+    RUN(testBitXorImmArg32(42, 0xffffffff));
+    RUN(testBitXorBitXorArgImmImm32(2, 7, 3));
+    RUN(testBitXorBitXorArgImmImm32(1, 6, 6));
+    RUN(testBitXorBitXorArgImmImm32(0xffff, 24, 7));
+    RUN(testBitXorImmBitXorArgImm32(7, 2, 3));
+    RUN(testBitXorImmBitXorArgImm32(6, 1, 6));
+    RUN(testBitXorImmBitXorArgImm32(24, 0xffff, 7));
+    RUN_TERNARY(testBitXorAndAndArgs, int64Operands(), int64Operands(), int64Operands());
+    RUN_BINARY(testBitXorAndSameArgs, int64Operands(), int64Operands());
+    
+    RUN_UNARY(testBitNotArg, int64Operands());
+    RUN_UNARY(testBitNotImm, int64Operands());
+    RUN_UNARY(testBitNotMem, int64Operands());
+    RUN_UNARY(testBitNotArg32, int32Operands());
+    RUN_UNARY(testBitNotImm32, int32Operands());
+    RUN_UNARY(testBitNotMem32, int32Operands());
+    RUN_BINARY(testNotOnBooleanAndBranch32, int32Operands(), int32Operands());
+    RUN_BINARY(testBitNotOnBooleanAndBranch32, int32Operands(), int32Operands());
+    
+    RUN_BINARY(testBitXorTreeArgs, int64Operands(), int64Operands());
+    RUN_BINARY(testBitXorTreeArgsEven, int64Operands(), int64Operands());
+    RUN_BINARY(testBitXorTreeArgImm, int64Operands(), int64Operands());
+    RUN_UNARY(testBitAndTreeArg32, int32Operands());
+    RUN_UNARY(testBitOrTreeArg32, int32Operands());
+}
+
 #endif // ENABLE(B3_JIT)
index c9e0286..c1d912c 100644 (file)
@@ -780,7 +780,7 @@ void testShlZShrArgImm32(int32_t a, int32_t b)
     CHECK(compileAndRun<int32_t>(proc, a) == static_cast<int32_t>((static_cast<uint32_t>(a) >> b) << b));
 }
 
-void testSShrArgs(int64_t a, int64_t b)
+static void testSShrArgs(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -796,7 +796,7 @@ void testSShrArgs(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc, a, b) == (a >> b));
 }
 
-void testSShrImms(int64_t a, int64_t b)
+static void testSShrImms(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -810,7 +810,7 @@ void testSShrImms(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc) == (a >> b));
 }
 
-void testSShrArgImm(int64_t a, int64_t b)
+static void testSShrArgImm(int64_t a, int64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -824,7 +824,7 @@ void testSShrArgImm(int64_t a, int64_t b)
     CHECK(compileAndRun<int64_t>(proc, a) == (a >> b));
 }
 
-void testSShrArg32(int32_t a)
+static void testSShrArg32(int32_t a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -838,7 +838,7 @@ void testSShrArg32(int32_t a)
     CHECK(compileAndRun<int32_t>(proc, a) == (a >> (a & 31)));
 }
 
-void testSShrArgs32(int32_t a, int32_t b)
+static void testSShrArgs32(int32_t a, int32_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -856,7 +856,7 @@ void testSShrArgs32(int32_t a, int32_t b)
     CHECK(compileAndRun<int32_t>(proc, a, b) == (a >> b));
 }
 
-void testSShrImms32(int32_t a, int32_t b)
+static void testSShrImms32(int32_t a, int32_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -870,7 +870,7 @@ void testSShrImms32(int32_t a, int32_t b)
     CHECK(compileAndRun<int32_t>(proc) == (a >> b));
 }
 
-void testSShrArgImm32(int32_t a, int32_t b)
+static void testSShrArgImm32(int32_t a, int32_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -886,7 +886,7 @@ void testSShrArgImm32(int32_t a, int32_t b)
     CHECK(compileAndRun<int32_t>(proc, a) == (a >> b));
 }
 
-void testZShrArgs(uint64_t a, uint64_t b)
+static void testZShrArgs(uint64_t a, uint64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -902,7 +902,7 @@ void testZShrArgs(uint64_t a, uint64_t b)
     CHECK(compileAndRun<uint64_t>(proc, a, b) == (a >> b));
 }
 
-void testZShrImms(uint64_t a, uint64_t b)
+static void testZShrImms(uint64_t a, uint64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -916,7 +916,7 @@ void testZShrImms(uint64_t a, uint64_t b)
     CHECK(compileAndRun<uint64_t>(proc) == (a >> b));
 }
 
-void testZShrArgImm(uint64_t a, uint64_t b)
+static void testZShrArgImm(uint64_t a, uint64_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -930,7 +930,7 @@ void testZShrArgImm(uint64_t a, uint64_t b)
     CHECK(compileAndRun<uint64_t>(proc, a) == (a >> b));
 }
 
-void testZShrArg32(uint32_t a)
+static void testZShrArg32(uint32_t a)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -944,7 +944,7 @@ void testZShrArg32(uint32_t a)
     CHECK(compileAndRun<uint32_t>(proc, a) == (a >> (a & 31)));
 }
 
-void testZShrArgs32(uint32_t a, uint32_t b)
+static void testZShrArgs32(uint32_t a, uint32_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -962,7 +962,7 @@ void testZShrArgs32(uint32_t a, uint32_t b)
     CHECK(compileAndRun<uint32_t>(proc, a, b) == (a >> b));
 }
 
-void testZShrImms32(uint32_t a, uint32_t b)
+static void testZShrImms32(uint32_t a, uint32_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -976,7 +976,7 @@ void testZShrImms32(uint32_t a, uint32_t b)
     CHECK(compileAndRun<uint32_t>(proc) == (a >> b));
 }
 
-void testZShrArgImm32(uint32_t a, uint32_t b)
+static void testZShrArgImm32(uint32_t a, uint32_t b)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2998,4 +2998,372 @@ void testStoreAddLoad32(int amount)
     CHECK(slot == 37 + amount);
 }
 
+// Make sure the compiler does not try to optimize anything out.
+static NEVER_INLINE double zero()
+{
+    return 0.;
+}
+
+static double negativeZero()
+{
+    return -zero();
+}
+
+void addArgTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>& tasks)
+{
+    RUN(testAddArg(111));
+    RUN(testAddArgs(1, 1));
+    RUN(testAddArgs(1, 2));
+    RUN(testAddArgImm(1, 2));
+    RUN(testAddArgImm(0, 2));
+    RUN(testAddArgImm(1, 0));
+    RUN(testAddImmArg(1, 2));
+    RUN(testAddImmArg(0, 2));
+    RUN(testAddImmArg(1, 0));
+    RUN_BINARY(testAddArgMem, int64Operands(), int64Operands());
+    RUN_BINARY(testAddMemArg, int64Operands(), int64Operands());
+    RUN_BINARY(testAddImmMem, int64Operands(), int64Operands());
+    RUN_UNARY(testAddArg32, int32Operands());
+    RUN(testAddArgs32(1, 1));
+    RUN(testAddArgs32(1, 2));
+    RUN_BINARY(testAddArgMem32, int32Operands(), int32Operands());
+    RUN_BINARY(testAddMemArg32, int32Operands(), int32Operands());
+    RUN_BINARY(testAddImmMem32, int32Operands(), int32Operands());
+    RUN_BINARY(testAddNeg1, int32Operands(), int32Operands());
+    RUN_BINARY(testAddNeg2, int32Operands(), int32Operands());
+    RUN(testAddArgZeroImmZDef());
+    RUN(testAddLoadTwice());
+    RUN_TERNARY(testAddMulMulArgs, int64Operands(), int64Operands(), int64Operands());
+    
+    RUN(testAddArgDouble(M_PI));
+    RUN(testAddArgsDouble(M_PI, 1));
+    RUN(testAddArgsDouble(M_PI, -M_PI));
+    RUN(testAddArgImmDouble(M_PI, 1));
+    RUN(testAddArgImmDouble(M_PI, 0));
+    RUN(testAddArgImmDouble(M_PI, negativeZero()));
+    RUN(testAddArgImmDouble(0, 0));
+    RUN(testAddArgImmDouble(0, negativeZero()));
+    RUN(testAddArgImmDouble(negativeZero(), 0));
+    RUN(testAddArgImmDouble(negativeZero(), negativeZero()));
+    RUN(testAddImmArgDouble(M_PI, 1));
+    RUN(testAddImmArgDouble(M_PI, 0));
+    RUN(testAddImmArgDouble(M_PI, negativeZero()));
+    RUN(testAddImmArgDouble(0, 0));
+    RUN(testAddImmArgDouble(0, negativeZero()));
+    RUN(testAddImmArgDouble(negativeZero(), 0));
+    RUN(testAddImmArgDouble(negativeZero(), negativeZero()));
+    RUN(testAddImmsDouble(M_PI, 1));
+    RUN(testAddImmsDouble(M_PI, 0));
+    RUN(testAddImmsDouble(M_PI, negativeZero()));
+    RUN(testAddImmsDouble(0, 0));
+    RUN(testAddImmsDouble(0, negativeZero()));
+    RUN(testAddImmsDouble(negativeZero(), negativeZero()));
+    RUN_UNARY(testAddArgFloat, floatingPointOperands<float>());
+    RUN_BINARY(testAddArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testAddFPRArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testAddArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testAddImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testAddImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_UNARY(testAddArgFloatWithUselessDoubleConversion, floatingPointOperands<float>());
+    RUN_BINARY(testAddArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testAddArgsFloatWithEffectfulDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+    
+    RUN(testMulArg(5));
+    RUN(testMulAddArg(5));
+    RUN(testMulAddArg(85));
+    RUN(testMulArgStore(5));
+    RUN(testMulArgStore(85));
+    RUN(testMulArgs(1, 1));
+    RUN(testMulArgs(1, 2));
+    RUN(testMulArgs(3, 3));
+    RUN(testMulArgImm(1, 2));
+    RUN(testMulArgImm(1, 4));
+    RUN(testMulArgImm(1, 8));
+    RUN(testMulArgImm(1, 16));
+    RUN(testMulArgImm(1, 0x80000000llu));
+    RUN(testMulArgImm(1, 0x800000000000llu));
+    RUN(testMulArgImm(7, 2));
+    RUN(testMulArgImm(7, 4));
+    RUN(testMulArgImm(7, 8));
+    RUN(testMulArgImm(7, 16));
+    RUN(testMulArgImm(7, 0x80000000llu));
+    RUN(testMulArgImm(7, 0x800000000000llu));
+    RUN(testMulArgImm(-42, 2));
+    RUN(testMulArgImm(-42, 4));
+    RUN(testMulArgImm(-42, 8));
+    RUN(testMulArgImm(-42, 16));
+    RUN(testMulArgImm(-42, 0x80000000llu));
+    RUN(testMulArgImm(-42, 0x800000000000llu));
+    RUN(testMulArgImm(0, 2));
+    RUN(testMulArgImm(1, 0));
+    RUN(testMulArgImm(3, 3));
+    RUN(testMulArgImm(3, -1));
+    RUN(testMulArgImm(-3, -1));
+    RUN(testMulArgImm(0, -1));
+    RUN(testMulImmArg(1, 2));
+    RUN(testMulImmArg(0, 2));
+    RUN(testMulImmArg(1, 0));
+    RUN(testMulImmArg(3, 3));
+    RUN(testMulImm32SignExtend(1, 2));
+    RUN(testMulImm32SignExtend(0, 2));
+    RUN(testMulImm32SignExtend(1, 0));
+    RUN(testMulImm32SignExtend(3, 3));
+    RUN(testMulImm32SignExtend(0xFFFFFFFF, 0xFFFFFFFF));
+    RUN(testMulImm32SignExtend(0xFFFFFFFE, 0xFFFFFFFF));
+    RUN(testMulImm32SignExtend(0xFFFFFFFF, 0xFFFFFFFE));
+    RUN(testMulArgs32(1, 1));
+    RUN(testMulArgs32(1, 2));
+    RUN(testMulArgs32(0xFFFFFFFF, 0xFFFFFFFF));
+    RUN(testMulArgs32(0xFFFFFFFE, 0xFFFFFFFF));
+    RUN(testMulArgs32SignExtend(1, 1));
+    RUN(testMulArgs32SignExtend(1, 2));
+    RUN(testMulArgs32SignExtend(0xFFFFFFFF, 0xFFFFFFFF));
+    RUN(testMulArgs32SignExtend(0xFFFFFFFE, 0xFFFFFFFF));
+    RUN(testMulLoadTwice());
+    RUN(testMulAddArgsLeft());
+    RUN(testMulAddArgsRight());
+    RUN(testMulAddArgsLeft32());
+    RUN(testMulAddArgsRight32());
+    RUN(testMulSubArgsLeft());
+    RUN(testMulSubArgsRight());
+    RUN(testMulSubArgsLeft32());
+    RUN(testMulSubArgsRight32());
+    RUN(testMulNegArgs());
+    RUN(testMulNegArgs32());
+    
+    RUN_BINARY(testMulArgNegArg, int64Operands(), int64Operands())
+    RUN_BINARY(testMulNegArgArg, int64Operands(), int64Operands())
+    RUN_UNARY(testMulArgDouble, floatingPointOperands<double>());
+    RUN_BINARY(testMulArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testMulArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testMulImmArgDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testMulImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_UNARY(testMulArgFloat, floatingPointOperands<float>());
+    RUN_BINARY(testMulArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testMulArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testMulImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testMulImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_UNARY(testMulArgFloatWithUselessDoubleConversion, floatingPointOperands<float>());
+    RUN_BINARY(testMulArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testMulArgsFloatWithEffectfulDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+    
+    RUN(testDivArgDouble(M_PI));
+    RUN(testDivArgsDouble(M_PI, 1));
+    RUN(testDivArgsDouble(M_PI, -M_PI));
+    RUN(testDivArgImmDouble(M_PI, 1));
+    RUN(testDivArgImmDouble(M_PI, 0));
+    RUN(testDivArgImmDouble(M_PI, negativeZero()));
+    RUN(testDivArgImmDouble(0, 0));
+    RUN(testDivArgImmDouble(0, negativeZero()));
+    RUN(testDivArgImmDouble(negativeZero(), 0));
+    RUN(testDivArgImmDouble(negativeZero(), negativeZero()));
+    RUN(testDivImmArgDouble(M_PI, 1));
+    RUN(testDivImmArgDouble(M_PI, 0));
+    RUN(testDivImmArgDouble(M_PI, negativeZero()));
+    RUN(testDivImmArgDouble(0, 0));
+    RUN(testDivImmArgDouble(0, negativeZero()));
+    RUN(testDivImmArgDouble(negativeZero(), 0));
+    RUN(testDivImmArgDouble(negativeZero(), negativeZero()));
+    RUN(testDivImmsDouble(M_PI, 1));
+    RUN(testDivImmsDouble(M_PI, 0));
+    RUN(testDivImmsDouble(M_PI, negativeZero()));
+    RUN(testDivImmsDouble(0, 0));
+    RUN(testDivImmsDouble(0, negativeZero()));
+    RUN(testDivImmsDouble(negativeZero(), negativeZero()));
+    RUN_UNARY(testDivArgFloat, floatingPointOperands<float>());
+    RUN_BINARY(testDivArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testDivArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testDivImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testDivImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_UNARY(testDivArgFloatWithUselessDoubleConversion, floatingPointOperands<float>());
+    RUN_BINARY(testDivArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testDivArgsFloatWithEffectfulDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+    
+    RUN_BINARY(testUDivArgsInt32, int32Operands(), int32Operands());
+    RUN_BINARY(testUDivArgsInt64, int64Operands(), int64Operands());
+    
+    RUN_UNARY(testModArgDouble, floatingPointOperands<double>());
+    RUN_BINARY(testModArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testModArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testModImmArgDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testModImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_UNARY(testModArgFloat, floatingPointOperands<float>());
+    RUN_BINARY(testModArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testModArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testModImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testModImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    
+    RUN_BINARY(testUModArgsInt32, int32Operands(), int32Operands());
+    RUN_BINARY(testUModArgsInt64, int64Operands(), int64Operands());
+    
+    RUN(testSubArg(24));
+    RUN(testSubArgs(1, 1));
+    RUN(testSubArgs(1, 2));
+    RUN(testSubArgs(13, -42));
+    RUN(testSubArgs(-13, 42));
+    RUN(testSubArgImm(1, 1));
+    RUN(testSubArgImm(1, 2));
+    RUN(testSubArgImm(13, -42));
+    RUN(testSubArgImm(-13, 42));
+    RUN(testSubArgImm(42, 0));
+    RUN(testSubImmArg(1, 1));
+    RUN(testSubImmArg(1, 2));
+    RUN(testSubImmArg(13, -42));
+    RUN(testSubImmArg(-13, 42));
+    RUN_BINARY(testSubArgMem, int64Operands(), int64Operands());
+    RUN_BINARY(testSubMemArg, int64Operands(), int64Operands());
+    RUN_BINARY(testSubImmMem, int32Operands(), int32Operands());
+    RUN_BINARY(testSubMemImm, int32Operands(), int32Operands());
+    RUN_BINARY(testSubNeg, int32Operands(), int32Operands());
+    RUN_BINARY(testNegSub, int32Operands(), int32Operands());
+    RUN_UNARY(testNegValueSubOne, int32Operands());
+    RUN_BINARY(testNegMulArgImm, int64Operands(), int64Operands());
+    RUN_TERNARY(testSubMulMulArgs, int64Operands(), int64Operands(), int64Operands());
+    
+    RUN_TERNARY(testSubSub, int32Operands(), int32Operands(), int32Operands());
+    RUN_TERNARY(testSubSub2, int32Operands(), int32Operands(), int32Operands());
+    RUN_TERNARY(testSubAdd, int32Operands(), int32Operands(), int32Operands());
+    RUN_BINARY(testSubFirstNeg, int32Operands(), int32Operands());
+    
+    RUN(testSubArgs32(1, 1));
+    RUN(testSubArgs32(1, 2));
+    RUN(testSubArgs32(13, -42));
+    RUN(testSubArgs32(-13, 42));
+    RUN(testSubArgImm32(1, 1));
+    RUN(testSubArgImm32(1, 2));
+    RUN(testSubArgImm32(13, -42));
+    RUN(testSubArgImm32(-13, 42));
+    RUN(testSubImmArg32(1, 1));
+    RUN(testSubImmArg32(1, 2));
+    RUN(testSubImmArg32(13, -42));
+    RUN(testSubImmArg32(-13, 42));
+    RUN_BINARY(testSubArgMem32, int32Operands(), int32Operands());
+    RUN_BINARY(testSubMemArg32, int32Operands(), int32Operands());
+    RUN_BINARY(testSubImmMem32, int32Operands(), int32Operands());
+    RUN_BINARY(testSubMemImm32, int32Operands(), int32Operands());
+    RUN_UNARY(testNegValueSubOne32, int64Operands());
+    
+    RUN_UNARY(testSubArgDouble, floatingPointOperands<double>());
+    RUN_BINARY(testSubArgsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testSubArgImmDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testSubImmArgDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_BINARY(testSubImmsDouble, floatingPointOperands<double>(), floatingPointOperands<double>());
+    RUN_UNARY(testSubArgFloat, floatingPointOperands<float>());
+    RUN_BINARY(testSubArgsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testSubArgImmFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testSubImmArgFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testSubImmsFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_UNARY(testSubArgFloatWithUselessDoubleConversion, floatingPointOperands<float>());
+    RUN_BINARY(testSubArgsFloatWithUselessDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN_BINARY(testSubArgsFloatWithEffectfulDoubleConversion, floatingPointOperands<float>(), floatingPointOperands<float>());
+}
+
+void addCallTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>& tasks)
+{
+    RUN(testCallSimple(1, 2));
+    RUN(testCallRare(1, 2));
+    RUN(testCallRareLive(1, 2, 3));
+    RUN(testCallSimplePure(1, 2));
+    RUN(testCallFunctionWithHellaArguments());
+    RUN(testCallFunctionWithHellaArguments2());
+    RUN(testCallFunctionWithHellaArguments3());
+    
+    RUN(testReturnDouble(0.0));
+    RUN(testReturnDouble(negativeZero()));
+    RUN(testReturnDouble(42.5));
+    RUN_UNARY(testReturnFloat, floatingPointOperands<float>());
+    
+    RUN(testCallSimpleDouble(1, 2));
+    RUN(testCallFunctionWithHellaDoubleArguments());
+    RUN_BINARY(testCallSimpleFloat, floatingPointOperands<float>(), floatingPointOperands<float>());
+    RUN(testCallFunctionWithHellaFloatArguments());
+}
+
+void addShrTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>& tasks)
+{
+    RUN(testSShrArgs(1, 0));
+    RUN(testSShrArgs(1, 1));
+    RUN(testSShrArgs(1, 62));
+    RUN(testSShrArgs(0xffffffffffffffff, 0));
+    RUN(testSShrArgs(0xffffffffffffffff, 1));
+    RUN(testSShrArgs(0xffffffffffffffff, 63));
+    RUN(testSShrImms(1, 0));
+    RUN(testSShrImms(1, 1));
+    RUN(testSShrImms(1, 62));
+    RUN(testSShrImms(1, 65));
+    RUN(testSShrImms(0xffffffffffffffff, 0));
+    RUN(testSShrImms(0xffffffffffffffff, 1));
+    RUN(testSShrImms(0xffffffffffffffff, 63));
+    RUN(testSShrArgImm(1, 0));
+    RUN(testSShrArgImm(1, 1));
+    RUN(testSShrArgImm(1, 62));
+    RUN(testSShrArgImm(1, 65));
+    RUN(testSShrArgImm(0xffffffffffffffff, 0));
+    RUN(testSShrArgImm(0xffffffffffffffff, 1));
+    RUN(testSShrArgImm(0xffffffffffffffff, 63));
+    RUN(testSShrArg32(32));
+    RUN(testSShrArgs32(1, 0));
+    RUN(testSShrArgs32(1, 1));
+    RUN(testSShrArgs32(1, 62));
+    RUN(testSShrArgs32(1, 33));
+    RUN(testSShrArgs32(0xffffffff, 0));
+    RUN(testSShrArgs32(0xffffffff, 1));
+    RUN(testSShrArgs32(0xffffffff, 63));
+    RUN(testSShrImms32(1, 0));
+    RUN(testSShrImms32(1, 1));
+    RUN(testSShrImms32(1, 62));
+    RUN(testSShrImms32(1, 33));
+    RUN(testSShrImms32(0xffffffff, 0));
+    RUN(testSShrImms32(0xffffffff, 1));
+    RUN(testSShrImms32(0xffffffff, 63));
+    RUN(testSShrArgImm32(1, 0));
+    RUN(testSShrArgImm32(1, 1));
+    RUN(testSShrArgImm32(1, 62));
+    RUN(testSShrArgImm32(0xffffffff, 0));
+    RUN(testSShrArgImm32(0xffffffff, 1));
+    RUN(testSShrArgImm32(0xffffffff, 63));
+    
+    RUN(testZShrArgs(1, 0));
+    RUN(testZShrArgs(1, 1));
+    RUN(testZShrArgs(1, 62));
+    RUN(testZShrArgs(0xffffffffffffffff, 0));
+    RUN(testZShrArgs(0xffffffffffffffff, 1));
+    RUN(testZShrArgs(0xffffffffffffffff, 63));
+    RUN(testZShrImms(1, 0));
+    RUN(testZShrImms(1, 1));
+    RUN(testZShrImms(1, 62));
+    RUN(testZShrImms(1, 65));
+    RUN(testZShrImms(0xffffffffffffffff, 0));
+    RUN(testZShrImms(0xffffffffffffffff, 1));
+    RUN(testZShrImms(0xffffffffffffffff, 63));
+    RUN(testZShrArgImm(1, 0));
+    RUN(testZShrArgImm(1, 1));
+    RUN(testZShrArgImm(1, 62));
+    RUN(testZShrArgImm(1, 65));
+    RUN(testZShrArgImm(0xffffffffffffffff, 0));
+    RUN(testZShrArgImm(0xffffffffffffffff, 1));
+    RUN(testZShrArgImm(0xffffffffffffffff, 63));
+    RUN(testZShrArg32(32));
+    RUN(testZShrArgs32(1, 0));
+    RUN(testZShrArgs32(1, 1));
+    RUN(testZShrArgs32(1, 62));
+    RUN(testZShrArgs32(1, 33));
+    RUN(testZShrArgs32(0xffffffff, 0));
+    RUN(testZShrArgs32(0xffffffff, 1));
+    RUN(testZShrArgs32(0xffffffff, 63));
+    RUN(testZShrImms32(1, 0));
+    RUN(testZShrImms32(1, 1));
+    RUN(testZShrImms32(1, 62));
+    RUN(testZShrImms32(1, 33));
+    RUN(testZShrImms32(0xffffffff, 0));
+    RUN(testZShrImms32(0xffffffff, 1));
+    RUN(testZShrImms32(0xffffffff, 63));
+    RUN(testZShrArgImm32(1, 0));
+    RUN(testZShrArgImm32(1, 1));
+    RUN(testZShrArgImm32(1, 62));
+    RUN(testZShrArgImm32(0xffffffff, 0));
+    RUN(testZShrArgImm32(0xffffffff, 1));
+    RUN(testZShrArgImm32(0xffffffff, 63));
+}
+
 #endif // ENABLE(B3_JIT)
index 431989c..364d280 100644 (file)
@@ -2912,4 +2912,202 @@ void testPatchpointAnyImm(ValueRep rep)
     CHECK(compileAndRun<int>(proc, 1) == 43);
 }
 
+void addSExtTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>& tasks)
+{
+    RUN(testSExt8(0));
+    RUN(testSExt8(1));
+    RUN(testSExt8(42));
+    RUN(testSExt8(-1));
+    RUN(testSExt8(0xff));
+    RUN(testSExt8(0x100));
+    RUN(testSExt8Fold(0));
+    RUN(testSExt8Fold(1));
+    RUN(testSExt8Fold(42));
+    RUN(testSExt8Fold(-1));
+    RUN(testSExt8Fold(0xff));
+    RUN(testSExt8Fold(0x100));
+    RUN(testSExt8SExt8(0));
+    RUN(testSExt8SExt8(1));
+    RUN(testSExt8SExt8(42));
+    RUN(testSExt8SExt8(-1));
+    RUN(testSExt8SExt8(0xff));
+    RUN(testSExt8SExt8(0x100));
+    RUN(testSExt8SExt16(0));
+    RUN(testSExt8SExt16(1));
+    RUN(testSExt8SExt16(42));
+    RUN(testSExt8SExt16(-1));
+    RUN(testSExt8SExt16(0xff));
+    RUN(testSExt8SExt16(0x100));
+    RUN(testSExt8SExt16(0xffff));
+    RUN(testSExt8SExt16(0x10000));
+    RUN(testSExt8BitAnd(0, 0));
+    RUN(testSExt8BitAnd(1, 0));
+    RUN(testSExt8BitAnd(42, 0));
+    RUN(testSExt8BitAnd(-1, 0));
+    RUN(testSExt8BitAnd(0xff, 0));
+    RUN(testSExt8BitAnd(0x100, 0));
+    RUN(testSExt8BitAnd(0xffff, 0));
+    RUN(testSExt8BitAnd(0x10000, 0));
+    RUN(testSExt8BitAnd(0, 0xf));
+    RUN(testSExt8BitAnd(1, 0xf));
+    RUN(testSExt8BitAnd(42, 0xf));
+    RUN(testSExt8BitAnd(-1, 0xf));
+    RUN(testSExt8BitAnd(0xff, 0xf));
+    RUN(testSExt8BitAnd(0x100, 0xf));
+    RUN(testSExt8BitAnd(0xffff, 0xf));
+    RUN(testSExt8BitAnd(0x10000, 0xf));
+    RUN(testSExt8BitAnd(0, 0xff));
+    RUN(testSExt8BitAnd(1, 0xff));
+    RUN(testSExt8BitAnd(42, 0xff));
+    RUN(testSExt8BitAnd(-1, 0xff));
+    RUN(testSExt8BitAnd(0xff, 0xff));
+    RUN(testSExt8BitAnd(0x100, 0xff));
+    RUN(testSExt8BitAnd(0xffff, 0xff));
+    RUN(testSExt8BitAnd(0x10000, 0xff));
+    RUN(testSExt8BitAnd(0, 0x80));
+    RUN(testSExt8BitAnd(1, 0x80));
+    RUN(testSExt8BitAnd(42, 0x80));
+    RUN(testSExt8BitAnd(-1, 0x80));
+    RUN(testSExt8BitAnd(0xff, 0x80));
+    RUN(testSExt8BitAnd(0x100, 0x80));
+    RUN(testSExt8BitAnd(0xffff, 0x80));
+    RUN(testSExt8BitAnd(0x10000, 0x80));
+    RUN(testBitAndSExt8(0, 0xf));
+    RUN(testBitAndSExt8(1, 0xf));
+    RUN(testBitAndSExt8(42, 0xf));
+    RUN(testBitAndSExt8(-1, 0xf));
+    RUN(testBitAndSExt8(0xff, 0xf));
+    RUN(testBitAndSExt8(0x100, 0xf));
+    RUN(testBitAndSExt8(0xffff, 0xf));
+    RUN(testBitAndSExt8(0x10000, 0xf));
+    RUN(testBitAndSExt8(0, 0xff));
+    RUN(testBitAndSExt8(1, 0xff));
+    RUN(testBitAndSExt8(42, 0xff));
+    RUN(testBitAndSExt8(-1, 0xff));
+    RUN(testBitAndSExt8(0xff, 0xff));
+    RUN(testBitAndSExt8(0x100, 0xff));
+    RUN(testBitAndSExt8(0xffff, 0xff));
+    RUN(testBitAndSExt8(0x10000, 0xff));
+    RUN(testBitAndSExt8(0, 0xfff));
+    RUN(testBitAndSExt8(1, 0xfff));
+    RUN(testBitAndSExt8(42, 0xfff));
+    RUN(testBitAndSExt8(-1, 0xfff));
+    RUN(testBitAndSExt8(0xff, 0xfff));
+    RUN(testBitAndSExt8(0x100, 0xfff));
+    RUN(testBitAndSExt8(0xffff, 0xfff));
+    RUN(testBitAndSExt8(0x10000, 0xfff));
+    
+    RUN(testSExt16(0));
+    RUN(testSExt16(1));
+    RUN(testSExt16(42));
+    RUN(testSExt16(-1));
+    RUN(testSExt16(0xffff));
+    RUN(testSExt16(0x10000));
+    RUN(testSExt16Fold(0));
+    RUN(testSExt16Fold(1));
+    RUN(testSExt16Fold(42));
+    RUN(testSExt16Fold(-1));
+    RUN(testSExt16Fold(0xffff));
+    RUN(testSExt16Fold(0x10000));
+    RUN(testSExt16SExt8(0));
+    RUN(testSExt16SExt8(1));
+    RUN(testSExt16SExt8(42));
+    RUN(testSExt16SExt8(-1));
+    RUN(testSExt16SExt8(0xffff));
+    RUN(testSExt16SExt8(0x10000));
+    RUN(testSExt16SExt16(0));
+    RUN(testSExt16SExt16(1));
+    RUN(testSExt16SExt16(42));
+    RUN(testSExt16SExt16(-1));
+    RUN(testSExt16SExt16(0xffff));
+    RUN(testSExt16SExt16(0x10000));
+    RUN(testSExt16SExt16(0xffffff));
+    RUN(testSExt16SExt16(0x1000000));
+    RUN(testSExt16BitAnd(0, 0));
+    RUN(testSExt16BitAnd(1, 0));
+    RUN(testSExt16BitAnd(42, 0));
+    RUN(testSExt16BitAnd(-1, 0));
+    RUN(testSExt16BitAnd(0xffff, 0));
+    RUN(testSExt16BitAnd(0x10000, 0));
+    RUN(testSExt16BitAnd(0xffffff, 0));
+    RUN(testSExt16BitAnd(0x1000000, 0));
+    RUN(testSExt16BitAnd(0, 0xf));
+    RUN(testSExt16BitAnd(1, 0xf));
+    RUN(testSExt16BitAnd(42, 0xf));
+    RUN(testSExt16BitAnd(-1, 0xf));
+    RUN(testSExt16BitAnd(0xffff, 0xf));
+    RUN(testSExt16BitAnd(0x10000, 0xf));
+    RUN(testSExt16BitAnd(0xffffff, 0xf));
+    RUN(testSExt16BitAnd(0x1000000, 0xf));
+    RUN(testSExt16BitAnd(0, 0xffff));
+    RUN(testSExt16BitAnd(1, 0xffff));
+    RUN(testSExt16BitAnd(42, 0xffff));
+    RUN(testSExt16BitAnd(-1, 0xffff));
+    RUN(testSExt16BitAnd(0xffff, 0xffff));
+    RUN(testSExt16BitAnd(0x10000, 0xffff));
+    RUN(testSExt16BitAnd(0xffffff, 0xffff));
+    RUN(testSExt16BitAnd(0x1000000, 0xffff));
+    RUN(testSExt16BitAnd(0, 0x8000));
+    RUN(testSExt16BitAnd(1, 0x8000));
+    RUN(testSExt16BitAnd(42, 0x8000));
+    RUN(testSExt16BitAnd(-1, 0x8000));
+    RUN(testSExt16BitAnd(0xffff, 0x8000));
+    RUN(testSExt16BitAnd(0x10000, 0x8000));
+    RUN(testSExt16BitAnd(0xffffff, 0x8000));
+    RUN(testSExt16BitAnd(0x1000000, 0x8000));
+    RUN(testBitAndSExt16(0, 0xf));
+    RUN(testBitAndSExt16(1, 0xf));
+    RUN(testBitAndSExt16(42, 0xf));
+    RUN(testBitAndSExt16(-1, 0xf));
+    RUN(testBitAndSExt16(0xffff, 0xf));
+    RUN(testBitAndSExt16(0x10000, 0xf));
+    RUN(testBitAndSExt16(0xffffff, 0xf));
+    RUN(testBitAndSExt16(0x1000000, 0xf));
+    RUN(testBitAndSExt16(0, 0xffff));
+    RUN(testBitAndSExt16(1, 0xffff));
+    RUN(testBitAndSExt16(42, 0xffff));
+    RUN(testBitAndSExt16(-1, 0xffff));
+    RUN(testBitAndSExt16(0xffff, 0xffff));
+    RUN(testBitAndSExt16(0x10000, 0xffff));
+    RUN(testBitAndSExt16(0xffffff, 0xffff));
+    RUN(testBitAndSExt16(0x1000000, 0xffff));
+    RUN(testBitAndSExt16(0, 0xfffff));
+    RUN(testBitAndSExt16(1, 0xfffff));
+    RUN(testBitAndSExt16(42, 0xfffff));
+    RUN(testBitAndSExt16(-1, 0xfffff));
+    RUN(testBitAndSExt16(0xffff, 0xfffff));
+    RUN(testBitAndSExt16(0x10000, 0xfffff));
+    RUN(testBitAndSExt16(0xffffff, 0xfffff));
+    RUN(testBitAndSExt16(0x1000000, 0xfffff));
+    
+    RUN(testSExt32BitAnd(0, 0));
+    RUN(testSExt32BitAnd(1, 0));
+    RUN(testSExt32BitAnd(42, 0));
+    RUN(testSExt32BitAnd(-1, 0));
+    RUN(testSExt32BitAnd(0x80000000, 0));
+    RUN(testSExt32BitAnd(0, 0xf));
+    RUN(testSExt32BitAnd(1, 0xf));
+    RUN(testSExt32BitAnd(42, 0xf));
+    RUN(testSExt32BitAnd(-1, 0xf));
+    RUN(testSExt32BitAnd(0x80000000, 0xf));
+    RUN(testSExt32BitAnd(0, 0x80000000));
+    RUN(testSExt32BitAnd(1, 0x80000000));
+    RUN(testSExt32BitAnd(42, 0x80000000));
+    RUN(testSExt32BitAnd(-1, 0x80000000));
+    RUN(testSExt32BitAnd(0x80000000, 0x80000000));
+    RUN(testBitAndSExt32(0, 0xf));
+    RUN(testBitAndSExt32(1, 0xf));
+    RUN(testBitAndSExt32(42, 0xf));
+    RUN(testBitAndSExt32(-1, 0xf));
+    RUN(testBitAndSExt32(0xffff, 0xf));
+    RUN(testBitAndSExt32(0x10000, 0xf));
+    RUN(testBitAndSExt32(0xffffff, 0xf));
+    RUN(testBitAndSExt32(0x1000000, 0xf));
+    RUN(testBitAndSExt32(0, 0xffff00000000llu));
+    RUN(testBitAndSExt32(1, 0xffff00000000llu));
+    RUN(testBitAndSExt32(42, 0xffff00000000llu));
+    RUN(testBitAndSExt32(-1, 0xffff00000000llu));
+    RUN(testBitAndSExt32(0x80000000, 0xffff00000000llu));
+}
+
 #endif // ENABLE(B3_JIT)
index 9a3d46e..d316cb7 100644 (file)
@@ -1189,7 +1189,7 @@ void testStore16Load16Z(int32_t value)
     CHECK(compileAndRun<int32_t>(proc, value) == static_cast<uint16_t>(value));
 }
 
-void testSShrShl32(int32_t value, int32_t sshrAmount, int32_t shlAmount)
+static void testSShrShl32(int32_t value, int32_t sshrAmount, int32_t shlAmount)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -1211,7 +1211,7 @@ void testSShrShl32(int32_t value, int32_t sshrAmount, int32_t shlAmount)
         == ((value << (shlAmount & 31)) >> (sshrAmount & 31)));
 }
 
-void testSShrShl64(int64_t value, int32_t sshrAmount, int32_t shlAmount)
+static void testSShrShl64(int64_t value, int32_t sshrAmount, int32_t shlAmount)
 {
     Procedure proc;
     BasicBlock* root = proc.addBlock();
@@ -2859,4 +2859,96 @@ void testPCOriginMapDoesntInsertNops()
     compileProc(proc);
 }
 
+void addSShrShTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>& tasks)
+{
+    RUN(testSShrShl32(42, 24, 24));
+    RUN(testSShrShl32(-42, 24, 24));
+    RUN(testSShrShl32(4200, 24, 24));
+    RUN(testSShrShl32(-4200, 24, 24));
+    RUN(testSShrShl32(4200000, 24, 24));
+    RUN(testSShrShl32(-4200000, 24, 24));
+    
+    RUN(testSShrShl32(42, 16, 16));
+    RUN(testSShrShl32(-42, 16, 16));
+    RUN(testSShrShl32(4200, 16, 16));
+    RUN(testSShrShl32(-4200, 16, 16));
+    RUN(testSShrShl32(4200000, 16, 16));
+    RUN(testSShrShl32(-4200000, 16, 16));
+    
+    RUN(testSShrShl32(42, 8, 8));
+    RUN(testSShrShl32(-42, 8, 8));
+    RUN(testSShrShl32(4200, 8, 8));
+    RUN(testSShrShl32(-4200, 8, 8));
+    RUN(testSShrShl32(4200000, 8, 8));
+    RUN(testSShrShl32(-4200000, 8, 8));
+    RUN(testSShrShl32(420000000, 8, 8));
+    RUN(testSShrShl32(-420000000, 8, 8));
+    
+    RUN(testSShrShl64(42, 56, 56));
+    RUN(testSShrShl64(-42, 56, 56));
+    RUN(testSShrShl64(4200, 56, 56));
+    RUN(testSShrShl64(-4200, 56, 56));
+    RUN(testSShrShl64(4200000, 56, 56));
+    RUN(testSShrShl64(-4200000, 56, 56));
+    RUN(testSShrShl64(420000000, 56, 56));
+    RUN(testSShrShl64(-420000000, 56, 56));
+    RUN(testSShrShl64(42000000000, 56, 56));
+    RUN(testSShrShl64(-42000000000, 56, 56));
+    
+    RUN(testSShrShl64(42, 48, 48));
+    RUN(testSShrShl64(-42, 48, 48));
+    RUN(testSShrShl64(4200, 48, 48));
+    RUN(testSShrShl64(-4200, 48, 48));
+    RUN(testSShrShl64(4200000, 48, 48));
+    RUN(testSShrShl64(-4200000, 48, 48));
+    RUN(testSShrShl64(420000000, 48, 48));
+    RUN(testSShrShl64(-420000000, 48, 48));
+    RUN(testSShrShl64(42000000000, 48, 48));
+    RUN(testSShrShl64(-42000000000, 48, 48));
+    
+    RUN(testSShrShl64(42, 32, 32));
+    RUN(testSShrShl64(-42, 32, 32));
+    RUN(testSShrShl64(4200, 32, 32));
+    RUN(testSShrShl64(-4200, 32, 32));
+    RUN(testSShrShl64(4200000, 32, 32));
+    RUN(testSShrShl64(-4200000, 32, 32));
+    RUN(testSShrShl64(420000000, 32, 32));
+    RUN(testSShrShl64(-420000000, 32, 32));
+    RUN(testSShrShl64(42000000000, 32, 32));
+    RUN(testSShrShl64(-42000000000, 32, 32));
+    
+    RUN(testSShrShl64(42, 24, 24));
+    RUN(testSShrShl64(-42, 24, 24));
+    RUN(testSShrShl64(4200, 24, 24));
+    RUN(testSShrShl64(-4200, 24, 24));
+    RUN(testSShrShl64(4200000, 24, 24));
+    RUN(testSShrShl64(-4200000, 24, 24));
+    RUN(testSShrShl64(420000000, 24, 24));
+    RUN(testSShrShl64(-420000000, 24, 24));
+    RUN(testSShrShl64(42000000000, 24, 24));
+    RUN(testSShrShl64(-42000000000, 24, 24));
+    
+    RUN(testSShrShl64(42, 16, 16));
+    RUN(testSShrShl64(-42, 16, 16));
+    RUN(testSShrShl64(4200, 16, 16));
+    RUN(testSShrShl64(-4200, 16, 16));
+    RUN(testSShrShl64(4200000, 16, 16));
+    RUN(testSShrShl64(-4200000, 16, 16));
+    RUN(testSShrShl64(420000000, 16, 16));
+    RUN(testSShrShl64(-420000000, 16, 16));
+    RUN(testSShrShl64(42000000000, 16, 16));
+    RUN(testSShrShl64(-42000000000, 16, 16));
+    
+    RUN(testSShrShl64(42, 8, 8));
+    RUN(testSShrShl64(-42, 8, 8));
+    RUN(testSShrShl64(4200, 8, 8));
+    RUN(testSShrShl64(-4200, 8, 8));
+    RUN(testSShrShl64(4200000, 8, 8));
+    RUN(testSShrShl64(-4200000, 8, 8));
+    RUN(testSShrShl64(420000000, 8, 8));
+    RUN(testSShrShl64(-420000000, 8, 8));
+    RUN(testSShrShl64(42000000000, 8, 8));
+    RUN(testSShrShl64(-42000000000, 8, 8));
+}
+
 #endif // ENABLE(B3_JIT)