Fix bug in testMulImm32SignExtend
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Aug 2019 21:30:39 +0000 (21:30 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Aug 2019 21:30:39 +0000 (21:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200358

Reviewed by Mark Lam.

Also, have it run in more configurations.

* b3/testb3_2.cpp:
(testMulImm32SignExtend):
* b3/testb3_3.cpp:
(addArgTests):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/b3/testb3_2.cpp
Source/JavaScriptCore/b3/testb3_3.cpp

index 9f24fa9..dee5fe0 100644 (file)
@@ -1,3 +1,17 @@
+2019-08-01  Keith Miller  <keith_miller@apple.com>
+
+        Fix bug in testMulImm32SignExtend
+        https://bugs.webkit.org/show_bug.cgi?id=200358
+
+        Reviewed by Mark Lam.
+
+        Also, have it run in more configurations.
+
+        * b3/testb3_2.cpp:
+        (testMulImm32SignExtend):
+        * b3/testb3_3.cpp:
+        (addArgTests):
+
 2019-07-31  Mark Lam  <mark.lam@apple.com>
 
         Rename DOMJIT safe/unsafeFunction to functionWithTypeChecks and functionWithoutTypeChecks.
index d3fb189..bc61b54 100644 (file)
@@ -961,14 +961,14 @@ void testMulImm32SignExtend(const int a, int b)
     Value* arg1 = root->appendNew<Const64Value>(proc, Origin(), a);
     Value* arg2 = root->appendNew<Value>(
         proc, Trunc, Origin(),
-        root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1));
+        root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
     Value* arg264 = root->appendNew<Value>(proc, SExt32, Origin(), arg2);
     Value* mul = root->appendNew<Value>(proc, Mul, Origin(), arg1, arg264);
     root->appendNewControlValue(proc, Return, Origin(), mul);
 
     auto code = compileProc(proc);
 
-    CHECK(invoke<long int>(*code, b) == ((long int) a) * ((long int) b));
+    CHECK_EQ(invoke<long int>(*code, b), ((long int) a) * ((long int) b));
 }
 
 void testMulLoadTwice()
index c1d912c..d706210 100644 (file)
@@ -3104,11 +3104,7 @@ void addArgTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>& tasks)
     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_BINARY(testMulImm32SignExtend, int32Operands(), int32Operands());
     RUN(testMulImm32SignExtend(0xFFFFFFFE, 0xFFFFFFFF));
     RUN(testMulImm32SignExtend(0xFFFFFFFF, 0xFFFFFFFE));
     RUN(testMulArgs32(1, 1));