From dda05b29c06731895970e75c7444f0d30c7d334f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 19 Oct 2025 23:14:49 +0200 Subject: [PATCH] std.Target: fix cMaxIntAlignment() for a few architectures --- lib/std/Target.zig | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 5cc887fcaa..9ffad45de3 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3377,32 +3377,40 @@ pub fn cMaxIntAlignment(target: *const Target) u16 { .msp430 => 2, - .xcore, + .arc, + .csky, + .kalimba, + .or1k, .propeller, + .xcore, => 4, - .amdgcn, .arm, .armeb, - .thumb, - .thumbeb, - .lanai, .hexagon, + .lanai, + .loongarch32, + .m68k, .mips, .mipsel, - .or1k, .powerpc, .powerpcle, .riscv32, .riscv32be, .s390x, + .sparc, + .thumb, + .thumbeb, + .x86, + .xtensa, => 8, - // Even LLVMABIAlignmentOfType(i128) agrees on these targets. .aarch64, .aarch64_be, + .amdgcn, .bpfel, .bpfeb, + .loongarch64, .mips64, .mips64el, .nvptx, @@ -3411,26 +3419,13 @@ pub fn cMaxIntAlignment(target: *const Target) u16 { .powerpc64le, .riscv64, .riscv64be, - .sparc, .sparc64, - .wasm32, - .wasm64, - .x86, - .x86_64, - => 16, - - // Below this comment are unverified but based on the fact that C requires - // int128_t to be 16 bytes aligned, it's a safe default. - .arc, - .csky, - .kalimba, - .loongarch32, - .loongarch64, - .m68k, .spirv32, .spirv64, .ve, - .xtensa, + .wasm32, + .wasm64, + .x86_64, => 16, }; }