#define vec_vcfux __builtin_vec_vcfux
#define vec_cts __builtin_vec_cts
#define vec_ctu __builtin_vec_ctu
-#define vec_cpsgn __builtin_vec_copysign
+#define vec_cpsgn(x,y) __builtin_vec_copysign(y,x)
#define vec_double __builtin_vec_double
#define vec_doublee __builtin_vec_doublee
#define vec_doubleo __builtin_vec_doubleo
vus __builtin_vec_convert_4f32_8f16 (vf, vf);
CONVERT_4F32_8F16
-[VEC_COPYSIGN, vec_cpsgn, __builtin_vec_copysign]
+[VEC_COPYSIGN, SKIP, __builtin_vec_copysign]
vf __builtin_vec_copysign (vf, vf);
- CPSGNSP
+ COPYSIGN_V4SF
vd __builtin_vec_copysign (vd, vd);
CPSGNDP
--- /dev/null
+/* PR target/101985 */
+/* { dg-do run } */
+/* { dg-require-effective-target vsx_hw } */
+/* { dg-options "-O2 -mvsx" } */
+
+#include <altivec.h>
+
+int
+main (void)
+{
+ vector float a = { 1, 2, - 3, - 4};
+ vector float b = {-10, 20, -30, 40};
+ vector float c = { 10, 20, -30, -40};
+ a = vec_cpsgn (a, b);
+ if (! vec_all_eq (a, c))
+ __builtin_abort ();
+ return 0;
+}
--- /dev/null
+/* PR target/101985 */
+/* { dg-do run } */
+/* { dg-require-effective-target vsx_hw } */
+/* { dg-options "-O2 -mvsx" } */
+
+#include <altivec.h>
+
+int
+main (void)
+{
+ vector double a = { 1, -4};
+ vector double b = { -10, 40};
+ vector double c = { 10, -40};
+ a = vec_cpsgn (a, b);
+ if (! vec_all_eq (a, c))
+ __builtin_abort ();
+ return 0;
+}