From e5c75479c2c166c99219083fd24b70901d776367 Mon Sep 17 00:00:00 2001 From: Alex Rønne Petersen Date: Tue, 30 Jul 2024 00:59:50 +0200 Subject: std.Target: Rework isPPC()/isPPC64() functions. * Rename isPPC() -> isPowerPC32(). * Rename isPPC64() -> isPowerPC64(). * Add new isPowerPC() function which covers both. There was confusion even in the standard library about what isPPC() meant. This change makes these functions work how I think most people actually expect them to work, and makes them consistent with isMIPS(), isSPARC(), etc. I chose to rename from PPC to PowerPC because 1) it's more consistent with the other functions, and 2) it'll cause loud rather than silent breakage for anyone who might have been depending on isPPC() while misunderstanding it. --- src/codegen/llvm.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/codegen/llvm.zig') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 23e39caa98..1ba1ed8b6f 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -399,7 +399,7 @@ const DataLayoutBuilder = struct { else if (self.target.cpu.arch == .powerpc64 and self.target.os.tag != .freebsd and self.target.abi != .musl) try writer.writeAll("-Fi64") - else if (self.target.cpu.arch.isPPC() or self.target.cpu.arch.isPPC64()) + else if (self.target.cpu.arch.isPowerPC()) try writer.writeAll("-Fn32"); if (self.target.cpu.arch != .hexagon) { if (self.target.cpu.arch == .arc or self.target.cpu.arch == .s390x) @@ -659,7 +659,7 @@ const DataLayoutBuilder = struct { 128 => abi = 64, else => {}, } - } else if ((self.target.cpu.arch.isPPC64() and self.target.os.tag == .linux and + } else if ((self.target.cpu.arch.isPowerPC64() and self.target.os.tag == .linux and (size == 256 or size == 512)) or (self.target.cpu.arch.isNvptx() and (size == 16 or size == 32))) { -- cgit v1.2.3