| author | |
| committer | |
| log | 6dc1fafe9882bdfb063c9bc02149c4a97fcaa2b5 |
| tree | 60c6e7b4d5ac2812733e87d97c67a72e142f0aa2 |
| parent | 17de4a88e9d494cfd7e07ab5277b5e335a2dc9e3 |
| signature |
This adds a general target for SPIR-V compilation. Previously there was not
any target machine defined for SPIR-V.
TODO is to reword the features for this target. We don't really need the full
list of capabilities in the features, we should only put a few features here
which we can actually use during code generation.2 files changed, 10 insertions(+), 0 deletions(-)
lib/std/target.zig+2| ... | ... | @@ -1329,6 +1329,7 @@ pub const Target = struct { |
| 1329 | 1329 | .amdgcn => comptime allCpusFromDecls(amdgpu.cpu), |
| 1330 | 1330 | .riscv32, .riscv64 => comptime allCpusFromDecls(riscv.cpu), |
| 1331 | 1331 | .sparc, .sparc64, .sparcel => comptime allCpusFromDecls(sparc.cpu), |
| 1332 | .spirv32, .spirv64 => comptime allCpusFromDecls(spirv.cpu), | |
| 1332 | 1333 | .s390x => comptime allCpusFromDecls(s390x.cpu), |
| 1333 | 1334 | .x86, .x86_64 => comptime allCpusFromDecls(x86.cpu), |
| 1334 | 1335 | .xtensa => comptime allCpusFromDecls(xtensa.cpu), |
| ... | ... | @@ -1392,6 +1393,7 @@ pub const Target = struct { |
| 1392 | 1393 | .amdgcn => &amdgpu.cpu.generic, |
| 1393 | 1394 | .riscv32 => &riscv.cpu.generic_rv32, |
| 1394 | 1395 | .riscv64 => &riscv.cpu.generic_rv64, |
| 1396 | .spirv32, .spirv64 => &spirv.cpu.generic, | |
| 1395 | 1397 | .sparc, .sparcel => &sparc.cpu.generic, |
| 1396 | 1398 | .sparc64 => &sparc.cpu.v9, // 64-bit SPARC needs v9 as the baseline |
| 1397 | 1399 | .s390x => &s390x.cpu.generic, |
lib/std/target/spirv.zig+8| ... | ... | @@ -2081,3 +2081,11 @@ pub const all_features = blk: { |
| 2081 | 2081 | } |
| 2082 | 2082 | break :blk result; |
| 2083 | 2083 | }; |
| 2084 | ||
| 2085 | pub const cpu = struct { | |
| 2086 | pub const generic = CpuModel{ | |
| 2087 | .name = "generic", | |
| 2088 | .llvm_name = "generic", | |
| 2089 | .features = featureSet(&[_]Feature{}), | |
| 2090 | }; | |
| 2091 | }; |