@@ -660,6 +660,47 @@
(set_attr "prefix" "orig,vex")
(set_attr "mode" "V4SF")])
+(define_expand "copysignv2sf3"
+ [(set (match_dup 4)
+ (and:V2SF
+ (not:V2SF (match_dup 3))
+ (match_operand:V2SF 1 "register_operand")))
+ (set (match_dup 5)
+ (and:V2SF (match_dup 3)
+ (match_operand:V2SF 2 "register_operand")))
+ (set (match_operand:V2SF 0 "register_operand")
+ (ior:V2SF (match_dup 4) (match_dup 5)))]
+ "TARGET_MMX_WITH_SSE"
+{
+ operands[3] = ix86_build_signbit_mask (V2SFmode, true, false);
+
+ operands[4] = gen_reg_rtx (V2SFmode);
+ operands[5] = gen_reg_rtx (V2SFmode);
+})
+
+(define_expand "xorsignv2sf3"
+ [(set (match_dup 4)
+ (and:V2SF (match_dup 3)
+ (match_operand:V2SF 2 "register_operand")))
+ (set (match_operand:V2SF 0 "register_operand")
+ (xor:V2SF (match_dup 4)
+ (match_operand:V2SF 1 "register_operand")))]
+ "TARGET_MMX_WITH_SSE"
+{
+ operands[3] = ix86_build_signbit_mask (V2SFmode, true, false);
+
+ operands[4] = gen_reg_rtx (V2SFmode);
+})
+
+(define_expand "signbitv2sf2"
+ [(set (match_operand:V2SI 0 "register_operand")
+ (lshiftrt:V2SI
+ (subreg:V2SI
+ (match_operand:V2SF 1 "register_operand") 0)
+ (match_dup 2)))]
+ "TARGET_MMX_WITH_SSE"
+ "operands[2] = GEN_INT (GET_MODE_UNIT_BITSIZE (V2SFmode)-1);")
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Parallel single-precision FMA multiply/accumulate instructions.
new file mode 100644
@@ -0,0 +1,39 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -msse2" } */
+
+
+float r[2], a[2], b[2];
+
+float copysignf (float, float);
+
+void
+test_copysign (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = copysignf (a[i], b[i]);
+}
+
+/* { dg-final { scan-assembler "\tv?andnps" } } */
+
+void
+test_xorsign (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = a[i] * copysignf (1.0f, b[i]);
+}
+
+/* { dg-final { scan-assembler "\tv?xorps" } } */
+
+int s[2];
+
+int signbitf (float);
+
+void
+test_signbitf (void)
+{
+ for (int i = 0; i < 2; i++)
+ s[i] = signbitf (a[i]);
+}
+
+/* { dg-final { scan-assembler "\tv?psrld" } } */