@@ -6504,6 +6504,25 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "V4SF")])
+(define_insn "truncv2dfv2sf2"
+ [(set (match_operand:V2SF 0 "register_operand" "=v")
+ (float_truncate:V2SF
+ (match_operand:V2DF 1 "vector_operand" "vBm")))]
+ "TARGET_MMX_WITH_SSE"
+{
+ if (TARGET_AVX)
+ return "vcvtpd2ps{x}\t{%1, %0|%0, %1}";
+ else
+ return "cvtpd2ps\t{%1, %0|%0, %1}";
+}
+ [(set_attr "type" "ssecvt")
+ (set_attr "amdfam10_decode" "double")
+ (set_attr "athlon_decode" "vector")
+ (set_attr "bdver1_decode" "double")
+ (set_attr "prefix_data16" "1")
+ (set_attr "prefix" "maybe_vex")
+ (set_attr "mode" "V4SF")])
+
(define_insn "*sse2_cvtpd2ps_mask"
[(set (match_operand:V4SF 0 "register_operand" "=v")
(vec_concat:V4SF
@@ -6664,6 +6683,20 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "V2DF")])
+(define_insn "extendv2sfv2df2"
+ [(set (match_operand:V2DF 0 "register_operand" "=v")
+ (float_extend:V2DF
+ (match_operand:V2SF 1 "register_operand" "v")))]
+ "TARGET_MMX_WITH_SSE"
+ "%vcvtps2pd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "amdfam10_decode" "direct")
+ (set_attr "athlon_decode" "double")
+ (set_attr "bdver1_decode" "double")
+ (set_attr "prefix_data16" "0")
+ (set_attr "prefix" "maybe_vex")
+ (set_attr "mode" "V2DF")])
+
(define_expand "vec_unpacks_hi_v4sf"
[(set (match_dup 2)
(vec_select:V4SF
new file mode 100644
@@ -0,0 +1,25 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -msse2" } */
+
+
+float f[2];
+double d[2];
+
+void
+test_float_truncate (void)
+{
+ for (int i = 0; i < 2; i++)
+ f[i] = d[i];
+}
+
+/* { dg-final { scan-assembler "\tv?cvtpd2psx?" } } */
+
+void
+test_float_extend (void)
+{
+ for (int i = 0; i < 2; i++)
+ d[i] = f[i];
+}
+
+/* { dg-final { scan-assembler "\tv?cvtps2pd" } } */