l1a/l1b PASS; L2 FAIL - LSHL unimplemented#567
Open
opencode-agent[bot] wants to merge 1 commit into
Open
Conversation
Co-authored-by: LSantha <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec compliance report
Details
l1a Implementation
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:3425-3466Analysis:
IntItem(shift count) andLongItem(value) from virtual stack per JVM spec operand stack effect (..., value1, value2 → ..., result)AND ECX, 63(line 3443) implementing the spec requirement "s is the low 6 bits of value2"SHLD_CL(v1_msb, v1_lsb) +SHL_CL(v1_lsb) for 64-bit shiftSHL_CLon MSBSHL_CLon 64-bit GPRLongItemback to vstackl1b Implementation
core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:4274-4325Analysis:
l2 Implementation
core/src/core/org/jnode/vm/compiler/ir/IRGenerator.java:690-696(correctly creates BinaryQuad with LSHL)core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.java(no visit_lshl override - implicitly supported)core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java(lines 921, 1084, 1267, 1482, 1667, 1860, 2046, 2208, 2385, 2542, 2689, 2863, 3017, 3211, 3400, 3635)generateBinaryOPoverloads in GenericX86CodeGenerator havecase LSHL:that throwsIllegalArgumentException("Unknown operation: " + operation). X86CodeGenerator and FPX86CodeGenerator do not override this behavior.Impact: Any method containing
lshlthat gets compiled by L2 will fail at compile time withUnsupportedOperationException/IllegalArgumentException. The L2 compiler cannot compile code containing long shift-left instructions.JVM Spec References
JVM Spec (Java SE 6) - lshl instruction:
lshllshl = 121 (0x79)..., value1, value2 → ..., resultCloses #352
opencode session | github run