You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(singlepass): read float return values from SIMD registers per C ABI
The singlepass compiler's `emit_call_native` reads all return values
from GPR registers (RAX/RDX on x86_64, X0-X7 on ARM64, X10+ on
RISC-V). However, the platform C ABIs return floating-point values in
SIMD registers (XMM0-XMM1 on x86_64, V0-V7 on ARM64, FA0-FA1 on
RISC-V). This causes f32/f64 return values from imported host functions
to contain garbage.
This regression was introduced when return value handling was moved from
the type-aware `Operator::Call` handler into `emit_call_native`, which
uses `get_return_value_location()` — a function that unconditionally
returns GPR locations regardless of the value type.
The fix adds `get_simd_return_register()` to the Machine trait, which
returns the correct SIMD register for float return values per the
platform's C ABI. After building the return value location list in
`emit_call_native`, float entries are replaced with the correct SIMD
register.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments