All three JIT tiers (L1A, L1B, L2) PASS fstore_1 spec compliance.#555
Open
opencode-agent[bot] wants to merge 1 commit into
Open
All three JIT tiers (L1A, L1B, L2) PASS fstore_1 spec compliance.#555opencode-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
Details
l1a Implementation
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:1850,core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:4375(wstore)Analysis:
The L1A compiler correctly handles
fstore_1through the standardvisit_fstore(int index)pathway:handler.visit_fstore(1)with the implicit index 1.wstore(JvmType.FLOAT, index).stackFrame.getEbpOffset(typeSizeInfo, index)(index=1)vstack.loadLocal(eContext, disp)WordItemof type FLOAT from the virtual stackFloat.floatToRawIntBits+MOV_Const), FPUSTACK (viaFSTP32), STACK (viaPOP), and GPR (viaMOV)The implementation matches the JVM spec: pops a float from the operand stack, performs value-set conversion (implicit in bitwise representation), and stores to local variable 1. Category-1 (single-slot) handling is correct for float.
l1b Implementation
core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:2235,core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:5368(wstore)Analysis:
L1B mirrors L1A's structure with minor additions:
wstore(JvmType.FLOAT, index).constLocalstracking for constant propagation optimization...., value → ...).The wide prefix is correctly NOT handled for fstore_1 (BytecodeParser.java:827-872 only includes base fstore 0x38 in the wide opcode list, not fstore_), per JVM spec.
l2 Implementation
core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.java(inherits default, no override → supported)core/src/core/org/jnode/vm/compiler/ir/IRGenerator.java:401(visit_fstore)core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java:278(generateCodeFor VariableRefAssignQuad)Analysis:
The L2 compiler uses an IR-based pipeline:
visit_fstore, inheriting the empty implementation fromBytecodeVisitorSupport→ instruction is supported.stackOffsetby 1 (category-1 pop)Operand.FLOATtype on both local variable and stack slotVariableRefAssignQuad(lhs=index, rhs=stackOffset)representing the storeos.writePOP(X86Register.EBP, disp1)at line 340X86StackFrame.getEbpOffset(X86StackFrame.java:322-333) which correctly handles category-1 locals at(stackSlot - noArgs + 1) * -slotSizeThe IR and codegen correctly model the JVM spec: single-slot float value popped from operand stack, stored to local variable 1. The
wideprefix is not applicable tofstore_1(implicit index), consistent with spec.JVM Spec References:
fstore_1= 68 (0x44), no operands..., value → ...(value must be float, category 1)Closes #283
opencode session | github run