@@ -70,6 +70,8 @@ pub const Os = struct {
7070 opengl ,
7171 vulkan ,
7272
73+ tios ,
74+
7375 // LLVM tags deliberately omitted:
7476 // - bridgeos
7577 // - cheriotrtos
@@ -214,6 +216,8 @@ pub const Os = struct {
214216 .opencl ,
215217 .opengl ,
216218 .vulkan ,
219+
220+ .tios ,
217221 = > .semver ,
218222
219223 .hurd = > .hurd ,
@@ -676,6 +680,12 @@ pub const Os = struct {
676680 .max = .{ .major = 4 , .minor = 6 , .patch = 0 },
677681 },
678682 },
683+ .tios = > .{
684+ .semver = .{
685+ .min = .{ .major = 5 , .minor = 0 , .patch = 0 },
686+ .max = .{ .major = 5 , .minor = 8 , .patch = 3 },
687+ },
688+ },
679689 .vulkan = > .{
680690 .semver = .{
681691 .min = .{ .major = 1 , .minor = 2 , .patch = 0 },
@@ -740,6 +750,7 @@ pub const arm = @import("Target/arm.zig");
740750pub const avr = @import ("Target/avr.zig" );
741751pub const bpf = @import ("Target/bpf.zig" );
742752pub const csky = @import ("Target/csky.zig" );
753+ pub const ez80 = @import ("Target/ez80.zig" );
743754pub const hexagon = @import ("Target/hexagon.zig" );
744755pub const hppa = @import ("Target/generic.zig" );
745756pub const kalimba = @import ("Target/generic.zig" );
@@ -950,6 +961,7 @@ pub const Abi = enum {
950961 .opencl ,
951962 .opengl ,
952963 .vulkan ,
964+ .tios ,
953965 = > .none ,
954966 };
955967 }
@@ -1106,6 +1118,7 @@ pub fn toElfMachine(target: *const Target) std.elf.EM {
11061118 .xcore = > .XCORE ,
11071119 .xtensa , .xtensaeb = > .XTENSA ,
11081120
1121+ .ez80 ,
11091122 .nvptx ,
11101123 .nvptx64 ,
11111124 .spirv32 ,
@@ -1134,7 +1147,6 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE {
11341147 .x86 = > .I386 ,
11351148 .x86_64 = > .AMD64 ,
11361149
1137- .aarch64_be ,
11381150 .amdgcn ,
11391151 .arc ,
11401152 .arceb ,
@@ -1143,6 +1155,7 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE {
11431155 .bpfeb ,
11441156 .bpfel ,
11451157 .csky ,
1158+ .ez80 ,
11461159 .hexagon ,
11471160 .hppa ,
11481161 .hppa64 ,
@@ -1355,6 +1368,7 @@ pub const Cpu = struct {
13551368 bpfeb ,
13561369 bpfel ,
13571370 csky ,
1371+ ez80 ,
13581372 hexagon ,
13591373 hppa ,
13601374 hppa64 ,
@@ -1430,6 +1444,7 @@ pub const Cpu = struct {
14301444 avr ,
14311445 bpf ,
14321446 csky ,
1447+ ez80 ,
14331448 hexagon ,
14341449 hppa ,
14351450 kalimba ,
@@ -1465,6 +1480,7 @@ pub const Cpu = struct {
14651480 .avr = > .avr ,
14661481 .bpfeb , .bpfel = > .bpf ,
14671482 .csky = > .csky ,
1483+ .ez80 = > .ez80 ,
14681484 .hexagon = > .hexagon ,
14691485 .hppa , .hppa64 = > .hppa ,
14701486 .kalimba = > .kalimba ,
@@ -1691,6 +1707,14 @@ pub const Cpu = struct {
16911707 .x86_64 ,
16921708 .xcore ,
16931709 .xtensa ,
1710+ // GPU bitness is opaque. For now, assume little endian.
1711+ .spirv32 ,
1712+ .spirv64 ,
1713+ .loongarch32 ,
1714+ .loongarch64 ,
1715+ .arc ,
1716+ .propeller ,
1717+ .ez80 ,
16941718 = > .little ,
16951719
16961720 .aarch64_be ,
@@ -1951,6 +1975,10 @@ pub const Cpu = struct {
19511975 .spirv_fragment ,
19521976 .spirv_vertex ,
19531977 = > &.{ .spirv32 , .spirv64 },
1978+
1979+ .ez80_sysv ,
1980+ .ez80_tiflags ,
1981+ = > &.{.ez80 },
19541982 };
19551983 }
19561984 };
@@ -2224,6 +2252,7 @@ pub fn requiresLibC(target: *const Target) bool {
22242252 .plan9 ,
22252253 .other ,
22262254 .@"3ds" ,
2255+ .tios ,
22272256 = > false ,
22282257 };
22292258}
@@ -2385,6 +2414,8 @@ pub const DynamicLinker = struct {
23852414 .ps4 ,
23862415 .ps5 ,
23872416 .vita ,
2417+
2418+ .tios ,
23882419 = > .none ,
23892420 };
23902421 }
@@ -2802,6 +2833,8 @@ pub const DynamicLinker = struct {
28022833 .opencl ,
28032834 .opengl ,
28042835 .vulkan ,
2836+
2837+ .tios ,
28052838 = > none ,
28062839
28072840 // TODO go over each item in this list and either move it to the above list, or
@@ -2835,6 +2868,9 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 {
28352868 .msp430 ,
28362869 = > 16 ,
28372870
2871+ .ez80 ,
2872+ = > 24 ,
2873+
28382874 .arc ,
28392875 .arceb ,
28402876 .arm ,
@@ -2902,6 +2938,8 @@ pub fn ptrBitWidth(target: *const Target) u16 {
29022938pub fn stackAlignment (target : * const Target ) u16 {
29032939 // Overrides for when the stack alignment is not equal to the pointer width.
29042940 switch (target .cpu .arch ) {
2941+ .ez80 ,
2942+ = > return 1 ,
29052943 .m68k ,
29062944 = > return 2 ,
29072945 .amdgcn ,
@@ -2981,6 +3019,7 @@ pub fn cCharSignedness(target: *const Target) std.builtin.Signedness {
29813019 .arc ,
29823020 .arceb ,
29833021 .csky ,
3022+ .ez80 ,
29843023 .hexagon ,
29853024 .msp430 ,
29863025 .powerpc ,
@@ -3354,6 +3393,13 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
33543393 .long , .ulong = > return 64 ,
33553394 .longlong , .ulonglong , .double , .longdouble = > return 64 ,
33563395 },
3396+ .tios = > switch (c_type ) {
3397+ .char = > return 8 ,
3398+ .short , .ushort = > return 16 ,
3399+ .int , .uint = > return 24 ,
3400+ .long , .ulong , .float , .double = > return 32 ,
3401+ .longlong , .ulonglong , .longdouble = > return 64 ,
3402+ },
33573403
33583404 .ps3 ,
33593405 .contiki ,
@@ -3366,7 +3412,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
33663412pub fn cTypeAlignment (target : * const Target , c_type : CType ) u16 {
33673413 // Overrides for unusual alignments
33683414 switch (target .cpu .arch ) {
3369- .avr = > return 1 ,
3415+ .avr , .ez80 = > return 1 ,
33703416 .x86 = > switch (target .os .tag ) {
33713417 .windows , .uefi = > switch (c_type ) {
33723418 .longlong , .ulonglong , .double = > return 8 ,
@@ -3403,6 +3449,8 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {
34033449 return @min (
34043450 std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
34053451 @as (u16 , switch (target .cpu .arch ) {
3452+ .ez80 = > 1 ,
3453+
34063454 .msp430 ,
34073455 = > 2 ,
34083456
@@ -3479,7 +3527,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
34793527 .longdouble = > return 4 ,
34803528 else = > {},
34813529 },
3482- .avr = > return 1 ,
3530+ .avr , .ez80 = > return 1 ,
34833531 .x86 = > switch (target .os .tag ) {
34843532 .windows , .uefi = > switch (c_type ) {
34853533 .longdouble = > switch (target .abi ) {
@@ -3511,6 +3559,8 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
35113559 return @min (
35123560 std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
35133561 @as (u16 , switch (target .cpu .arch ) {
3562+ .ez80 = > 1 ,
3563+
35143564 .msp430 = > 2 ,
35153565
35163566 .arc ,
@@ -3581,7 +3631,9 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
35813631
35823632pub fn cMaxIntAlignment (target : * const Target ) u16 {
35833633 return switch (target .cpu .arch ) {
3584- .avr = > 1 ,
3634+ .avr ,
3635+ .ez80 ,
3636+ = > 1 ,
35853637
35863638 .msp430 = > 2 ,
35873639
@@ -3717,6 +3769,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention
37173769 .amdgcn = > .{ .amdgcn_device = .{} },
37183770 .nvptx , .nvptx64 = > .nvptx_device ,
37193771 .spirv32 , .spirv64 = > .spirv_device ,
3772+ .ez80 = > .ez80_sysv ,
37203773 };
37213774}
37223775
0 commit comments