@@ -1429,30 +1429,36 @@ pub fn compactUnwindToDwarfRegNumber(unwind_reg_number: u3) !u16 {
14291429/// Returns `null` for CPU architectures without an instruction pointer register.
14301430pub fn ipRegNum (arch : std.Target.Cpu.Arch ) ? u16 {
14311431 return switch (arch ) {
1432+ .aarch64 , .aarch64_be = > 32 ,
1433+ .arm , .armeb , .thumb , .thumbeb = > 15 ,
1434+ .loongarch32 , .loongarch64 = > 32 ,
1435+ .riscv32 , .riscv32be , .riscv64 , .riscv64be = > 32 ,
14321436 .x86 = > 8 ,
14331437 .x86_64 = > 16 ,
1434- .arm , .armeb , .thumb , .thumbeb = > 15 ,
1435- .aarch64 , .aarch64_be = > 32 ,
14361438 else = > null ,
14371439 };
14381440}
14391441
14401442pub fn fpRegNum (arch : std.Target.Cpu.Arch ) u16 {
14411443 return switch (arch ) {
1444+ .aarch64 , .aarch64_be = > 29 ,
1445+ .arm , .armeb , .thumb , .thumbeb = > 11 ,
1446+ .loongarch32 , .loongarch64 = > 22 ,
1447+ .riscv32 , .riscv32be , .riscv64 , .riscv64be = > 8 ,
14421448 .x86 = > 5 ,
14431449 .x86_64 = > 6 ,
1444- .arm , .armeb , .thumb , .thumbeb = > 11 ,
1445- .aarch64 , .aarch64_be = > 29 ,
14461450 else = > unreachable ,
14471451 };
14481452}
14491453
14501454pub fn spRegNum (arch : std.Target.Cpu.Arch ) u16 {
14511455 return switch (arch ) {
1456+ .aarch64 , .aarch64_be = > 31 ,
1457+ .arm , .armeb , .thumb , .thumbeb = > 13 ,
1458+ .loongarch32 , .loongarch64 = > 3 ,
1459+ .riscv32 , .riscv32be , .riscv64 , .riscv64be = > 2 ,
14521460 .x86 = > 4 ,
14531461 .x86_64 = > 7 ,
1454- .arm , .armeb , .thumb , .thumbeb = > 13 ,
1455- .aarch64 , .aarch64_be = > 31 ,
14561462 else = > unreachable ,
14571463 };
14581464}
@@ -1470,10 +1476,6 @@ pub fn supportsUnwinding(target: *const std.Target) bool {
14701476 .spirv64 ,
14711477 = > false ,
14721478
1473- // Enabling this causes relocation errors such as:
1474- // error: invalid relocation type R_RISCV_SUB32 at offset 0x20
1475- .riscv64 , .riscv64be , .riscv32 , .riscv32be = > false ,
1476-
14771479 // Conservative guess. Feel free to update this logic with any targets
14781480 // that are known to not support Dwarf unwinding.
14791481 else = > true ,
0 commit comments