diff options
author | Alex Coplan <alex.coplan@arm.com> | 2025-07-15 11:49:27 +0100 |
---|---|---|
committer | Alex Coplan <alex.coplan@arm.com> | 2025-08-08 12:07:26 +0100 |
commit | 80b0e4ad2f60de8bd57e83628b4ead46df6fb004 (patch) | |
tree | 49158fdf65c15d7eb05445fe66577755c923012c /gcc | |
parent | 75eabf69d805b7effb5e50f0ed53f45d6a2f596a (diff) | |
download | gcc-80b0e4ad2f60de8bd57e83628b4ead46df6fb004.zip gcc-80b0e4ad2f60de8bd57e83628b4ead46df6fb004.tar.gz gcc-80b0e4ad2f60de8bd57e83628b4ead46df6fb004.tar.bz2 |
aarch64: Relax fpm_t assert to allow const_ints [PR120986]
This relaxes an overzealous assert that required the fpm_t argument to
be in DImode when expanding FP8 intrinsics. Of course this fails to
account for modeless const_ints.
gcc/ChangeLog:
PR target/120986
* config/aarch64/aarch64-sve-builtins.cc
(function_expander::expand): Relax fpm_t assert to allow
modeless const_ints.
gcc/testsuite/ChangeLog:
PR target/120986
* gcc.target/aarch64/torture/pr120986-2.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/aarch64/aarch64-sve-builtins.cc | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/torture/pr120986-2.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc index e394c9a..1764cf8 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins.cc @@ -4590,8 +4590,9 @@ function_expander::expand () { /* The last element of these functions is always an fpm_t that must be written to FPMR before the call to the instruction itself. */ - gcc_assert (args.last ()->mode == DImode); - emit_move_insn (gen_rtx_REG (DImode, FPM_REGNUM), args.last ()); + rtx fpm = args.last (); + gcc_assert (CONST_INT_P (fpm) || GET_MODE (fpm) == DImode); + emit_move_insn (gen_rtx_REG (DImode, FPM_REGNUM), fpm); } rtx result = base->expand (*this); if (function_returns_void_p ()) diff --git a/gcc/testsuite/gcc.target/aarch64/torture/pr120986-2.c b/gcc/testsuite/gcc.target/aarch64/torture/pr120986-2.c new file mode 100644 index 0000000..1218dea --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/torture/pr120986-2.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv8.2-a+sve2+fp8dot2" } */ +#include <arm_sve.h> +svfloat16_t foo(svfloat16_t a, svmfloat8_t b, svmfloat8_t c) +{ + return svdot_lane_fpm (a, b, c, 0, 0); +} |