-
Notifications
You must be signed in to change notification settings - Fork 6.3k
8359435: AArch64: add support for SB instruction to MacroAssembler::spin_wait #25801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
74c37f1
8f33b60
a045194
9b02a59
ab8c7e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,8 @@ class SpinWait { | |
| NONE = -1, | ||
| NOP, | ||
| ISB, | ||
| YIELD | ||
| YIELD, | ||
| SB | ||
| }; | ||
|
|
||
| private: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,6 +179,7 @@ public enum CPUFeature implements CPUFeatureName { | |
| SHA3, | ||
| SHA512, | ||
| SVE, | ||
| SB, | ||
| PACA, | ||
| SVEBITPERM, | ||
| SVE2, | ||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,9 +33,11 @@ | |
| * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c2 nop 7 | ||
| * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c2 isb 3 | ||
| * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c2 yield 1 | ||
| * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c2 sb | ||
| * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c1 nop 7 | ||
| * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c1 isb 3 | ||
| * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c1 yield | ||
| * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c1 sb | ||
| */ | ||
|
|
||
| package compiler.onSpinWait; | ||
|
|
@@ -56,7 +58,6 @@ public static void main(String[] args) throws Exception { | |
| command.add("-showversion"); | ||
| command.add("-XX:-BackgroundCompilation"); | ||
| command.add("-XX:+UnlockDiagnosticVMOptions"); | ||
| command.add("-XX:+PrintAssembly"); | ||
| if (compiler.equals("c2")) { | ||
| command.add("-XX:-TieredCompilation"); | ||
| } else if (compiler.equals("c1")) { | ||
|
|
@@ -69,13 +70,17 @@ public static void main(String[] args) throws Exception { | |
| command.add("-XX:OnSpinWaitInst=" + spinWaitInst); | ||
| command.add("-XX:OnSpinWaitInstCount=" + spinWaitInstCount); | ||
| command.add("-XX:CompileCommand=compileonly," + Launcher.class.getName() + "::" + "test"); | ||
| command.add("-XX:CompileCommand=print," + Launcher.class.getName() + "::" + "test"); | ||
| command.add(Launcher.class.getName()); | ||
|
|
||
| ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command); | ||
|
|
||
| OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); | ||
|
|
||
| analyzer.shouldHaveExitValue(0); | ||
| if (analyzer.getExitValue() != 0 && "sb".equals(spinWaitInst) && analyzer.contains("CPU does not support SB")) { | ||
|
||
| System.out.println("Skipping the test. The current CPU does not support SB instruction."); | ||
| return; | ||
| } | ||
|
|
||
| System.out.println(analyzer.getOutput()); | ||
|
|
||
|
|
@@ -89,6 +94,8 @@ private static String getSpinWaitInstHex(String spinWaitInst) { | |
| return "df3f 03d5"; | ||
| } else if ("yield".equals(spinWaitInst)) { | ||
| return "3f20 03d5"; | ||
| } else if ("sb".equals(spinWaitInst)) { | ||
| return "ff30 03d5"; | ||
| } else { | ||
| throw new RuntimeException("Unknown spin wait instruction: " + spinWaitInst); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are touching up the test: maybe just say
sb 1explicitly, and then readspinWaitInstCountfromargs[2]unconditionally?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done