authorgravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-08-21 17:52:03-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-22 12:45:29-07:00
log803a1025bbfb8757589068ae29f6f2fc57a4f566
treed98b099c1e4f956a0fe86ce0bd8ebb72b9ded1e0
parent29051a0674800881957479c423a1feb043391671

Targets: add SPU Mark II architecture


3 files changed, 12 insertions(+), 3 deletions(-)

lib/std/elf.zig+3
...@@ -976,6 +976,9 @@ pub const EM = extern enum(u16) {...@@ -976,6 +976,9 @@ pub const EM = extern enum(u16) {
976 /// MIPS RS3000 Little-endian976 /// MIPS RS3000 Little-endian
977 _MIPS_RS3_LE = 10,977 _MIPS_RS3_LE = 10,
978978
979 /// SPU Mark II
980 _SPU_2 = 13,
981
979 /// Hewlett-Packard PA-RISC982 /// Hewlett-Packard PA-RISC
980 _PARISC = 15,983 _PARISC = 15,
981984
lib/std/target.zig+7-1
...@@ -663,6 +663,8 @@ pub const Target = struct {...@@ -663,6 +663,8 @@ pub const Target = struct {
663 renderscript32,663 renderscript32,
664 renderscript64,664 renderscript64,
665 ve,665 ve,
666 // Non-LLVM targets go here
667 spu_2,
666668
667 pub fn isARM(arch: Arch) bool {669 pub fn isARM(arch: Arch) bool {
668 return switch (arch) {670 return switch (arch) {
...@@ -761,6 +763,7 @@ pub const Target = struct {...@@ -761,6 +763,7 @@ pub const Target = struct {
761 .sparcv9 => ._SPARCV9,763 .sparcv9 => ._SPARCV9,
762 .s390x => ._S390,764 .s390x => ._S390,
763 .ve => ._NONE,765 .ve => ._NONE,
766 .spu_2 => ._SPU_2,
764 };767 };
765 }768 }
766769
...@@ -803,6 +806,7 @@ pub const Target = struct {...@@ -803,6 +806,7 @@ pub const Target = struct {
803 .renderscript64,806 .renderscript64,
804 .shave,807 .shave,
805 .ve,808 .ve,
809 .spu_2,
806 => .Little,810 => .Little,
807811
808 .arc,812 .arc,
...@@ -827,6 +831,7 @@ pub const Target = struct {...@@ -827,6 +831,7 @@ pub const Target = struct {
827 switch (arch) {831 switch (arch) {
828 .avr,832 .avr,
829 .msp430,833 .msp430,
834 .spu_2,
830 => return 16,835 => return 16,
831836
832 .arc,837 .arc,
...@@ -1317,12 +1322,13 @@ pub const Target = struct {...@@ -1317,12 +1322,13 @@ pub const Target = struct {
1317 .bpfeb,1322 .bpfeb,
1318 .nvptx,1323 .nvptx,
1319 .nvptx64,1324 .nvptx64,
1325 .spu_2,
1326 .avr,
1320 => return result,1327 => return result,
13211328
1322 // TODO go over each item in this list and either move it to the above list, or1329 // TODO go over each item in this list and either move it to the above list, or
1323 // implement the standard dynamic linker path code for it.1330 // implement the standard dynamic linker path code for it.
1324 .arc,1331 .arc,
1325 .avr,
1326 .hexagon,1332 .hexagon,
1327 .msp430,1333 .msp430,
1328 .r600,1334 .r600,
src-self-hosted/link/Elf.zig+2-2
...@@ -249,7 +249,7 @@ fn openFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf {...@@ -249,7 +249,7 @@ fn openFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf {
249 .allocator = allocator,249 .allocator = allocator,
250 },250 },
251 .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) {251 .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) {
252 32 => .p32,252 16, 32 => .p32,
253 64 => .p64,253 64 => .p64,
254 else => return error.UnsupportedELFArchitecture,254 else => return error.UnsupportedELFArchitecture,
255 },255 },
...@@ -278,7 +278,7 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf...@@ -278,7 +278,7 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf
278 .file = file,278 .file = file,
279 },279 },
280 .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) {280 .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) {
281 32 => .p32,281 16, 32 => .p32,
282 64 => .p64,282 64 => .p64,
283 else => return error.UnsupportedELFArchitecture,283 else => return error.UnsupportedELFArchitecture,
284 },284 },