aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2022-08-20 12:42:27 +0200
committerRobin Voetter <robin@voetter.nl>2022-10-12 20:34:41 +0200
commit3392de87dcf516ed2e3fd1904372195bdc75c0eb (patch)
treeb87b51283d6a78c708de7a9ee75b4acabfcf0d24 /src/Sema.zig
parent5859d8458f919676be804835aaeb3ed844a67542 (diff)
downloadzig-3392de87dcf516ed2e3fd1904372195bdc75c0eb.tar.gz
zig-3392de87dcf516ed2e3fd1904372195bdc75c0eb.zip
allow global/local/shared address spaces on amdgcn
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 505764da8a..b357beafdf 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -30303,13 +30303,15 @@ pub fn analyzeAddrspace(
const address_space = addrspace_tv.val.toEnum(std.builtin.AddressSpace);
const target = sema.mod.getTarget();
const arch = target.cpu.arch;
- const is_gpu = arch == .nvptx or arch == .nvptx64;
+ const is_nv = arch == .nvptx or arch == .nvptx64;
+ const is_gpu = is_nv or arch == .amdgcn;
const supported = switch (address_space) {
.generic => true,
.gs, .fs, .ss => (arch == .i386 or arch == .x86_64) and ctx == .pointer,
// TODO: check that .shared and .local are left uninitialized
- .global, .param, .shared, .local => is_gpu,
+ .param => is_nv,
+ .global, .shared, .local => is_gpu,
.constant => is_gpu and (ctx == .constant),
};