Bug 264984 - [JSC] Refine B3 and masm tests for EXTR pattern detection and application
Summary: [JSC] Refine B3 and masm tests for EXTR pattern detection and application
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yijia Huang
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-11-16 14:59 PST by Yijia Huang
Modified: 2024-02-06 09:24 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yijia Huang 2023-11-16 14:59:15 PST
Also need to add these test cases.

--- a/Source/JavaScriptCore/b3/testb3_2.cpp
+++ b/Source/JavaScriptCore/b3/testb3_2.cpp
@@ -4883,7 +4883,7 @@ void testExtractRegister32()
 {
     if (JSC::Options::defaultB3OptLevel() < 2)
         return;    
-    Vector<uint32_t> lowWidths = { 0, 17, 31 };
+    Vector<uint32_t> lowWidths = { 0, 17, 31, 32 };
 
     // Test Pattern: ((n & mask1) << highWidth) | ((m & mask2) >> lowWidth)
     // Where: highWidth = datasize - lowWidth
@@ -4915,7 +4915,7 @@ void testExtractRegister32()
             root->appendNew<Value>(proc, BitOr, Origin(), left, right));
 
         auto code = compileProc(proc);
-        if (isARM64() && lowWidth > 0)
+        if (isARM64() && 0 < lowWidth && lowWidth < 32)
             checkUsesInstruction(*code, "extr");
         return invoke<uint32_t>(*code, n, m);
     };
@@ -4943,7 +4943,7 @@ void testExtractRegister64()
 {
     if (JSC::Options::defaultB3OptLevel() < 2)
         return;    
-    Vector<uint64_t> lowWidths = { 0, 34, 63 };
+    Vector<uint64_t> lowWidths = { 0, 34, 63, 64 };
 
     // Test Pattern: ((n & mask1) << highWidth) | ((m & mask2) >> lowWidth)
     // Where: highWidth = datasize - lowWidth
@@ -4971,7 +4971,7 @@ void testExtractRegister64()
             root->appendNew<Value>(proc, BitOr, Origin(), left, right));
 
         auto code = compileProc(proc);
-        if (isARM64() && lowWidth > 0)
+        if (isARM64() && 0 < lowWidth && lowWidth < 64)
             checkUsesInstruction(*code, "extr");
         return invoke<uint64_t>(*code, n, m);
     };
Comment 1 Radar WebKit Bug Importer 2023-11-16 14:59:59 PST
<rdar://problem/118532295>
Comment 2 Yijia Huang 2024-02-03 17:09:04 PST
Pull request: https://github.com/WebKit/WebKit/pull/23820
Comment 3 EWS 2024-02-06 09:24:14 PST
Committed 274149@main (084df28f4fc4): <https://commits.webkit.org/274149@main>

Reviewed commits have been landed. Closing PR #23820 and removing active labels.