Targets: add SPU Mark II architecture

This commit is contained in:
Noam Preil 2020-08-21 17:52:03 -04:00 committed by Andrew Kelley
parent 29051a0674
commit 803a1025bb
3 changed files with 12 additions and 3 deletions

View File

@ -976,6 +976,9 @@ pub const EM = extern enum(u16) {
/// MIPS RS3000 Little-endian
_MIPS_RS3_LE = 10,
/// SPU Mark II
_SPU_2 = 13,
/// Hewlett-Packard PA-RISC
_PARISC = 15,

View File

@ -663,6 +663,8 @@ pub const Target = struct {
renderscript32,
renderscript64,
ve,
// Non-LLVM targets go here
spu_2,
pub fn isARM(arch: Arch) bool {
return switch (arch) {
@ -761,6 +763,7 @@ pub const Target = struct {
.sparcv9 => ._SPARCV9,
.s390x => ._S390,
.ve => ._NONE,
.spu_2 => ._SPU_2,
};
}
@ -803,6 +806,7 @@ pub const Target = struct {
.renderscript64,
.shave,
.ve,
.spu_2,
=> .Little,
.arc,
@ -827,6 +831,7 @@ pub const Target = struct {
switch (arch) {
.avr,
.msp430,
.spu_2,
=> return 16,
.arc,
@ -1317,12 +1322,13 @@ pub const Target = struct {
.bpfeb,
.nvptx,
.nvptx64,
.spu_2,
.avr,
=> return result,
// TODO go over each item in this list and either move it to the above list, or
// implement the standard dynamic linker path code for it.
.arc,
.avr,
.hexagon,
.msp430,
.r600,

View File

@ -249,7 +249,7 @@ fn openFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf {
.allocator = allocator,
},
.ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) {
32 => .p32,
16, 32 => .p32,
64 => .p64,
else => return error.UnsupportedELFArchitecture,
},
@ -278,7 +278,7 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Elf
.file = file,
},
.ptr_width = switch (options.target.cpu.arch.ptrBitWidth()) {
32 => .p32,
16, 32 => .p32,
64 => .p64,
else => return error.UnsupportedELFArchitecture,
},