| ... | @@ -1641,69 +1641,60 @@ pub fn intAbiAlignment(bits: u16, target: Target) Alignment { | ... | @@ -1641,69 +1641,60 @@ pub fn intAbiAlignment(bits: u16, target: Target) Alignment { |
| 1641 | pub fn maxIntAlignment(target: std.Target) u16 { | 1641 | pub fn maxIntAlignment(target: std.Target) u16 { |
| 1642 | return switch (target.cpu.arch) { | 1642 | return switch (target.cpu.arch) { |
| 1643 | .avr => 1, | 1643 | .avr => 1, |
| | 1644 | |
| 1644 | .msp430 => 2, | 1645 | .msp430 => 2, |
| 1645 | .xcore => 4, | | |
| 1646 | .propeller => 4, | | |
| 1647 | | 1646 | |
| | 1647 | .xcore, |
| | 1648 | .propeller, |
| | 1649 | => 4, |
| | 1650 | |
| | 1651 | .amdgcn, |
| 1648 | .arm, | 1652 | .arm, |
| 1649 | .armeb, | 1653 | .armeb, |
| 1650 | .thumb, | 1654 | .thumb, |
| 1651 | .thumbeb, | 1655 | .thumbeb, |
| | 1656 | .lanai, |
| 1652 | .hexagon, | 1657 | .hexagon, |
| 1653 | .mips, | 1658 | .mips, |
| 1654 | .mipsel, | 1659 | .mipsel, |
| 1655 | .powerpc, | 1660 | .powerpc, |
| 1656 | .powerpcle, | 1661 | .powerpcle, |
| 1657 | .amdgcn, | | |
| 1658 | .riscv32, | 1662 | .riscv32, |
| 1659 | .sparc, | | |
| 1660 | .s390x, | 1663 | .s390x, |
| 1661 | .lanai, | | |
| 1662 | .wasm32, | | |
| 1663 | .wasm64, | | |
| 1664 | => 8, | 1664 | => 8, |
| 1665 | | 1665 | |
| 1666 | // For these, LLVMABIAlignmentOfType(i128) reports 8. Note that 16 | | |
| 1667 | // is a relevant number in three cases: | | |
| 1668 | // 1. Different machine code instruction when loading into SIMD register. | | |
| 1669 | // 2. The C ABI wants 16 for extern structs. | | |
| 1670 | // 3. 16-byte cmpxchg needs 16-byte alignment. | | |
| 1671 | // Same logic for powerpc64, mips64, sparc64. | | |
| 1672 | .powerpc64, | | |
| 1673 | .powerpc64le, | | |
| 1674 | .mips64, | | |
| 1675 | .mips64el, | | |
| 1676 | .sparc64, | | |
| 1677 | => switch (target.ofmt) { | | |
| 1678 | .c => 16, | | |
| 1679 | else => 8, | | |
| 1680 | }, | | |
| 1681 | | | |
| 1682 | .x86_64 => 16, | | |
| 1683 | | | |
| 1684 | // Even LLVMABIAlignmentOfType(i128) agrees on these targets. | 1666 | // Even LLVMABIAlignmentOfType(i128) agrees on these targets. |
| 1685 | .x86, | | |
| 1686 | .aarch64, | 1667 | .aarch64, |
| 1687 | .aarch64_be, | 1668 | .aarch64_be, |
| 1688 | .riscv64, | | |
| 1689 | .bpfel, | 1669 | .bpfel, |
| 1690 | .bpfeb, | 1670 | .bpfeb, |
| | 1671 | .mips64, |
| | 1672 | .mips64el, |
| 1691 | .nvptx, | 1673 | .nvptx, |
| 1692 | .nvptx64, | 1674 | .nvptx64, |
| | 1675 | .powerpc64, |
| | 1676 | .powerpc64le, |
| | 1677 | .riscv64, |
| | 1678 | .sparc, |
| | 1679 | .sparc64, |
| | 1680 | .wasm32, |
| | 1681 | .wasm64, |
| | 1682 | .x86, |
| | 1683 | .x86_64, |
| 1693 | => 16, | 1684 | => 16, |
| 1694 | | 1685 | |
| 1695 | // Below this comment are unverified but based on the fact that C requires | 1686 | // Below this comment are unverified but based on the fact that C requires |
| 1696 | // int128_t to be 16 bytes aligned, it's a safe default. | 1687 | // int128_t to be 16 bytes aligned, it's a safe default. |
| 1697 | .csky, | | |
| 1698 | .arc, | 1688 | .arc, |
| 1699 | .m68k, | 1689 | .csky, |
| 1700 | .kalimba, | 1690 | .kalimba, |
| | 1691 | .loongarch32, |
| | 1692 | .loongarch64, |
| | 1693 | .m68k, |
| 1701 | .spirv, | 1694 | .spirv, |
| 1702 | .spirv32, | 1695 | .spirv32, |
| 1703 | .ve, | | |
| 1704 | .spirv64, | 1696 | .spirv64, |
| 1705 | .loongarch32, | 1697 | .ve, |
| 1706 | .loongarch64, | | |
| 1707 | .xtensa, | 1698 | .xtensa, |
| 1708 | => 16, | 1699 | => 16, |
| 1709 | }; | 1700 | }; |