https://gcc.gnu.org/g:fed57c8ec95ce3d86e74c5afb73a3a4a499d4ec4
commit r15-6981-gfed57c8ec95ce3d86e74c5afb73a3a4a499d4ec4 Author: Alexandre Oliva <ol...@adacore.com> Date: Thu Jan 16 20:19:50 2025 -0300 [testsuite] [arm] adjust wmul expectations [PR113560] Since the machine-independent widening multiply logic was improved PR113560, ARM's wmul-[567].c fail. AFAICT the logic takes advantage of the fact that, after zero-extending a narrow integral type to a wider type, further zero- or sign-extending is equivalent, which enables different instructions to be used for equivalent effect. Adjust the tests to accept all the equivalent instructions that can be used. for gcc/testsuite/ChangeLog PR target/113560 * gcc.target/arm/wmul-5.c: Accept other mla instructions. * gcc.target/arm/wmul-6.c: Likewise. * gcc.target/arm/wmul-7.c: Likewise. Diff: --- gcc/testsuite/gcc.target/arm/wmul-5.c | 4 +++- gcc/testsuite/gcc.target/arm/wmul-6.c | 4 +++- gcc/testsuite/gcc.target/arm/wmul-7.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.target/arm/wmul-5.c b/gcc/testsuite/gcc.target/arm/wmul-5.c index 9f29a81c0b8b..282e007d9be3 100644 --- a/gcc/testsuite/gcc.target/arm/wmul-5.c +++ b/gcc/testsuite/gcc.target/arm/wmul-5.c @@ -8,4 +8,6 @@ foo (long long a, char *b, char *c) return a + *b * *c; } -/* { dg-final { scan-assembler "umlal" } } */ +/* smlalbb after zero-extending the chars to HImode, or either signed- or + unsigned-widening multiply after extending them to SImode. */ +/* { dg-final { scan-assembler {(?:smlalbb|[us]mlal)} } } */ diff --git a/gcc/testsuite/gcc.target/arm/wmul-6.c b/gcc/testsuite/gcc.target/arm/wmul-6.c index babdaab1efd5..05247e00c5eb 100644 --- a/gcc/testsuite/gcc.target/arm/wmul-6.c +++ b/gcc/testsuite/gcc.target/arm/wmul-6.c @@ -8,4 +8,6 @@ foo (long long a, unsigned char *b, signed char *c) return a + (long long)*b * (long long)*c; } -/* { dg-final { scan-assembler "smlalbb" } } */ +/* After zero-extending B and sign-extending C to [HS]imode, either + signed-widening multiply will do. */ +/* { dg-final { scan-assembler {smlal(?:bb)?} } } */ diff --git a/gcc/testsuite/gcc.target/arm/wmul-7.c b/gcc/testsuite/gcc.target/arm/wmul-7.c index 2db4ad4e10d5..26933c42401a 100644 --- a/gcc/testsuite/gcc.target/arm/wmul-7.c +++ b/gcc/testsuite/gcc.target/arm/wmul-7.c @@ -8,4 +8,6 @@ foo (unsigned long long a, unsigned char *b, unsigned short *c) return a + *b * *c; } -/* { dg-final { scan-assembler "umlal" } } */ +/* After zero-extending both to SImode, either signed- or unsigned-widening + multiply will do. */ +/* { dg-final { scan-assembler {[us]mlal} } } */