| author | |
| committer | |
| log | 3392de87dcf516ed2e3fd1904372195bdc75c0eb |
| tree | b87b51283d6a78c708de7a9ee75b4acabfcf0d24 |
| parent | 5859d8458f919676be804835aaeb3ed844a67542 |
| signature | Commit is signed but in an unrecognized format. |
2 files changed, 12 insertions(+), 2 deletions(-)
src/Sema.zig+4-2| ... | ... | @@ -30303,13 +30303,15 @@ pub fn analyzeAddrspace( |
| 30303 | 30303 | const address_space = addrspace_tv.val.toEnum(std.builtin.AddressSpace); |
| 30304 | 30304 | const target = sema.mod.getTarget(); |
| 30305 | 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 | 30309 | const supported = switch (address_space) { |
| 30309 | 30310 | .generic => true, |
| 30310 | 30311 | .gs, .fs, .ss => (arch == .i386 or arch == .x86_64) and ctx == .pointer, |
| 30311 | 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 | 30315 | .constant => is_gpu and (ctx == .constant), |
| 30314 | 30316 | }; |
| 30315 | 30317 |
src/codegen/llvm.zig+8| ... | ... | @@ -2659,6 +2659,14 @@ pub const DeclGen = struct { |
| 2659 | 2659 | .local => llvm.address_space.nvptx.local, |
| 2660 | 2660 | else => unreachable, |
| 2661 | 2661 | }, |
| 2662 | .amdgcn => switch (address_space) { | |
| 2663 | .generic => llvm.address_space.flat, | |
| 2664 | .global => llvm.address_space.amdgpu.global, | |
| 2665 | .constant => llvm.address_space.amdgpu.constant, | |
| 2666 | .shared => llvm.address_space.amdgpu.local, | |
| 2667 | .local => llvm.address_space.amdgpu.private, | |
| 2668 | else => unreachable, | |
| 2669 | }. | |
| 2662 | 2670 | else => switch (address_space) { |
| 2663 | 2671 | .generic => llvm.address_space.default, |
| 2664 | 2672 | else => unreachable, |