From e4069c6c5f8dc084dd64de5023ed8e95e34badab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 17 Oct 2026 03:10:57 +0200 Subject: [PATCH] std.Target: simplify freestanding prong in cTypeBitSize() a bit --- lib/std/Target.zig | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index ca68c6b13c5e808b962b9a4ee2894e6a170cd9fc..a4dbacd9988cb54019d3503914b5f425cf1274d5 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -3242,30 +3242,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .long, .ulong, .float => 32, .double, .longdouble, .longlong, .ulonglong => 64, }, - .mips64, - .mips64el, - => switch (c_type) { - .char => 8, - .short, .ushort => 16, - .int, .uint, .float => 32, - .long, .ulong => switch (target.abi) { - .abin32 => 32, - else => 64, - }, - .longlong, .ulonglong, .double => 64, - .longdouble => 128, - }, - .x86_64 => switch (c_type) { - .char => 8, - .short, .ushort => 16, - .int, .uint, .float => 32, - .long, .ulong => switch (target.abi) { - .x32 => 32, - else => 64, - }, - .longlong, .ulonglong, .double => 64, - .longdouble => 80, - }, else => switch (c_type) { .char => 8, .short, .ushort => 16, @@ -3273,7 +3249,11 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .long, .ulong => target.ptrBitWidth(), .longlong, .ulonglong, .double => 64, .longdouble => switch (target.cpu.arch) { - .x86 => 80, + else => 64, + + .x86, + .x86_64, + => 80, .alpha, .riscv32, @@ -3282,6 +3262,8 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .riscv64be, .aarch64, .aarch64_be, + .mips64, + .mips64el, .powerpc, .powerpcle, .powerpc64, @@ -3295,8 +3277,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 { .loongarch64, .ve, => 128, - - else => 64, }, }, }, -- 2.54.0