std.Target: Clean up Arch.toElfMachine().

This commit is contained in:
Alex Rønne Petersen 2024-08-09 19:39:50 +02:00
parent 1e67221f07
commit 9246c88031
No known key found for this signature in database

View File

@ -1210,51 +1210,43 @@ pub const Cpu = struct {
pub fn toElfMachine(arch: Arch) std.elf.EM {
return switch (arch) {
.avr => .AVR,
.msp430 => .MSP430,
.amdgcn => .AMDGPU,
.arc => .ARC,
.arm => .ARM,
.armeb => .ARM,
.arm, .armeb, .thumb, .thumbeb => .ARM,
.aarch64, .aarch64_be => .AARCH64,
.avr => .AVR,
.bpfel, .bpfeb => .BPF,
.csky => .CSKY,
.hexagon => .HEXAGON,
.dxil => .NONE,
.m68k => .@"68K",
.mips => .MIPS,
.mipsel => .MIPS_RS3_LE,
.powerpc, .powerpcle => .PPC,
.riscv32 => .RISCV,
.sparc => .SPARC,
.thumb => .ARM,
.thumbeb => .ARM,
.x86 => .@"386",
.xcore => .XCORE,
.xtensa => .XTENSA,
.nvptx => .NONE,
.kalimba => .CSR_KALIMBA,
.lanai => .LANAI,
.wasm32 => .NONE,
.aarch64 => .AARCH64,
.aarch64_be => .AARCH64,
.mips64 => .MIPS,
.mips64el => .MIPS_RS3_LE,
.powerpc64 => .PPC64,
.powerpc64le => .PPC64,
.riscv64 => .RISCV,
.x86_64 => .X86_64,
.nvptx64 => .NONE,
.wasm64 => .NONE,
.amdgcn => .AMDGPU,
.bpfel => .BPF,
.bpfeb => .BPF,
.csky => .CSKY,
.sparc64 => .SPARCV9,
.loongarch32, .loongarch64 => .LOONGARCH,
.m68k => .@"68K",
.mips, .mips64 => .MIPS,
.mipsel, .mips64el => .MIPS_RS3_LE,
.msp430 => .MSP430,
.powerpc, .powerpcle => .PPC,
.powerpc64, .powerpc64le => .PPC64,
.riscv32, .riscv64 => .RISCV,
.s390x => .S390,
.ve => .NONE,
.sparc => .SPARC, // TODO: Should be SPARC32PLUS when targeting 32-bit v9.
.sparc64 => .SPARCV9,
.spu_2 => .SPU_2,
.spirv => .NONE,
.spirv32 => .NONE,
.spirv64 => .NONE,
.loongarch32 => .LOONGARCH,
.loongarch64 => .LOONGARCH,
.x86 => .@"386",
.x86_64 => .X86_64,
.xcore => .XCORE,
.xtensa => .XTENSA,
.dxil,
.nvptx,
.nvptx64,
.spirv,
.spirv32,
.spirv64,
.ve,
.wasm32,
.wasm64,
=> .NONE,
};
}