diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-01-24 02:04:51 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-02-17 19:17:56 +0100 |
| commit | ce8c61b0fcb7e0610d4b39728b2d73ed10e762f6 (patch) | |
| tree | 205013fb60c2e44f153d3b5648fffd50636cc7ed /src/target.zig | |
| parent | 00481668671a8719627922a05a1c143f9d0409ed (diff) | |
| download | zig-ce8c61b0fcb7e0610d4b39728b2d73ed10e762f6.tar.gz zig-ce8c61b0fcb7e0610d4b39728b2d73ed10e762f6.zip | |
std.Target: Move Cpu.Arch.supportsAddressSpace() up to Cpu.
This allows it to inspect CPU features which is needed for Propeller, and AVR in
the future.
Diffstat (limited to 'src/target.zig')
| -rw-r--r-- | src/target.zig | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/target.zig b/src/target.zig index ed28657e20..621cac3479 100644 --- a/src/target.zig +++ b/src/target.zig @@ -442,12 +442,11 @@ pub fn addrSpaceCastIsValid( from: AddressSpace, to: AddressSpace, ) bool { - const arch = target.cpu.arch; - switch (arch) { - .x86_64, .x86 => return arch.supportsAddressSpace(from, null) and arch.supportsAddressSpace(to, null), + switch (target.cpu.arch) { + .x86_64, .x86 => return target.cpu.supportsAddressSpace(from, null) and target.cpu.supportsAddressSpace(to, null), .nvptx64, .nvptx, .amdgcn => { - const to_generic = arch.supportsAddressSpace(from, null) and to == .generic; - const from_generic = arch.supportsAddressSpace(to, null) and from == .generic; + const to_generic = target.cpu.supportsAddressSpace(from, null) and to == .generic; + const from_generic = target.cpu.supportsAddressSpace(to, null) and from == .generic; return to_generic or from_generic; }, else => return from == .generic and to == .generic, |
