/* TARGET_POPCNTD is already guarded at expand cmpmemsi. */
gcc_assert (TARGET_POPCNTD);
- /* This case is complicated to handle because the subtract
- with carry instructions do not generate the 64-bit
- carry and so we must emit code to calculate it ourselves.
- We choose not to implement this yet. */
- if (TARGET_32BIT && TARGET_POWERPC64)
+ /* For P8, this case is complicated to handle because the subtract
+ with carry instructions do not generate the 64-bit carry and so
+ we must emit code to calculate it ourselves. We skip it on P8
+ but setb works well on P9. */
+ if (TARGET_32BIT
+ && TARGET_POWERPC64
+ && !TARGET_P9_MISC)
return false;
/* Allow this param to shut off all expansion. */
/* { dg-do compile } */
/* { dg-options "-O2 -mdejagnu-cpu=power8 -mno-vsx" } */
+/* { dg-skip-if "" { has_arch_ppc64 && ilp32 } } */
/* { dg-final { scan-assembler-not {\mb[l]? memcmp\M} } } */
/* Test that it still can do expand for memcmpsi instead of calling library
/* { dg-do compile { target be } } */
/* { dg-options "-O2 -mdejagnu-cpu=power7" } */
-/* { dg-final { scan-assembler-not {\mb[l]? memcmp\M} } } */
+/* { dg-skip-if "" { has_arch_ppc64 && ilp32 } } */
+/* { dg-final { scan-assembler-not {\mb[l]? memcmp\M} } } */
/* Test that it does expand for memcmpsi instead of calling library on
P7 BE when length is less than 32 bytes. */
--- /dev/null
+/* { dg-do run { target ilp32 } } */
+/* { dg-options "-O2 -mpowerpc64" } */
+/* { dg-require-effective-target has_arch_ppc64 } */
+/* { dg-timeout-factor 2 } */
+
+/* Verify memcmp on m32 mpowerpc64 */
+
+#include "../../gcc.dg/memcmp-1.c"