Resolve endianess at compile time.

Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
This commit is contained in:
Stefan Pejić 2025-10-27 15:17:58 +01:00 committed by GitHub
parent 02542557d7
commit 19b16ffe8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,7 +172,7 @@ fn call__aeabi_cdcmpxx(comptime func: __aeabi_cdcmpxx, a: f64, b: f64) CPSR {
const A: u64 = @bitCast(a);
const B: u64 = @bitCast(b);
const le = builtin.cpu.arch.endian() == .little;
const le = comptime builtin.cpu.arch.endian() == .little;
const a_lo: u32 = if (le) @truncate(A) else @truncate(A >> 32);
const a_hi: u32 = if (le) @truncate(A >> 32) else @truncate(A);
const b_lo: u32 = if (le) @truncate(B) else @truncate(B >> 32);