akldc opened issue #11232:
.clifTest Casetest optimize set opt_level=none set preserve_frame_pointers=true set enable_multi_ret_implicit_sret=true set enable_nan_canonicalization=true function %main() -> i64x2 fast { ss0 = explicit_slot 32 block0: v4 = iconst.i64 0x3c37_33b7_38fd_cbe8 v14 = stack_addr.i64 ss0 store little v4, v14 store little v4, v14+8 store little v4, v14+16 store little v4, v14+24 v17 = stack_addr.i64 ss0 v18 = load.i64x2 v17 return v18 } ; print: %main()Versions and Environment
Target Architecture: s390x
Environment:
qemu-s390xto emulate execution on the x86 machine.Steps to Reproduce
Execute using
runandinterpretrespectively.$ clif-util run -v test.clif $ clif-util interpret -v test.clifActual Results
[run ] %main() -> 0xe8cbfd38b733373ce8cbfd38b733373c [interp] %main() -> 0x3c3733b738fdcbe83c3733b738fdcbe8The
loadinstruction reads in big-endian under theruncommand, but in little-endian underinterpret.
This inconsistency probably needs to be fixed.
akldc added the bug label to Issue #11232.
akldc added the cranelift label to Issue #11232.
alexcrichton closed issue #11232:
.clifTest Casetest optimize set opt_level=none set preserve_frame_pointers=true set enable_multi_ret_implicit_sret=true set enable_nan_canonicalization=true function %main() -> i64x2 fast { ss0 = explicit_slot 32 block0: v4 = iconst.i64 0x3c37_33b7_38fd_cbe8 v14 = stack_addr.i64 ss0 store little v4, v14 store little v4, v14+8 store little v4, v14+16 store little v4, v14+24 v17 = stack_addr.i64 ss0 v18 = load.i64x2 v17 return v18 } ; print: %main()Versions and Environment
Target Architecture: s390x
Environment:
qemu-s390xto emulate execution on the x86 machine.Steps to Reproduce
Execute using
runandinterpretrespectively.$ clif-util run -v test.clif $ clif-util interpret -v test.clifActual Results
[run ] %main() -> 0xe8cbfd38b733373ce8cbfd38b733373c [interp] %main() -> 0x3c3733b738fdcbe83c3733b738fdcbe8The
loadinstruction reads in big-endian under theruncommand, but in little-endian underinterpret.
This inconsistency probably needs to be fixed.
alexcrichton commented on issue #11232:
I believe this is intended behavior where the interpreter is emulating a little-endian machine but s390x is a big-endian machine, so I don't believe there's a bug here. Thanks though for the report!
cfallin commented on issue #11232:
And specifically, we have decided that loads without a
bigorlittleflag are "native" endian, which means that the CLIF execution semantics depend on the target. If you're doing cross-target fuzzing, you'll need to account for this (and probably you'd do best to explicitly add endianness to all loads/stores).
bjorn3 commented on issue #11232:
I did expect the interpreter to take the target to emulate as argument to allow cross-testing.
Last updated: Dec 06 2025 at 06:05 UTC