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) {
976976 /// MIPS RS3000 Little-endian
977977 _MIPS_RS3_LE = 10,
978978
979 /// SPU Mark II
980 _SPU_2 = 13,
981
979982 /// Hewlett-Packard PA-RISC
980983 _PARISC = 15,
981984
lib/std/target.zig+7-1
......@@ -663,6 +663,8 @@ pub const Target = struct {
663663 renderscript32,
664664 renderscript64,
665665 ve,
666 // Non-LLVM targets go here
667 spu_2,
666668
667669 pub fn isARM(arch: Arch) bool {
668670 return switch (arch) {
......@@ -761,6 +763,7 @@ pub const Target = struct {
761763 .sparcv9 => ._SPARCV9,
762764 .s390x => ._S390,
763765 .ve => ._NONE,
766 .spu_2 => ._SPU_2,
764767 };
765768 }
766769
......@@ -803,6 +806,7 @@ pub const Target = struct {
803806 .renderscript64,
804807 .shave,
805808 .ve,
809 .spu_2,
806810 => .Little,
807811
808812 .arc,
......@@ -827,6 +831,7 @@ pub const Target = struct {
827831 switch (arch) {
828832 .avr,
829833 .msp430,
834 .spu_2,
830835 => return 16,
831836
832837 .arc,
......@@ -1317,12 +1322,13 @@ pub const Target = struct {
13171322 .bpfeb,
13181323 .nvptx,
13191324 .nvptx64,
1325 .spu_2,
1326 .avr,
13201327 => return result,
13211328
13221329 // TODO go over each item in this list and either move it to the above list, or
13231330 // implement the standard dynamic linker path code for it.
13241331 .arc,
1325 .avr,
13261332 .hexagon,
13271333 .msp430,
13281334 .r600,
src-self-hosted/link/Elf.zig+2-2
......@@ -249,7 +249,7 @@ fn openFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf {
249249 .allocator = allocator,
250250 },
251251 .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) {
252 32 => .p32,
252 16, 32 => .p32,
253253 64 => .p64,
254254 else => return error.UnsupportedELFArchitecture,
255255 },
......@@ -278,7 +278,7 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf
278278 .file = file,
279279 },
280280 .ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) {
281 32 => .p32,
281 16, 32 => .p32,
282282 64 => .p64,
283283 else => return error.UnsupportedELFArchitecture,
284284 },