On Thu, Aug 08, 2024 at 04:48:38PM +0100, Richard Sandiford wrote: > Andrew Carlotti <andrew.carlo...@arm.com> writes: > > The availability of tme intrinsics was previously gated at both > > initialisation time (using global target options) and usage time > > (accounting for function-specific target options). This patch removes > > the check at initialisation time, and also moves the intrinsics out of > > the header file to allow for better error messages (matching the > > existing error messages for SVE intrinsics). > > > > gcc/ChangeLog: > > > > PR target/112108 > > * config/aarch64/aarch64-builtins.cc (aarch64_init_tme_builtins): > > (aarch64_general_init_builtins): Move tme initialisation... > > (handle_arm_acle_h): ...to here, and remove feature check. > > (aarch64_general_check_builtin_call): Check tme intrinsics. > > (aarch64_expand_builtin_tme): Check feature availability. > > * config/aarch64/arm_acle.h (__tstart, __tcommit, __tcancel) > > (__ttest): Remove. > > (_TMFAILURE_*): Define unconditionally. > > > > gcc/testsuite/ChangeLog: > > > > PR target/112108 > > * gcc.target/aarch64/acle/tme_guard-1.c: New test. > > * gcc.target/aarch64/acle/tme_guard-2.c: New test. > > * gcc.target/aarch64/acle/tme_guard-3.c: New test. > > * gcc.target/aarch64/acle/tme_guard-4.c: New test. > > > > ... > > @@ -2734,6 +2746,11 @@ aarch64_expand_fcmla_builtin (tree exp, rtx target, > > int fcode) > > static rtx > > aarch64_expand_builtin_tme (int fcode, tree exp, rtx target) > > { > > + tree fndecl = aarch64_builtin_decls[fcode]; > > + if (!aarch64_check_required_extensions (EXPR_LOCATION (exp), fndecl, > > + AARCH64_FL_TME, false)) > > + return target; > > + > > Does this ever trigger? The SVE code also checks during expansion, > but I think that's because of the manual overload resolution. Perhaps > I misremember though...
I don't see any reason for them to trigger; I only included them because they were present in the SVE code and they shouldn't do any harm. Since they seem to be entirely redundant, I'll remove them from all three patches before committing. > LGTM otherwise, but please leave 24 hours for others to comment. > > Thanks, > Richard > > > switch (fcode) > > { > > case AARCH64_TME_BUILTIN_TSTART: