]> git.ipfire.org Git - thirdparty/gcc.git/commit
bitint: Avoid extending ABI-extended large/huge _BitInts on load
authorYang Yujie <yangyujie@loongson.cn>
Wed, 6 Aug 2025 10:01:33 +0000 (12:01 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 6 Aug 2025 10:01:33 +0000 (12:01 +0200)
commita76a032354ee48c0dcc5ff4842a9b319c3123685
tree478dcd978c54c00d031ac44537266d66d44776c3
parenta107b01da42b2f2303ffe53df5ea4a796f40597d
bitint: Avoid extending ABI-extended large/huge _BitInts on load

This patch also make casts of ABI-extended large/huge _BitInts
behave the same as the small/middle case, i.e. no-op for casts
to a higher precision _BitInt with the same number of limbs /
extension for casts that turns a full top limb into a partial limb.
This conveniently helps keep some code with implementation-specific
extension semantics (e.g. BEXTC from gcc.dg/bitintext.h) the same
for _BitInts of any precision.

* gimple-lower-bitint.cc (bitint_large_huge::limb_access):
Add a parameter abi_load_p.  If set, load a limb directly
in its actual precision without casting from m_limb_type.
(struct bitint_large_huge): Same.
(bitint_large_huge::handle_load): Use.
gcc/gimple-lower-bitint.cc