Main changes from v2: 1. Cache the result of info.extended during expansion of every function.
2. Do not insert extra conversion for _BitInt extension before __atomic_compare_exchange. Instead, prevent the conversion generated with the compare-and-swap loop from being optimized away. (Note: It seems that atomic fetch/op doesn't work for _BitInts even they have the right size, CAS loop is always used when handling modification. Fixing this later.) This series has been bootstrapped and regtested on loongarch64-linux-gnu and x86_64-linux-gnu. Yang Yujie (6): bitint: Allow mode promotion of _BitInt types expand: Reduce unneeded _BitInt extensions bitint: Allow unused bits when testing extended _BitInt ABIs bitint: Do not optimize away conversion to _BitInt before a VCE LoongArch: Prioritize target-specific makefile fragments LoongArch: Add support for _BitInt [PR117599] gcc/config/loongarch/loongarch.cc | 35 +++++++- gcc/config/loongarch/loongarch.h | 4 +- gcc/explow.cc | 24 ++++++ gcc/expr.cc | 12 +++ gcc/expr.h | 4 + gcc/function.cc | 4 + gcc/match.pd | 19 ++++- gcc/testsuite/gcc.dg/bitintext.h | 22 ++++- .../gcc.target/loongarch/bitint-alignments.c | 58 +++++++++++++ .../gcc.target/loongarch/bitint-args.c | 81 +++++++++++++++++++ .../gcc.target/loongarch/bitint-sizes.c | 60 ++++++++++++++ libgcc/config.host | 31 +++---- libgcc/config/loongarch/libgcc-loongarch.ver | 26 ++++++ libgcc/config/loongarch/t-loongarch | 2 + libgcc/config/loongarch/t-softfp-tf | 1 + 15 files changed, 357 insertions(+), 26 deletions(-) create mode 100644 gcc/testsuite/gcc.target/loongarch/bitint-alignments.c create mode 100644 gcc/testsuite/gcc.target/loongarch/bitint-args.c create mode 100644 gcc/testsuite/gcc.target/loongarch/bitint-sizes.c create mode 100644 libgcc/config/loongarch/libgcc-loongarch.ver -- 2.46.0