| ... | @@ -1787,18 +1787,12 @@ pub const Target = struct { | ... | @@ -1787,18 +1787,12 @@ pub const Target = struct { |
| 1787 | .hexagon, | 1787 | .hexagon, |
| 1788 | .mips, | 1788 | .mips, |
| 1789 | .mipsel, | 1789 | .mipsel, |
| 1790 | .mips64, | | |
| 1791 | .mips64el, | | |
| 1792 | .powerpc, | 1790 | .powerpc, |
| 1793 | .powerpcle, | 1791 | .powerpcle, |
| 1794 | .powerpc64, | | |
| 1795 | .powerpc64le, | | |
| 1796 | .r600, | 1792 | .r600, |
| 1797 | .amdgcn, | 1793 | .amdgcn, |
| 1798 | .riscv32, | 1794 | .riscv32, |
| 1799 | .riscv64, | | |
| 1800 | .sparc, | 1795 | .sparc, |
| 1801 | .sparcv9, | | |
| 1802 | .sparcel, | 1796 | .sparcel, |
| 1803 | .s390x, | 1797 | .s390x, |
| 1804 | .lanai, | 1798 | .lanai, |
| ... | @@ -1812,10 +1806,20 @@ pub const Target = struct { | ... | @@ -1812,10 +1806,20 @@ pub const Target = struct { |
| 1812 | }, | 1806 | }, |
| 1813 | | 1807 | |
| 1814 | // For x86_64, LLVMABIAlignmentOfType(i128) reports 8. However I think 16 | 1808 | // For x86_64, LLVMABIAlignmentOfType(i128) reports 8. However I think 16 |
| 1815 | // is a better number because of two reasons: | 1809 | // is a better number for two reasons: |
| 1816 | // 1. Better machine code when loading into SIMD register. | 1810 | // 1. Better machine code when loading into SIMD register. |
| 1817 | // 2. The C ABI wants 16 for extern structs. | 1811 | // 2. The C ABI wants 16 for extern structs. |
| | 1812 | // 3. 16-byte cmpxchg needs 16-byte alignment. |
| | 1813 | // Same logic for riscv64, powerpc64, mips64, sparcv9. |
| 1818 | .x86_64, | 1814 | .x86_64, |
| | 1815 | .riscv64, |
| | 1816 | .powerpc64, |
| | 1817 | .powerpc64le, |
| | 1818 | .mips64, |
| | 1819 | .mips64el, |
| | 1820 | .sparcv9, |
| | 1821 | |
| | 1822 | // Even LLVMABIAlignmentOfType(i128) agrees on these targets. |
| 1819 | .aarch64, | 1823 | .aarch64, |
| 1820 | .aarch64_be, | 1824 | .aarch64_be, |
| 1821 | .aarch64_32, | 1825 | .aarch64_32, |
| ... | @@ -1825,11 +1829,9 @@ pub const Target = struct { | ... | @@ -1825,11 +1829,9 @@ pub const Target = struct { |
| 1825 | .nvptx64, | 1829 | .nvptx64, |
| 1826 | => 16, | 1830 | => 16, |
| 1827 | | 1831 | |
| 1828 | // Below this comment are unverified and I have chosen a number | 1832 | // Below this comment are unverified but based on the fact that C requires |
| 1829 | // based on ptrBitWidth. | 1833 | // int128_t to be 16 bytes aligned, it's a safe default. |
| 1830 | | 1834 | .spu_2, |
| 1831 | .spu_2 => 2, | | |
| 1832 | | | |
| 1833 | .csky, | 1835 | .csky, |
| 1834 | .arc, | 1836 | .arc, |
| 1835 | .m68k, | 1837 | .m68k, |
| ... | @@ -1843,8 +1845,6 @@ pub const Target = struct { | ... | @@ -1843,8 +1845,6 @@ pub const Target = struct { |
| 1843 | .renderscript32, | 1845 | .renderscript32, |
| 1844 | .spirv32, | 1846 | .spirv32, |
| 1845 | .shave, | 1847 | .shave, |
| 1846 | => 4, | | |
| 1847 | | | |
| 1848 | .le64, | 1848 | .le64, |
| 1849 | .amdil64, | 1849 | .amdil64, |
| 1850 | .hsail64, | 1850 | .hsail64, |
| ... | @@ -1852,7 +1852,7 @@ pub const Target = struct { | ... | @@ -1852,7 +1852,7 @@ pub const Target = struct { |
| 1852 | .renderscript64, | 1852 | .renderscript64, |
| 1853 | .ve, | 1853 | .ve, |
| 1854 | .spirv64, | 1854 | .spirv64, |
| 1855 | => 8, | 1855 | => 16, |
| 1856 | }; | 1856 | }; |
| 1857 | } | 1857 | } |
| 1858 | }; | 1858 | }; |