| ... | @@ -30303,13 +30303,15 @@ pub fn analyzeAddrspace( | ... | @@ -30303,13 +30303,15 @@ pub fn analyzeAddrspace( |
| 30303 | const address_space = addrspace_tv.val.toEnum(std.builtin.AddressSpace); | 30303 | const address_space = addrspace_tv.val.toEnum(std.builtin.AddressSpace); |
| 30304 | const target = sema.mod.getTarget(); | 30304 | const target = sema.mod.getTarget(); |
| 30305 | const arch = target.cpu.arch; | 30305 | const arch = target.cpu.arch; |
| 30306 | const is_gpu = arch == .nvptx or arch == .nvptx64; | 30306 | const is_nv = arch == .nvptx or arch == .nvptx64; |
| | 30307 | const is_gpu = is_nv or arch == .amdgcn; |
| 30307 | | 30308 | |
| 30308 | const supported = switch (address_space) { | 30309 | const supported = switch (address_space) { |
| 30309 | .generic => true, | 30310 | .generic => true, |
| 30310 | .gs, .fs, .ss => (arch == .i386 or arch == .x86_64) and ctx == .pointer, | 30311 | .gs, .fs, .ss => (arch == .i386 or arch == .x86_64) and ctx == .pointer, |
| 30311 | // TODO: check that .shared and .local are left uninitialized | 30312 | // TODO: check that .shared and .local are left uninitialized |
| 30312 | .global, .param, .shared, .local => is_gpu, | 30313 | .param => is_nv, |
| | 30314 | .global, .shared, .local => is_gpu, |
| 30313 | .constant => is_gpu and (ctx == .constant), | 30315 | .constant => is_gpu and (ctx == .constant), |
| 30314 | }; | 30316 | }; |
| 30315 | | 30317 | |