@@ -70,6 +70,8 @@ pub const Os = struct {
7070 opengl ,
7171 vulkan ,
7272
73+ tios ,
74+
7375 // LLVM tags deliberately omitted:
7476 // - bridgeos
7577 // - darwin
@@ -213,6 +215,8 @@ pub const Os = struct {
213215 .opencl ,
214216 .opengl ,
215217 .vulkan ,
218+
219+ .tios ,
216220 = > .semver ,
217221
218222 .hurd = > .hurd ,
@@ -675,6 +679,12 @@ pub const Os = struct {
675679 .max = .{ .major = 4 , .minor = 6 , .patch = 0 },
676680 },
677681 },
682+ .tios = > .{
683+ .semver = .{
684+ .min = .{ .major = 5 , .minor = 0 , .patch = 0 },
685+ .max = .{ .major = 5 , .minor = 8 , .patch = 3 },
686+ },
687+ },
678688 .vulkan = > .{
679689 .semver = .{
680690 .min = .{ .major = 1 , .minor = 2 , .patch = 0 },
@@ -738,6 +748,7 @@ pub const arm = @import("Target/arm.zig");
738748pub const avr = @import ("Target/avr.zig" );
739749pub const bpf = @import ("Target/bpf.zig" );
740750pub const csky = @import ("Target/csky.zig" );
751+ pub const ez80 = @import ("Target/ez80.zig" );
741752pub const hexagon = @import ("Target/hexagon.zig" );
742753pub const kalimba = @import ("Target/generic.zig" );
743754pub const lanai = @import ("Target/lanai.zig" );
@@ -920,6 +931,7 @@ pub const Abi = enum {
920931 .opencl ,
921932 .opengl ,
922933 .vulkan ,
934+ .tios ,
923935 = > .none ,
924936 };
925937 }
@@ -1072,6 +1084,7 @@ pub fn toElfMachine(target: *const Target) std.elf.EM {
10721084 .xcore = > .XCORE ,
10731085 .xtensa = > .XTENSA ,
10741086
1087+ .ez80 ,
10751088 .nvptx ,
10761089 .nvptx64 ,
10771090 .spirv32 ,
@@ -1094,6 +1107,7 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE {
10941107 .x86 = > .I386 ,
10951108 .x86_64 = > .AMD64 ,
10961109
1110+ .ez80 ,
10971111 .amdgcn ,
10981112 .arc ,
10991113 .armeb ,
@@ -1312,6 +1326,7 @@ pub const Cpu = struct {
13121326 bpfel ,
13131327 bpfeb ,
13141328 csky ,
1329+ ez80 ,
13151330 hexagon ,
13161331 kalimba ,
13171332 lanai ,
@@ -1379,6 +1394,7 @@ pub const Cpu = struct {
13791394 avr ,
13801395 bpf ,
13811396 csky ,
1397+ ez80 ,
13821398 hexagon ,
13831399 kalimba ,
13841400 lanai ,
@@ -1410,6 +1426,7 @@ pub const Cpu = struct {
14101426 .avr = > .avr ,
14111427 .bpfel , .bpfeb = > .bpf ,
14121428 .csky = > .csky ,
1429+ .ez80 = > .ez80 ,
14131430 .hexagon = > .hexagon ,
14141431 .kalimba = > .kalimba ,
14151432 .lanai = > .lanai ,
@@ -1601,6 +1618,7 @@ pub const Cpu = struct {
16011618 .loongarch64 ,
16021619 .arc ,
16031620 .propeller ,
1621+ .ez80 ,
16041622 = > .little ,
16051623
16061624 .armeb ,
@@ -1827,6 +1845,10 @@ pub const Cpu = struct {
18271845 .spirv_fragment ,
18281846 .spirv_vertex ,
18291847 = > &.{ .spirv32 , .spirv64 },
1848+
1849+ .ez80_sysv ,
1850+ .ez80_tiflags ,
1851+ = > &.{.ez80 },
18301852 };
18311853 }
18321854 };
@@ -2100,6 +2122,7 @@ pub fn requiresLibC(target: *const Target) bool {
21002122 .plan9 ,
21012123 .other ,
21022124 .@"3ds" ,
2125+ .tios ,
21032126 = > false ,
21042127 };
21052128}
@@ -2246,6 +2269,8 @@ pub const DynamicLinker = struct {
22462269 .ps4 ,
22472270 .ps5 ,
22482271 .vita ,
2272+
2273+ .tios ,
22492274 = > .none ,
22502275 };
22512276 }
@@ -2630,6 +2655,8 @@ pub const DynamicLinker = struct {
26302655 .opencl ,
26312656 .opengl ,
26322657 .vulkan ,
2658+
2659+ .tios ,
26332660 = > none ,
26342661
26352662 // TODO go over each item in this list and either move it to the above list, or
@@ -2663,6 +2690,9 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 {
26632690 .msp430 ,
26642691 = > 16 ,
26652692
2693+ .ez80 ,
2694+ = > 24 ,
2695+
26662696 .arc ,
26672697 .arm ,
26682698 .armeb ,
@@ -2721,6 +2751,8 @@ pub fn ptrBitWidth(target: *const Target) u16 {
27212751pub fn stackAlignment (target : * const Target ) u16 {
27222752 // Overrides for when the stack alignment is not equal to the pointer width.
27232753 switch (target .cpu .arch ) {
2754+ .ez80 ,
2755+ = > return 1 ,
27242756 .m68k ,
27252757 = > return 2 ,
27262758 .amdgcn ,
@@ -2780,6 +2812,7 @@ pub fn cCharSignedness(target: *const Target) std.builtin.Signedness {
27802812 .aarch64_be ,
27812813 .arc ,
27822814 .csky ,
2815+ .ez80 ,
27832816 .hexagon ,
27842817 .msp430 ,
27852818 .powerpc ,
@@ -3160,6 +3193,13 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
31603193 .long , .ulong = > return 64 ,
31613194 .longlong , .ulonglong , .double , .longdouble = > return 64 ,
31623195 },
3196+ .tios = > switch (c_type ) {
3197+ .char = > return 8 ,
3198+ .short , .ushort = > return 16 ,
3199+ .int , .uint = > return 24 ,
3200+ .long , .ulong , .float , .double = > return 32 ,
3201+ .longlong , .ulonglong , .longdouble = > return 64 ,
3202+ },
31633203
31643204 .ps3 ,
31653205 .contiki ,
@@ -3172,7 +3212,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
31723212pub fn cTypeAlignment (target : * const Target , c_type : CType ) u16 {
31733213 // Overrides for unusual alignments
31743214 switch (target .cpu .arch ) {
3175- .avr = > return 1 ,
3215+ .avr , .ez80 = > return 1 ,
31763216 .x86 = > switch (target .os .tag ) {
31773217 .windows , .uefi = > switch (c_type ) {
31783218 .longlong , .ulonglong , .double = > return 8 ,
@@ -3209,6 +3249,8 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {
32093249 return @min (
32103250 std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
32113251 @as (u16 , switch (target .cpu .arch ) {
3252+ .ez80 = > 1 ,
3253+
32123254 .msp430 ,
32133255 = > 2 ,
32143256
@@ -3276,7 +3318,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
32763318 .longdouble = > return 4 ,
32773319 else = > {},
32783320 },
3279- .avr = > return 1 ,
3321+ .avr , .ez80 = > return 1 ,
32803322 .x86 = > switch (target .os .tag ) {
32813323 .windows , .uefi = > switch (c_type ) {
32823324 .longdouble = > switch (target .abi ) {
@@ -3308,6 +3350,8 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
33083350 return @min (
33093351 std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
33103352 @as (u16 , switch (target .cpu .arch ) {
3353+ .ez80 = > 1 ,
3354+
33113355 .msp430 = > 2 ,
33123356
33133357 .csky ,
@@ -3369,7 +3413,9 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
33693413
33703414pub fn cMaxIntAlignment (target : * const Target ) u16 {
33713415 return switch (target .cpu .arch ) {
3372- .avr = > 1 ,
3416+ .avr ,
3417+ .ez80 ,
3418+ = > 1 ,
33733419
33743420 .msp430 = > 2 ,
33753421
@@ -3493,6 +3539,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention
34933539 .amdgcn = > .{ .amdgcn_device = .{} },
34943540 .nvptx , .nvptx64 = > .nvptx_device ,
34953541 .spirv32 , .spirv64 = > .spirv_device ,
3542+ .ez80 = > .ez80_sysv ,
34963543 };
34973544}
34983545
0 commit comments