Begin organizing b3 tests
[WebKit-https.git] / Source / JavaScriptCore / b3 / testb3_1.cpp
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());