Hi, This patch changes the definition of TARGET_MADDLD and includes TARGET_POWERPC64, since maddld is a 64 bit instruction.
maddld-1.c now checks "has_arch_ppc64". It depends on a patch which fixes empty TU problem. https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598744.html Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. Is this okay for trunk? Any recommendations? Thanks a lot. ChangeLog 2022-08-03 Haochen Gui <[email protected]> gcc/ * config/rs6000/rs6000.h (TARGET_MADDLD): Define. gcc/testsuite/ * gcc.target/powerpc/maddld-1.c: Modify target requirement to compile it on the target which supports 64 bit instructions. patch.diff diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 7d04556304a..2f15451fd8b 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -466,7 +466,7 @@ extern int rs6000_vector_align[]; #define TARGET_FCTIWUZ TARGET_POPCNTD #define TARGET_CTZ TARGET_MODULO #define TARGET_EXTSWSLI (TARGET_MODULO && TARGET_POWERPC64) -#define TARGET_MADDLD TARGET_MODULO +#define TARGET_MADDLD (TARGET_MODULO && TARGET_POWERPC64) #define TARGET_XSCVDPSPN (TARGET_DIRECT_MOVE || TARGET_P8_VECTOR) #define TARGET_XSCVSPDPN (TARGET_DIRECT_MOVE || TARGET_P8_VECTOR) diff --git a/gcc/testsuite/gcc.target/powerpc/maddld-1.c b/gcc/testsuite/gcc.target/powerpc/maddld-1.c index 4edecf1c86d..0a53658e058 100644 --- a/gcc/testsuite/gcc.target/powerpc/maddld-1.c +++ b/gcc/testsuite/gcc.target/powerpc/maddld-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target { has_arch_ppc64 } } } */ /* { dg-options "-mdejagnu-cpu=power9 -O2" } */ /* This file tests the maddld instruction can be used in SI mode
