aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler/aro
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-07-30 00:59:50 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-08-01 20:58:05 +0200
commite5c75479c2c166c99219083fd24b70901d776367 (patch)
tree508cb67fefe0ec7b85710daa745c3993af7c2eeb /lib/compiler/aro
parent5e08d00862fb10c72cd011bf29112e12ef38d576 (diff)
downloadzig-e5c75479c2c166c99219083fd24b70901d776367.tar.gz
zig-e5c75479c2c166c99219083fd24b70901d776367.zip
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.
Diffstat (limited to 'lib/compiler/aro')
-rw-r--r--lib/compiler/aro/aro/Toolchain.zig2
-rw-r--r--lib/compiler/aro/aro/target.zig2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/compiler/aro/aro/Toolchain.zig b/lib/compiler/aro/aro/Toolchain.zig
index 1313675f6c..fca44e07ec 100644
--- a/lib/compiler/aro/aro/Toolchain.zig
+++ b/lib/compiler/aro/aro/Toolchain.zig
@@ -89,7 +89,7 @@ pub fn discover(tc: *Toolchain) !void {
.{ .unknown = {} } // TODO
else if (target.cpu.arch.isMIPS())
.{ .unknown = {} } // TODO
- else if (target.cpu.arch.isPPC())
+ else if (target.cpu.arch.isPowerPC())
.{ .unknown = {} } // TODO
else if (target.cpu.arch == .ve)
.{ .unknown = {} } // TODO
diff --git a/lib/compiler/aro/aro/target.zig b/lib/compiler/aro/aro/target.zig
index 2f46ebd605..a876723302 100644
--- a/lib/compiler/aro/aro/target.zig
+++ b/lib/compiler/aro/aro/target.zig
@@ -264,7 +264,7 @@ pub fn systemCompiler(target: std.Target) LangOpts.Compiler {
pub fn hasFloat128(target: std.Target) bool {
if (target.cpu.arch.isWasm()) return true;
if (target.isDarwin()) return false;
- if (target.cpu.arch.isPPC() or target.cpu.arch.isPPC64()) return std.Target.powerpc.featureSetHas(target.cpu.features, .float128);
+ if (target.cpu.arch.isPowerPC()) return std.Target.powerpc.featureSetHas(target.cpu.features, .float128);
return switch (target.os.tag) {
.dragonfly,
.haiku,