authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-09-20 10:26:49+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-09-23 17:17:25-07:00
logd1901c744c9bf2862f99be837325e0a50365c38b
treefed4532aba4e3c8f21ec3a96a5fa8b58dc89c534
parentb2c53eb0d717989caf66dc8dfc0a7b1afb2607b3

std.Target: Remove Cpu.Arch.dxil and ObjectFormat.dxcontainer.

See: https://devblogs.microsoft.com/directx/directx-adopting-spir-v Since we never hooked up the (experimental) DirectX LLVM backend, we've never actually supported targeting DXIL in Zig. With Microsoft moving away from DXIL, that seems very unlikely to change.

10 files changed, 21 insertions(+), 88 deletions(-)

lib/compiler/aro/aro/target.zig-18
......@@ -482,7 +482,6 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {
482482 .spirv,
483483 .spirv32,
484484 .loongarch32,
485 .dxil,
486485 .xtensa,
487486 => {}, // Already 32 bit
488487
......@@ -509,7 +508,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {
509508 .arc,
510509 .avr,
511510 .csky,
512 .dxil,
513511 .hexagon,
514512 .kalimba,
515513 .lanai,
......@@ -578,7 +576,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
578576 .bpfel => "bpfel",
579577 .bpfeb => "bpfeb",
580578 .csky => "csky",
581 .dxil => "dxil",
582579 .hexagon => "hexagon",
583580 .loongarch32 => "loongarch32",
584581 .loongarch64 => "loongarch64",
......@@ -702,21 +699,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
702699 .cygnus => "cygnus",
703700 .simulator => "simulator",
704701 .macabi => "macabi",
705 .pixel => "pixel",
706 .vertex => "vertex",
707 .geometry => "geometry",
708 .hull => "hull",
709 .domain => "domain",
710 .compute => "compute",
711 .library => "library",
712 .raygeneration => "raygeneration",
713 .intersection => "intersection",
714 .anyhit => "anyhit",
715 .closesthit => "closesthit",
716 .miss => "miss",
717 .callable => "callable",
718 .mesh => "mesh",
719 .amplification => "amplification",
720702 .ohos => "openhos",
721703 };
722704 writer.writeAll(llvm_abi) catch unreachable;
lib/std/Target.zig+20-28
......@@ -673,26 +673,26 @@ pub const Abi = enum {
673673 cygnus,
674674 simulator,
675675 macabi,
676 pixel,
677 vertex,
678 geometry,
679 hull,
680 domain,
681 compute,
682 library,
683 raygeneration,
684 intersection,
685 anyhit,
686 closesthit,
687 miss,
688 callable,
689 mesh,
690 amplification,
691676 ohos,
692677
693678 // LLVM tags deliberately omitted:
694 // - gnuf64
679 // - amplification
680 // - anyhit
681 // - callable
682 // - closesthit
683 // - compute
695684 // - coreclr
685 // - domain
686 // - geometry
687 // - gnuf64
688 // - hull
689 // - intersection
690 // - library
691 // - mesh
692 // - miss
693 // - pixel
694 // - raygeneration
695 // - vertex
696696
697697 pub fn default(arch: Cpu.Arch, os: Os) Abi {
698698 return if (arch.isWasm()) .musl else switch (os.tag) {
......@@ -788,8 +788,6 @@ pub const ObjectFormat = enum {
788788 c,
789789 /// The Common Object File Format used by Windows and UEFI.
790790 coff,
791 /// The DirectX Container format containing either DXIL or DXBC.
792 dxcontainer,
793791 /// The Executable and Linkable Format used by many Unixes.
794792 elf,
795793 /// The Generalized Object File Format used by z/OS.
......@@ -811,11 +809,13 @@ pub const ObjectFormat = enum {
811809 /// The eXtended Common Object File Format used by AIX.
812810 xcoff,
813811
812 // LLVM tags deliberately omitted:
813 // - dxcontainer
814
814815 pub fn fileExt(of: ObjectFormat, arch: Cpu.Arch) [:0]const u8 {
815816 return switch (of) {
816817 .c => ".c",
817818 .coff => ".obj",
818 .dxcontainer => ".dxil",
819819 .elf, .goff, .macho, .wasm, .xcoff => ".o",
820820 .hex => ".ihex",
821821 .nvptx => ".ptx",
......@@ -833,7 +833,6 @@ pub const ObjectFormat = enum {
833833 .uefi, .windows => .coff,
834834 .zos => .goff,
835835 else => switch (arch) {
836 .dxil => .dxcontainer,
837836 .nvptx, .nvptx64 => .nvptx,
838837 .spirv, .spirv32, .spirv64 => .spirv,
839838 .wasm32, .wasm64 => .wasm,
......@@ -873,7 +872,6 @@ pub fn toElfMachine(target: Target) std.elf.EM {
873872 .xcore => .XCORE,
874873 .xtensa => .XTENSA,
875874
876 .dxil,
877875 .nvptx,
878876 .nvptx64,
879877 .spirv,
......@@ -907,7 +905,6 @@ pub fn toCoffMachine(target: Target) std.coff.MachineType {
907905 .bpfel,
908906 .bpfeb,
909907 .csky,
910 .dxil,
911908 .hexagon,
912909 .kalimba,
913910 .lanai,
......@@ -1133,7 +1130,6 @@ pub const Cpu = struct {
11331130 bpfel,
11341131 bpfeb,
11351132 csky,
1136 dxil,
11371133 hexagon,
11381134 kalimba,
11391135 lanai,
......@@ -1172,6 +1168,7 @@ pub const Cpu = struct {
11721168 // - aarch64_32
11731169 // - amdil
11741170 // - amdil64
1171 // - dxil
11751172 // - le32
11761173 // - le64
11771174 // - r600
......@@ -1344,7 +1341,6 @@ pub const Cpu = struct {
13441341 .spirv,
13451342 .spirv32,
13461343 .spirv64,
1347 .dxil,
13481344 .loongarch32,
13491345 .loongarch64,
13501346 .arc,
......@@ -1817,7 +1813,6 @@ pub const DynamicLinker = struct {
18171813 .kalimba,
18181814 .lanai,
18191815 .ve,
1820 .dxil,
18211816 .loongarch32,
18221817 .xtensa,
18231818 => none,
......@@ -1913,7 +1908,6 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
19131908 .sparc,
19141909 .spirv32,
19151910 .loongarch32,
1916 .dxil,
19171911 .xtensa,
19181912 => 32,
19191913
......@@ -2415,7 +2409,6 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 {
24152409 .csky,
24162410 .x86,
24172411 .xcore,
2418 .dxil,
24192412 .loongarch32,
24202413 .kalimba,
24212414 .spu_2,
......@@ -2519,7 +2512,6 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 {
25192512
25202513 .csky,
25212514 .xcore,
2522 .dxil,
25232515 .loongarch32,
25242516 .kalimba,
25252517 .spu_2,
lib/std/zig.zig-1
......@@ -233,7 +233,6 @@ pub fn binNameAlloc(allocator: Allocator, options: BinNameOptions) error{OutOfMe
233233 }),
234234 },
235235 .nvptx => return std.fmt.allocPrint(allocator, "{s}.ptx", .{root_name}),
236 .dxcontainer => return std.fmt.allocPrint(allocator, "{s}.dxil", .{root_name}),
237236 }
238237}
239238
lib/std/zig/LibCDirs.zig-17
......@@ -254,23 +254,6 @@ fn libCGenericName(target: std.Target) [:0]const u8 {
254254 .simulator,
255255 .macabi,
256256 => unreachable,
257
258 .pixel,
259 .vertex,
260 .geometry,
261 .hull,
262 .domain,
263 .compute,
264 .library,
265 .raygeneration,
266 .intersection,
267 .anyhit,
268 .closesthit,
269 .miss,
270 .callable,
271 .mesh,
272 .amplification,
273 => unreachable,
274257 }
275258}
276259
src/Compilation/Config.zig+1-1
......@@ -440,7 +440,7 @@ pub fn resolve(options: Options) ResolveError!Config {
440440 .windows, .uefi => .code_view,
441441 else => .{ .dwarf = .@"32" },
442442 },
443 .spirv, .nvptx, .dxcontainer, .hex, .raw, .plan9 => .strip,
443 .spirv, .nvptx, .hex, .raw, .plan9 => .strip,
444444 };
445445 };
446446
src/Type.zig-1
......@@ -1703,7 +1703,6 @@ pub fn maxIntAlignment(target: std.Target, use_llvm: bool) u16 {
17031703 .spirv32,
17041704 .ve,
17051705 .spirv64,
1706 .dxil,
17071706 .loongarch32,
17081707 .loongarch64,
17091708 .xtensa,
src/Zcu.zig-1
......@@ -3010,7 +3010,6 @@ pub fn atomicPtrAlignment(
30103010 .wasm32,
30113011 .csky,
30123012 .spirv32,
3013 .dxil,
30143013 .loongarch32,
30153014 .xtensa,
30163015 => 32,
src/codegen/llvm.zig-18
......@@ -51,7 +51,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
5151 .bpfel => "bpfel",
5252 .bpfeb => "bpfeb",
5353 .csky => "csky",
54 .dxil => "dxil",
5554 .hexagon => "hexagon",
5655 .loongarch32 => "loongarch32",
5756 .loongarch64 => "loongarch64",
......@@ -182,21 +181,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
182181 .cygnus => "cygnus",
183182 .simulator => "simulator",
184183 .macabi => "macabi",
185 .pixel => "pixel",
186 .vertex => "vertex",
187 .geometry => "geometry",
188 .hull => "hull",
189 .domain => "domain",
190 .compute => "compute",
191 .library => "library",
192 .raygeneration => "raygeneration",
193 .intersection => "intersection",
194 .anyhit => "anyhit",
195 .closesthit => "closesthit",
196 .miss => "miss",
197 .callable => "callable",
198 .mesh => "mesh",
199 .amplification => "amplification",
200184 .ohos => "ohos",
201185 };
202186 try llvm_triple.appendSlice(llvm_abi);
......@@ -263,7 +247,6 @@ pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
263247 .bpfel => .bpfel,
264248 .bpfeb => .bpfeb,
265249 .csky => .csky,
266 .dxil => .dxil,
267250 .hexagon => .hexagon,
268251 .loongarch32 => .loongarch32,
269252 .loongarch64 => .loongarch64,
......@@ -12726,7 +12709,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
1272612709 .spirv,
1272712710 .spirv32,
1272812711 .spirv64,
12729 .dxil,
1273012712 => {},
1273112713
1273212714 // LLVM does does not have a backend for these.
src/link.zig-1
......@@ -932,7 +932,6 @@ pub const File = struct {
932932 .xcoff => @panic("TODO implement xcoff object format"),
933933 .hex => @panic("TODO implement hex object format"),
934934 .raw => @panic("TODO implement raw object format"),
935 .dxcontainer => @panic("TODO implement dxcontainer object format"),
936935 };
937936 }
938937
src/target.zig-2
......@@ -104,7 +104,6 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
104104 => return false,
105105
106106 .coff,
107 .dxcontainer,
108107 .elf,
109108 .goff,
110109 .hex,
......@@ -161,7 +160,6 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
161160 => true,
162161
163162 // An LLVM backend exists but we don't currently support using it.
164 .dxil,
165163 .spirv,
166164 .spirv32,
167165 .spirv64,