diff options
author | Jakub Jelinek <jakub@redhat.com> | 2023-12-15 12:40:51 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-12-15 12:40:51 +0100 |
commit | a98a39328643e092aa6f0d98586a9b7f92bfff91 (patch) | |
tree | fdc3185afabc87c3a5f3e01eefa94f38d3f1fcaf /gcc/config/i386/i386.cc | |
parent | f5745dc1426bdb1a53ebaf7af758b2250ccbff02 (diff) | |
download | gcc-a98a39328643e092aa6f0d98586a9b7f92bfff91.zip gcc-a98a39328643e092aa6f0d98586a9b7f92bfff91.tar.gz gcc-a98a39328643e092aa6f0d98586a9b7f92bfff91.tar.bz2 |
bitint: Introduce abi_limb_mode
Given what I saw in the aarch64/arm psABIs for BITINT_TYPE, as I said
earlier I'm afraid we need to differentiate between the limb mode/precision
specified in the psABIs (what is used to decide how it is actually passed,
aligned or what size it has) vs. what limb mode/precision should be used
during bitint lowering and in the libgcc bitint APIs.
While in the x86_64 psABI a limb is 64-bit, which is perfect for both,
that is a wordsize which we can perform operations natively in,
e.g. aarch64 wants 128-bit limbs for alignment/sizing purposes, but
on the bitint lowering side I believe it would result in terribly bad code
and on the libgcc side wouldn't work at all (because it relies there on
longlong.h support).
So, the following patch makes it possible for aarch64 to use TImode
as abi_limb_mode for _BitInt(129) and larger, while using DImode as
limb_mode.
2023-12-15 Jakub Jelinek <jakub@redhat.com>
* target.h (struct bitint_info): Add abi_limb_mode member, adjust
comment.
* target.def (bitint_type_info): Mention abi_limb_mode instead of
limb_mode.
* varasm.cc (output_constant): Use abi_limb_mode rather than
limb_mode.
* stor-layout.cc (finish_bitfield_representative): Likewise. Assert
that if precision is smaller or equal to abi_limb_mode precision or
if info.big_endian is different from WORDS_BIG_ENDIAN, info.limb_mode
must be the same as info.abi_limb_mode.
(layout_type): Use abi_limb_mode rather than limb_mode.
* gimple-fold.cc (clear_padding_bitint_needs_padding_p): Likewise.
(clear_padding_type): Likewise.
* config/i386/i386.cc (ix86_bitint_type_info): Also set
info->abi_limb_mode.
* doc/tm.texi: Regenerated.
Diffstat (limited to 'gcc/config/i386/i386.cc')
-rw-r--r-- | gcc/config/i386/i386.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 3e78949..0bba93f 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -25679,6 +25679,7 @@ ix86_bitint_type_info (int n, struct bitint_info *info) info->limb_mode = SImode; else info->limb_mode = DImode; + info->abi_limb_mode = info->limb_mode; info->big_endian = false; info->extended = false; return true; |