authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-19 23:14:49+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-23 09:27:17+02:00
logdda05b29c06731895970e75c7444f0d30c7d334f
tree64a6547fed0f39db22be6b5308e808567705a3f7
parent45b80f2e41adfef82cfbdfec4d63a35de66b2f5f
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: fix cMaxIntAlignment() for a few architectures


1 files changed, 18 insertions(+), 23 deletions(-)

lib/std/Target.zig+18-23
...@@ -3377,32 +3377,40 @@ pub fn cMaxIntAlignment(target: *const Target) u16 {...@@ -3377,32 +3377,40 @@ pub fn cMaxIntAlignment(target: *const Target) u16 {
33773377
3378 .msp430 => 2,3378 .msp430 => 2,
33793379
3380 .xcore,3380 .arc,
3381 .csky,
3382 .kalimba,
3383 .or1k,
3381 .propeller,3384 .propeller,
3385 .xcore,
3382 => 4,3386 => 4,
33833387
3384 .amdgcn,
3385 .arm,3388 .arm,
3386 .armeb,3389 .armeb,
3387 .thumb,
3388 .thumbeb,
3389 .lanai,
3390 .hexagon,3390 .hexagon,
3391 .lanai,
3392 .loongarch32,
3393 .m68k,
3391 .mips,3394 .mips,
3392 .mipsel,3395 .mipsel,
3393 .or1k,
3394 .powerpc,3396 .powerpc,
3395 .powerpcle,3397 .powerpcle,
3396 .riscv32,3398 .riscv32,
3397 .riscv32be,3399 .riscv32be,
3398 .s390x,3400 .s390x,
3401 .sparc,
3402 .thumb,
3403 .thumbeb,
3404 .x86,
3405 .xtensa,
3399 => 8,3406 => 8,
34003407
3401 // Even LLVMABIAlignmentOfType(i128) agrees on these targets.
3402 .aarch64,3408 .aarch64,
3403 .aarch64_be,3409 .aarch64_be,
3410 .amdgcn,
3404 .bpfel,3411 .bpfel,
3405 .bpfeb,3412 .bpfeb,
3413 .loongarch64,
3406 .mips64,3414 .mips64,
3407 .mips64el,3415 .mips64el,
3408 .nvptx,3416 .nvptx,
...@@ -3411,26 +3419,13 @@ pub fn cMaxIntAlignment(target: *const Target) u16 {...@@ -3411,26 +3419,13 @@ pub fn cMaxIntAlignment(target: *const Target) u16 {
3411 .powerpc64le,3419 .powerpc64le,
3412 .riscv64,3420 .riscv64,
3413 .riscv64be,3421 .riscv64be,
3414 .sparc,
3415 .sparc64,3422 .sparc64,
3416 .wasm32,
3417 .wasm64,
3418 .x86,
3419 .x86_64,
3420 => 16,
3421
3422 // Below this comment are unverified but based on the fact that C requires
3423 // int128_t to be 16 bytes aligned, it's a safe default.
3424 .arc,
3425 .csky,
3426 .kalimba,
3427 .loongarch32,
3428 .loongarch64,
3429 .m68k,
3430 .spirv32,3423 .spirv32,
3431 .spirv64,3424 .spirv64,
3432 .ve,3425 .ve,
3433 .xtensa,3426 .wasm32,
3427 .wasm64,
3428 .x86_64,
3434 => 16,3429 => 16,
3435 };3430 };
3436}3431}