std: Add loongarch support for coff. (#20583)

* std: Add loongarch support for coff.

See: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types

* Update toCoffMachine.
This commit is contained in:
YANG Xudong 2024-07-12 15:47:32 +08:00 committed by GitHub
parent 2b99b04285
commit 3bf0d2e516
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -1276,8 +1276,8 @@ pub const Cpu = struct {
.spirv => .Unknown,
.spirv32 => .Unknown,
.spirv64 => .Unknown,
.loongarch32 => .Unknown,
.loongarch64 => .Unknown,
.loongarch32 => .LOONGARCH32,
.loongarch64 => .LOONGARCH64,
};
}

View File

@ -1002,6 +1002,10 @@ pub const MachineType = enum(u16) {
I386 = 0x14c,
/// Intel Itanium processor family
IA64 = 0x200,
/// LoongArch32
LOONGARCH32 = 0x6232,
/// LoongArch64
LOONGARCH64 = 0x6264,
/// Mitsubishi M32R little endian
M32R = 0x9041,
/// MIPS16
@ -1047,6 +1051,8 @@ pub const MachineType = enum(u16) {
.aarch64 => .ARM64,
.riscv64 => .RISCV64,
.x86_64 => .X64,
.loongarch32 => .LOONGARCH32,
.loongarch64 => .LOONGARCH64,
// there's cases we don't (yet) handle
else => unreachable,
};
@ -1062,6 +1068,8 @@ pub const MachineType = enum(u16) {
.ARM64 => .aarch64,
.RISCV64 => .riscv64,
.X64 => .x86_64,
.LOONGARCH32 => .loongarch32,
.LOONGARCH64 => .loongarch64,
// there's cases we don't (yet) handle
else => null,
};