authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-12 16:06:57-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-08-12 16:06:57-07:00
logf988cea825c4b21d0864e7125287b12566079c39
tree1c814af0239ed542df9346be00a5b51b42e00ecd
parent82b0f447211d17a6431307c74a5eb6d36e770697
parent9f1fb45201e59945acc7e48fc394bba4064d52f5
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #21019 from alexrp/target-os-cleanup

`std.Target`: Remove `minix` and `liteos`, rename `glsl450` to `opengl`, and some minor housekeeping

6 files changed, 93 insertions(+), 109 deletions(-)

lib/compiler/aro/aro/target.zig+1-3
...@@ -626,7 +626,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {...@@ -626,7 +626,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
626 .windows => "windows",626 .windows => "windows",
627 .zos => "zos",627 .zos => "zos",
628 .haiku => "haiku",628 .haiku => "haiku",
629 .minix => "minix",
630 .rtems => "rtems",629 .rtems => "rtems",
631 .aix => "aix",630 .aix => "aix",
632 .cuda => "cuda",631 .cuda => "cuda",
...@@ -650,9 +649,8 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {...@@ -650,9 +649,8 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
650 .visionos => "xros",649 .visionos => "xros",
651 .driverkit => "driverkit",650 .driverkit => "driverkit",
652 .shadermodel => "shadermodel",651 .shadermodel => "shadermodel",
653 .liteos => "liteos",
654 .opencl,652 .opencl,
655 .glsl450,653 .opengl,
656 .vulkan,654 .vulkan,
657 .plan9,655 .plan9,
658 .other,656 .other,
lib/std/Target.zig+74-83
...@@ -17,53 +17,60 @@ pub const Os = struct {...@@ -17,53 +17,60 @@ pub const Os = struct {
1717
18 pub const Tag = enum {18 pub const Tag = enum {
19 freestanding,19 freestanding,
20 dragonfly,20 other,
21 freebsd,21
22 contiki,
23 elfiamcu,
22 fuchsia,24 fuchsia,
23 ios,25 hermit,
26
27 aix,
28 haiku,
29 hurd,
24 linux,30 linux,
25 ps3,31 plan9,
26 macos,32 rtems,
33 serenity,
34 zos,
35
36 dragonfly,
37 freebsd,
27 netbsd,38 netbsd,
28 openbsd,39 openbsd,
40
41 driverkit,
42 ios,
43 macos,
44 tvos,
45 visionos,
46 watchos,
47
48 illumos,
29 solaris,49 solaris,
30 uefi,50
31 windows,51 windows,
32 zos,52 uefi,
33 haiku,53
34 minix,54 ps3,
35 rtems,
36 aix,
37 cuda,
38 nvcl,
39 amdhsa,
40 ps4,55 ps4,
41 ps5,56 ps5,
42 elfiamcu,57
43 tvos,
44 watchos,
45 driverkit,
46 visionos,
47 mesa3d,
48 contiki,
49 amdpal,
50 hermit,
51 hurd,
52 wasi,
53 emscripten,58 emscripten,
54 shadermodel,59 wasi,
55 liteos,60
56 serenity,61 amdhsa,
62 amdpal,
63 cuda,
64 mesa3d,
65 nvcl,
57 opencl,66 opencl,
58 glsl450,67 opengl,
68 shadermodel,
59 vulkan,69 vulkan,
60 plan9,
61 illumos,
62 other,
6370
64 // LLVM tags deliberately omitted:71 // LLVM tags deliberately omitted:
65 // - kfreebsd
66 // - darwin72 // - darwin
73 // - kfreebsd
67 // - nacl74 // - nacl
6875
69 pub inline fn isDarwin(tag: Tag) bool {76 pub inline fn isDarwin(tag: Tag) bool {
...@@ -142,7 +149,6 @@ pub const Os = struct {...@@ -142,7 +149,6 @@ pub const Os = struct {
142 .ps3,149 .ps3,
143 .zos,150 .zos,
144 .haiku,151 .haiku,
145 .minix,
146 .rtems,152 .rtems,
147 .aix,153 .aix,
148 .cuda,154 .cuda,
...@@ -159,10 +165,9 @@ pub const Os = struct {...@@ -159,10 +165,9 @@ pub const Os = struct {
159 .emscripten,165 .emscripten,
160 .driverkit,166 .driverkit,
161 .shadermodel,167 .shadermodel,
162 .liteos,
163 .uefi,168 .uefi,
164 .opencl, // TODO: OpenCL versions169 .opencl, // TODO: OpenCL versions
165 .glsl450, // TODO: GLSL versions170 .opengl, // TODO: GLSL versions
166 .vulkan,171 .vulkan,
167 .plan9,172 .plan9,
168 .illumos,173 .illumos,
...@@ -373,7 +378,6 @@ pub const Os = struct {...@@ -373,7 +378,6 @@ pub const Os = struct {
373 .ps3,378 .ps3,
374 .zos,379 .zos,
375 .haiku,380 .haiku,
376 .minix,
377 .rtems,381 .rtems,
378 .aix,382 .aix,
379 .cuda,383 .cuda,
...@@ -390,10 +394,9 @@ pub const Os = struct {...@@ -390,10 +394,9 @@ pub const Os = struct {
390 .emscripten,394 .emscripten,
391 .driverkit,395 .driverkit,
392 .shadermodel,396 .shadermodel,
393 .liteos,
394 .uefi,397 .uefi,
395 .opencl, // TODO: OpenCL versions398 .opencl, // TODO: OpenCL versions
396 .glsl450, // TODO: GLSL versions399 .opengl, // TODO: GLSL versions
397 .vulkan,400 .vulkan,
398 .plan9,401 .plan9,
399 .illumos,402 .illumos,
...@@ -571,7 +574,6 @@ pub const Os = struct {...@@ -571,7 +574,6 @@ pub const Os = struct {
571 .fuchsia,574 .fuchsia,
572 .ps3,575 .ps3,
573 .zos,576 .zos,
574 .minix,
575 .rtems,577 .rtems,
576 .aix,578 .aix,
577 .cuda,579 .cuda,
...@@ -589,10 +591,9 @@ pub const Os = struct {...@@ -589,10 +591,9 @@ pub const Os = struct {
589 .emscripten,591 .emscripten,
590 .driverkit,592 .driverkit,
591 .shadermodel,593 .shadermodel,
592 .liteos,
593 .uefi,594 .uefi,
594 .opencl,595 .opencl,
595 .glsl450,596 .opengl,
596 .vulkan,597 .vulkan,
597 .plan9,598 .plan9,
598 .other,599 .other,
...@@ -676,7 +677,6 @@ pub const Abi = enum {...@@ -676,7 +677,6 @@ pub const Abi = enum {
676 .dragonfly,677 .dragonfly,
677 .ps3,678 .ps3,
678 .zos,679 .zos,
679 .minix,
680 .rtems,680 .rtems,
681 .aix,681 .aix,
682 .cuda,682 .cuda,
...@@ -704,9 +704,8 @@ pub const Abi = enum {...@@ -704,9 +704,8 @@ pub const Abi = enum {
704 .wasi,704 .wasi,
705 .emscripten,705 .emscripten,
706 => .musl,706 => .musl,
707 .liteos => .ohos,707 .opencl,
708 .opencl, // TODO: SPIR-V ABIs with Linkage capability708 .opengl,
709 .glsl450,
710 .vulkan,709 .vulkan,
711 .plan9, // TODO specify abi710 .plan9, // TODO specify abi
712 .macos,711 .macos,
...@@ -1001,17 +1000,22 @@ pub const Cpu = struct {...@@ -1001,17 +1000,22 @@ pub const Cpu = struct {
1001 };1000 };
10021001
1003 pub const Arch = enum {1002 pub const Arch = enum {
1003 amdgcn,
1004 arc,
1004 arm,1005 arm,
1005 armeb,1006 armeb,
1007 thumb,
1008 thumbeb,
1006 aarch64,1009 aarch64,
1007 aarch64_be,1010 aarch64_be,
1008 arc,
1009 avr,1011 avr,
1010 bpfel,1012 bpfel,
1011 bpfeb,1013 bpfeb,
1012 csky,1014 csky,
1013 dxil,1015 dxil,
1014 hexagon,1016 hexagon,
1017 kalimba,
1018 lanai,
1015 loongarch32,1019 loongarch32,
1016 loongarch64,1020 loongarch64,
1017 m68k,1021 m68k,
...@@ -1020,51 +1024,46 @@ pub const Cpu = struct {...@@ -1020,51 +1024,46 @@ pub const Cpu = struct {
1020 mips64,1024 mips64,
1021 mips64el,1025 mips64el,
1022 msp430,1026 msp430,
1027 nvptx,
1028 nvptx64,
1023 powerpc,1029 powerpc,
1024 powerpcle,1030 powerpcle,
1025 powerpc64,1031 powerpc64,
1026 powerpc64le,1032 powerpc64le,
1027 amdgcn,
1028 riscv32,1033 riscv32,
1029 riscv64,1034 riscv64,
1035 s390x,
1030 sparc,1036 sparc,
1031 sparc64,1037 sparc64,
1032 s390x,
1033 thumb,
1034 thumbeb,
1035 x86,
1036 x86_64,
1037 xcore,
1038 xtensa,
1039 nvptx,
1040 nvptx64,
1041 spirv,1038 spirv,
1042 spirv32,1039 spirv32,
1043 spirv64,1040 spirv64,
1044 kalimba,1041 spu_2,
1045 lanai,1042 ve,
1046 wasm32,1043 wasm32,
1047 wasm64,1044 wasm64,
1048 ve,1045 x86,
1049 spu_2,1046 x86_64,
1047 xcore,
1048 xtensa,
10501049
1051 // LLVM tags deliberately omitted:1050 // LLVM tags deliberately omitted:
1052 // - aarch64_321051 // - aarch64_32
1053 // - r600
1054 // - sparcel
1055 // - tce
1056 // - tcele
1057 // - le32
1058 // - le64
1059 // - amdil1052 // - amdil
1060 // - amdil641053 // - amdil64
1054 // - le32
1055 // - le64
1056 // - r600
1061 // - hsail1057 // - hsail
1062 // - hsail641058 // - hsail64
1063 // - spir
1064 // - spir64
1065 // - shave
1066 // - renderscript321059 // - renderscript32
1067 // - renderscript641060 // - renderscript64
1061 // - shave
1062 // - sparcel
1063 // - spir
1064 // - spir64
1065 // - tce
1066 // - tcele
10681067
1069 pub inline fn isX86(arch: Arch) bool {1068 pub inline fn isX86(arch: Arch) bool {
1070 return switch (arch) {1069 return switch (arch) {
...@@ -1539,12 +1538,12 @@ pub const Cpu = struct {...@@ -1539,12 +1538,12 @@ pub const Cpu = struct {
1539 pub fn baseline(arch: Arch) *const Model {1538 pub fn baseline(arch: Arch) *const Model {
1540 return switch (arch) {1539 return switch (arch) {
1541 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,1540 .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline,
1542 .hexagon => &hexagon.cpu.hexagonv60,1541 .hexagon => &hexagon.cpu.hexagonv60, // gcc/clang do not have a generic hexagon model.
1543 .riscv32 => &riscv.cpu.baseline_rv32,1542 .riscv32 => &riscv.cpu.baseline_rv32,
1544 .riscv64 => &riscv.cpu.baseline_rv64,1543 .riscv64 => &riscv.cpu.baseline_rv64,
1545 .x86 => &x86.cpu.pentium4,1544 .x86 => &x86.cpu.pentium4,
1546 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,1545 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
1547 .s390x => &s390x.cpu.arch8,1546 .s390x => &s390x.cpu.arch8, // gcc/clang do not have a generic s390x model.
1548 .sparc => &sparc.cpu.v9, // glibc does not work with 'plain' v8.1547 .sparc => &sparc.cpu.v9, // glibc does not work with 'plain' v8.
1549 .loongarch64 => &loongarch.cpu.loongarch64,1548 .loongarch64 => &loongarch.cpu.loongarch64,
15501549
...@@ -1624,10 +1623,6 @@ pub inline fn isGnuLibC(target: Target) bool {...@@ -1624,10 +1623,6 @@ pub inline fn isGnuLibC(target: Target) bool {
1624 return target.os.tag.isGnuLibC(target.abi);1623 return target.os.tag.isGnuLibC(target.abi);
1625}1624}
16261625
1627pub inline fn supportsNewStackCall(target: Target) bool {
1628 return !target.cpu.arch.isWasm();
1629}
1630
1631pub inline fn isSpirV(target: Target) bool {1626pub inline fn isSpirV(target: Target) bool {
1632 return target.cpu.arch.isSpirV();1627 return target.cpu.arch.isSpirV();
1633}1628}
...@@ -1656,7 +1651,7 @@ pub inline fn hasDynamicLinker(target: Target) bool {...@@ -1656,7 +1651,7 @@ pub inline fn hasDynamicLinker(target: Target) bool {
1656 .windows,1651 .windows,
1657 .emscripten,1652 .emscripten,
1658 .opencl,1653 .opencl,
1659 .glsl450,1654 .opengl,
1660 .vulkan,1655 .vulkan,
1661 .plan9,1656 .plan9,
1662 .other,1657 .other,
...@@ -1824,7 +1819,7 @@ pub const DynamicLinker = struct {...@@ -1824,7 +1819,7 @@ pub const DynamicLinker = struct {
1824 .emscripten,1819 .emscripten,
1825 .wasi,1820 .wasi,
1826 .opencl,1821 .opencl,
1827 .glsl450,1822 .opengl,
1828 .vulkan,1823 .vulkan,
1829 .other,1824 .other,
1830 .plan9,1825 .plan9,
...@@ -1838,7 +1833,6 @@ pub const DynamicLinker = struct {...@@ -1838,7 +1833,6 @@ pub const DynamicLinker = struct {
1838 .fuchsia,1833 .fuchsia,
1839 .ps3,1834 .ps3,
1840 .zos,1835 .zos,
1841 .minix,
1842 .rtems,1836 .rtems,
1843 .aix,1837 .aix,
1844 .cuda,1838 .cuda,
...@@ -1854,7 +1848,6 @@ pub const DynamicLinker = struct {...@@ -1854,7 +1848,6 @@ pub const DynamicLinker = struct {
1854 .hurd,1848 .hurd,
1855 .driverkit,1849 .driverkit,
1856 .shadermodel,1850 .shadermodel,
1857 .liteos,
1858 => none,1851 => none,
1859 };1852 };
1860 }1853 }
...@@ -2139,7 +2132,6 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {...@@ -2139,7 +2132,6 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {
2139 .illumos,2132 .illumos,
2140 .haiku,2133 .haiku,
2141 .fuchsia,2134 .fuchsia,
2142 .minix,
2143 .serenity,2135 .serenity,
2144 => switch (target.cpu.arch) {2136 => switch (target.cpu.arch) {
2145 .msp430 => switch (c_type) {2137 .msp430 => switch (c_type) {
...@@ -2341,10 +2333,9 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {...@@ -2341,10 +2333,9 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {
2341 .contiki,2333 .contiki,
2342 .hermit,2334 .hermit,
2343 .hurd,2335 .hurd,
2344 .glsl450,2336 .opengl,
2345 .driverkit,2337 .driverkit,
2346 .shadermodel,2338 .shadermodel,
2347 .liteos,
2348 => @panic("TODO specify the C integer and float type sizes for this OS"),2339 => @panic("TODO specify the C integer and float type sizes for this OS"),
2349 }2340 }
2350}2341}
lib/std/c.zig+2-2
...@@ -6619,7 +6619,7 @@ pub const Stat = switch (native_os) {...@@ -6619,7 +6619,7 @@ pub const Stat = switch (native_os) {
6619};6619};
66206620
6621pub const pthread_mutex_t = switch (native_os) {6621pub const pthread_mutex_t = switch (native_os) {
6622 .linux, .minix => extern struct {6622 .linux => extern struct {
6623 data: [data_len]u8 align(@alignOf(usize)) = [_]u8{0} ** data_len,6623 data: [data_len]u8 align(@alignOf(usize)) = [_]u8{0} ** data_len,
66246624
6625 const data_len = switch (native_abi) {6625 const data_len = switch (native_abi) {
...@@ -6716,7 +6716,7 @@ pub const pthread_cond_t = switch (native_os) {...@@ -6716,7 +6716,7 @@ pub const pthread_cond_t = switch (native_os) {
6716 magic: u16 = 0x4356,6716 magic: u16 = 0x4356,
6717 data: u64 = 0,6717 data: u64 = 0,
6718 },6718 },
6719 .fuchsia, .minix, .emscripten => extern struct {6719 .fuchsia, .emscripten => extern struct {
6720 data: [48]u8 align(@alignOf(usize)) = [_]u8{0} ** 48,6720 data: [48]u8 align(@alignOf(usize)) = [_]u8{0} ** 48,
6721 },6721 },
6722 else => void,6722 else => void,
src/codegen/llvm.zig+10-15
...@@ -110,7 +110,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -110,7 +110,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
110 .netbsd => "netbsd",110 .netbsd => "netbsd",
111 .openbsd => "openbsd",111 .openbsd => "openbsd",
112 .solaris, .illumos => "solaris",112 .solaris, .illumos => "solaris",
113 .windows => "windows",113 .windows, .uefi => "windows",
114 .zos => "zos",114 .zos => "zos",
115 .haiku => "haiku",115 .haiku => "haiku",
116 .rtems => "rtems",116 .rtems => "rtems",
...@@ -128,21 +128,18 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -128,21 +128,18 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
128 .hurd => "hurd",128 .hurd => "hurd",
129 .wasi => "wasi",129 .wasi => "wasi",
130 .emscripten => "emscripten",130 .emscripten => "emscripten",
131 .uefi => "windows",
132 .macos => "macosx",131 .macos => "macosx",
133 .ios => "ios",132 .ios => "ios",
134 .tvos => "tvos",133 .tvos => "tvos",
135 .watchos => "watchos",134 .watchos => "watchos",
136 .driverkit => "driverkit",135 .driverkit => "driverkit",
137 .shadermodel => "shadermodel",136 .shadermodel => "shadermodel",
138 .liteos => "liteos",
139 .visionos => "xros",137 .visionos => "xros",
140 .serenity => "serenity",138 .serenity => "serenity",
141 .vulkan => "vulkan",139 .vulkan => "vulkan",
142140
143 .glsl450,141 .opengl,
144 .plan9,142 .plan9,
145 .minix,
146 .contiki,143 .contiki,
147 .other,144 .other,
148 => "unknown",145 => "unknown",
...@@ -207,15 +204,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -207,15 +204,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
207204
208pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {205pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
209 return switch (os_tag) {206 return switch (os_tag) {
210 .freestanding,207 .freestanding => .UnknownOS,
211 .other,
212 .opencl,
213 .glsl450,
214 .plan9,
215 .minix,
216 .contiki,
217 => .UnknownOS,
218
219 .windows, .uefi => .Win32,208 .windows, .uefi => .Win32,
220 .dragonfly => .DragonFly,209 .dragonfly => .DragonFly,
221 .freebsd => .FreeBSD,210 .freebsd => .FreeBSD,
...@@ -234,6 +223,7 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {...@@ -234,6 +223,7 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
234 .cuda => .CUDA,223 .cuda => .CUDA,
235 .nvcl => .NVCL,224 .nvcl => .NVCL,
236 .amdhsa => .AMDHSA,225 .amdhsa => .AMDHSA,
226 .opencl => .UnknownOS, // https://llvm.org/docs/SPIRVUsage.html#target-triples
237 .ps4 => .PS4,227 .ps4 => .PS4,
238 .ps5 => .PS5,228 .ps5 => .PS5,
239 .elfiamcu => .ELFIAMCU,229 .elfiamcu => .ELFIAMCU,
...@@ -248,9 +238,14 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {...@@ -248,9 +238,14 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
248 .emscripten => .Emscripten,238 .emscripten => .Emscripten,
249 .driverkit => .DriverKit,239 .driverkit => .DriverKit,
250 .shadermodel => .ShaderModel,240 .shadermodel => .ShaderModel,
251 .liteos => .LiteOS,
252 .vulkan => .Vulkan,241 .vulkan => .Vulkan,
253 .serenity => .Serenity,242 .serenity => .Serenity,
243
244 .opengl,
245 .plan9,
246 .contiki,
247 .other,
248 => .UnknownOS,
254 };249 };
255}250}
256251
src/link/SpirV.zig+4-4
...@@ -85,7 +85,7 @@ pub fn createEmpty(...@@ -85,7 +85,7 @@ pub fn createEmpty(
85 }85 }
8686
87 switch (target.os.tag) {87 switch (target.os.tag) {
88 .opencl, .glsl450, .vulkan => {},88 .opencl, .opengl, .vulkan => {},
89 else => unreachable, // Caught by Compilation.Config.resolve.89 else => unreachable, // Caught by Compilation.Config.resolve.
90 }90 }
9191
...@@ -290,7 +290,7 @@ fn writeCapabilities(spv: *SpvModule, target: std.Target) !void {...@@ -290,7 +290,7 @@ fn writeCapabilities(spv: *SpvModule, target: std.Target) !void {
290 // TODO: Integrate with a hypothetical feature system290 // TODO: Integrate with a hypothetical feature system
291 const caps: []const spec.Capability = switch (target.os.tag) {291 const caps: []const spec.Capability = switch (target.os.tag) {
292 .opencl => &.{ .Kernel, .Addresses, .Int8, .Int16, .Int64, .Float64, .Float16, .Vector16, .GenericPointer },292 .opencl => &.{ .Kernel, .Addresses, .Int8, .Int16, .Int64, .Float64, .Float16, .Vector16, .GenericPointer },
293 .glsl450 => &.{.Shader},293 .opengl => &.{.Shader},
294 .vulkan => &.{ .Shader, .VariablePointersStorageBuffer, .Int8, .Int16, .Int64, .Float64, .Float16 },294 .vulkan => &.{ .Shader, .VariablePointersStorageBuffer, .Int8, .Int16, .Int64, .Float64, .Float16 },
295 else => unreachable, // TODO295 else => unreachable, // TODO
296 };296 };
...@@ -311,13 +311,13 @@ fn writeMemoryModel(spv: *SpvModule, target: std.Target) !void {...@@ -311,13 +311,13 @@ fn writeMemoryModel(spv: *SpvModule, target: std.Target) !void {
311 .spirv64 => spec.AddressingModel.Physical64,311 .spirv64 => spec.AddressingModel.Physical64,
312 else => unreachable, // TODO312 else => unreachable, // TODO
313 },313 },
314 .glsl450, .vulkan => spec.AddressingModel.Logical,314 .opengl, .vulkan => spec.AddressingModel.Logical,
315 else => unreachable, // TODO315 else => unreachable, // TODO
316 };316 };
317317
318 const memory_model: spec.MemoryModel = switch (target.os.tag) {318 const memory_model: spec.MemoryModel = switch (target.os.tag) {
319 .opencl => .OpenCL,319 .opencl => .OpenCL,
320 .glsl450 => .GLSL450,320 .opengl => .GLSL450,
321 .vulkan => .GLSL450,321 .vulkan => .GLSL450,
322 else => unreachable,322 else => unreachable,
323 };323 };
test/llvm_targets.zig+2-2
...@@ -90,10 +90,10 @@ const targets = [_]std.Target.Query{...@@ -90,10 +90,10 @@ const targets = [_]std.Target.Query{
90 .{ .cpu_arch = .sparc64, .os_tag = .freestanding, .abi = .none },90 .{ .cpu_arch = .sparc64, .os_tag = .freestanding, .abi = .none },
91 .{ .cpu_arch = .sparc64, .os_tag = .linux, .abi = .gnu },91 .{ .cpu_arch = .sparc64, .os_tag = .linux, .abi = .gnu },
92 //.{ .cpu_arch = .spirv32, .os_tag = .opencl, .abi = .none },92 //.{ .cpu_arch = .spirv32, .os_tag = .opencl, .abi = .none },
93 //.{ .cpu_arch = .spirv32, .os_tag = .glsl450, .abi = .none },93 //.{ .cpu_arch = .spirv32, .os_tag = .opengl, .abi = .none },
94 //.{ .cpu_arch = .spirv32, .os_tag = .vulkan, .abi = .none },94 //.{ .cpu_arch = .spirv32, .os_tag = .vulkan, .abi = .none },
95 //.{ .cpu_arch = .spirv64, .os_tag = .opencl, .abi = .none },95 //.{ .cpu_arch = .spirv64, .os_tag = .opencl, .abi = .none },
96 //.{ .cpu_arch = .spirv64, .os_tag = .glsl450, .abi = .none },96 //.{ .cpu_arch = .spirv64, .os_tag = .opengl, .abi = .none },
97 //.{ .cpu_arch = .spirv64, .os_tag = .vulkan, .abi = .none },97 //.{ .cpu_arch = .spirv64, .os_tag = .vulkan, .abi = .none },
98 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .none },98 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .none },
99 .{ .cpu_arch = .thumbeb, .os_tag = .freestanding, .abi = .none },99 .{ .cpu_arch = .thumbeb, .os_tag = .freestanding, .abi = .none },