]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Allow compiler to define ls64 builtins [PR110132]
authorAlex Coplan <alex.coplan@arm.com>
Tue, 6 Jun 2023 14:19:03 +0000 (15:19 +0100)
committerAlex Coplan <alex.coplan@arm.com>
Thu, 22 Jun 2023 10:13:55 +0000 (11:13 +0100)
commit4481d70c9edcd89a8d9f6c0d705b05230aa080e3
treebf2a889a0c4512cc0a823261855b5584a8d7e3fd
parent0112ed013847ca9dbef4ba21f1c3f94c5bbe310b
aarch64: Allow compiler to define ls64 builtins [PR110132]

This patch refactors the ls64 builtins to allow the compiler to define them
directly instead of having wrapper functions in arm_acle.h. This should be not
only easier to maintain, but it makes two important correctness fixes:
 - It fixes PR110132, where the builtins ended up getting declared with
   invisible bindings in the C FE, so the FE ended up synthesizing
   incompatible implicit definitions for these builtins.
 - It allows the builtins to be used with LTO, which didn't work previously.

We also take the opportunity to add test coverage from C++ for these
builtins.

gcc/ChangeLog:

PR target/110132
* config/aarch64/aarch64-builtins.cc (aarch64_general_simulate_builtin):
New. Use it ...
(aarch64_init_ls64_builtins): ... here. Switch to declaring public ACLE
names for builtins.
(aarch64_general_init_builtins): Ensure we invoke the arm_acle.h
setup if in_lto_p, just like we do for SVE.
* config/aarch64/arm_acle.h: (__arm_ld64b): Delete.
(__arm_st64b): Delete.
(__arm_st64bv): Delete.
(__arm_st64bv0): Delete.

gcc/testsuite/ChangeLog:

PR target/110132
* lib/target-supports.exp (check_effective_target_aarch64_asm_FUNC_ok):
Extend to ls64.
* g++.target/aarch64/acle/acle.exp: New.
* g++.target/aarch64/acle/ls64.C: New test.
* g++.target/aarch64/acle/ls64_lto.C: New test.
* gcc.target/aarch64/acle/ls64_lto.c: New test.
* gcc.target/aarch64/acle/pr110132.c: New test.

(cherry picked from commit 9963029a24f2d2510b82e7106fae3f364da33c5d)
gcc/config/aarch64/aarch64-builtins.cc
gcc/config/aarch64/arm_acle.h
gcc/testsuite/g++.target/aarch64/acle/acle.exp [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/acle/ls64.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/acle/ls64_lto.C [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/acle/ls64_lto.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/acle/pr110132.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp