| ... | @@ -11563,28 +11563,31 @@ fn ccAbiPromoteInt( | ... | @@ -11563,28 +11563,31 @@ fn ccAbiPromoteInt( |
| 11563 | .Int, .Enum, .ErrorSet => ty.intInfo(mod), | 11563 | .Int, .Enum, .ErrorSet => ty.intInfo(mod), |
| 11564 | else => return null, | 11564 | else => return null, |
| 11565 | }; | 11565 | }; |
| 11566 | if (int_info.bits <= 16) return int_info.signedness; | 11566 | return switch (target.cpu.arch) { |
| 11567 | switch (target.cpu.arch) { | 11567 | .riscv64 => switch (int_info.bits) { |
| 11568 | .riscv64 => { | 11568 | 0...16 => int_info.signedness, |
| 11569 | if (int_info.bits == 32) { | 11569 | 32 => .signed, // LLVM always signextends 32 bit ints, unsure if bug. |
| 11570 | // LLVM always signextends 32 bit ints, unsure if bug. | 11570 | 17...31, 33...63 => int_info.signedness, |
| 11571 | return .signed; | 11571 | else => null, |
| 11572 | } | | |
| 11573 | if (int_info.bits < 64) { | | |
| 11574 | return int_info.signedness; | | |
| 11575 | } | | |
| 11576 | }, | 11572 | }, |
| | 11573 | |
| 11577 | .sparc64, | 11574 | .sparc64, |
| 11578 | .powerpc64, | 11575 | .powerpc64, |
| 11579 | .powerpc64le, | 11576 | .powerpc64le, |
| 11580 | => { | 11577 | => switch (int_info.bits) { |
| 11581 | if (int_info.bits < 64) { | 11578 | 0...63 => int_info.signedness, |
| 11582 | return int_info.signedness; | 11579 | else => null, |
| 11583 | } | | |
| 11584 | }, | 11580 | }, |
| 11585 | else => {}, | 11581 | |
| 11586 | } | 11582 | .aarch64, |
| 11587 | return null; | 11583 | .aarch64_be, |
| | 11584 | => null, |
| | 11585 | |
| | 11586 | else => switch (int_info.bits) { |
| | 11587 | 0...16 => int_info.signedness, |
| | 11588 | else => null, |
| | 11589 | }, |
| | 11590 | }; |
| 11588 | } | 11591 | } |
| 11589 | | 11592 | |
| 11590 | /// This is the one source of truth for whether a type is passed around as an LLVM pointer, | 11593 | /// This is the one source of truth for whether a type is passed around as an LLVM pointer, |