l1a/l1b PASS; l2 FAIL (unsupported + 2/4 codepaths broken)#562
Open
opencode-agent[bot] wants to merge 1 commit into
Open
l1a/l1b PASS; l2 FAIL (unsupported + 2/4 codepaths broken)#562opencode-agent[bot] wants to merge 1 commit into
opencode-agent[bot] wants to merge 1 commit into
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
l2ias unsupported; GenericX86CodeGenerator has 2/4 code paths incorrectDetails
l1a Implementation
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:2981,core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java,core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java:178Analysis:
l2i(opcode 0x88): convertslongtointby taking low-order 32 bitsvisit_l2i()at line 2981: popsLongItem, handles constant folding ((int) v.getValue()), and for non-constants:IntItemINT, keeps low 32 bits via register aliasingVirtualStack.popLong()(line 178) correctly enforces category-2 type checkingDoubleWordItem.getLsbRegister()(line 171) provides access to low 32 bits in 32-bit model1b Implementation
core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:3717,core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java,core/src/core/org/jnode/vm/x86/compiler/l1b/VirtualStack.java:177Analysis:
visit_l2i()at line 3717: same constant folding and register handlingl2i,l2i-const,l2i-nonconst)VirtualStack.popLong()(line 177) enforces category-2 typel2 Implementation
core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.java:270core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java:425,501,586,666core/src/core/org/jnode/vm/compiler/ir/IRGenerator.java:776core/src/core/org/jnode/vm/compiler/ir/Constant.java:68core/src/core/org/jnode/vm/compiler/ir/quad/UnaryQuad.java:128notSupported(), throwingUnsupportedOperationException. This prevents L2 compilation of any method containingl2i.generateCodeFor(UnaryQuad, Object lhsReg, UnaryOperation, Object rhsReg)(line 425-428): ThrowsIllegalArgumentExceptionfor L2IgenerateCodeFor(UnaryQuad, Object lhsReg, UnaryOperation, int rhsDisp)(line 501-503): CORRECT -MOV BITS32 lhsReg, [EBP + rhsDisp - SLOTSIZE](loads low 32 bits)generateCodeFor(UnaryQuad, int lhsDisp, UnaryOperation, int rhsDisp)(line 585-593): WRONG - Uses FPU instructionsFLD32+FISTP32(float conversion semantics, not integer truncation)generateCodeFor(UnaryQuad, int lhsDisp, UnaryOperation, int rhsDisp)(line 666-669): CORRECT -MOV BITS32 SR1, [EBP + rhsDisp - SLOTSIZE]thenMOV BITS32 [EBP + lhsDisp], SR1stackOffset -= 2(pop long),setType(INT), addUnaryQuad(L2I),stackOffset += 1(push int)l2ias(int) longValueConstant.l2i()for constant foldingSpec References:
l2i: "converted to anintresult by taking the low-order 32 bits of thelongvalue and discarding the high-order 32 bits"..., value → ..., result(category-2 → category-1)Conclusion: L2 cannot compile methods with
l2idue to support checker. Even if enabled, 2 of 4 code generation paths are broken (one throws, one uses wrong FPU semantics).Closes #333
opencode session | github run