@@ -19006,7 +19006,9 @@ ix86_expand_sse_cmp (rtx dest, enum rtx_
/* Expand DEST = CMP ? OP_TRUE : OP_FALSE into a sequence of logical
operations. This is used for both scalar and vector conditional moves. */
-static void
+extern void ix86_expand_sse_movcc (rtx, rtx, rtx, rtx);
+
+void
ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false)
{
enum machine_mode mode = GET_MODE (dest);
@@ -2242,30 +2242,41 @@ (define_insn "float<sseintvecmodelower><
(set_attr "mode" "<sseinsnmode>")])
(define_expand "floatuns<sseintvecmodelower><mode>2"
- [(set (match_dup 5)
- (float:VF1
- (match_operand:<sseintvecmode> 1 "nonimmediate_operand" "")))
- (set (match_dup 6)
- (lt:VF1 (match_dup 5) (match_dup 3)))
- (set (match_dup 7)
- (and:VF1 (match_dup 6) (match_dup 4)))
- (set (match_operand:VF1 0 "register_operand" "")
- (plus:VF1 (match_dup 5) (match_dup 7)))]
- "TARGET_SSE2"
-{
- REAL_VALUE_TYPE TWO32r;
- rtx x;
- int i;
-
- real_ldexp (&TWO32r, &dconst1, 32);
- x = const_double_from_real_value (TWO32r, SFmode);
-
- operands[3] = force_reg (<MODE>mode, CONST0_RTX (<MODE>mode));
- operands[4] = force_reg (<MODE>mode,
- ix86_build_const_vector (<MODE>mode, 1, x));
-
- for (i = 5; i < 8; i++)
- operands[i] = gen_reg_rtx (<MODE>mode);
+ [(match_operand:VF1 0 "register_operand" "")
+ (match_operand:<sseintvecmode> 1 "register_operand" "")]
+ "TARGET_SSE2 && (<MODE>mode == V4SFmode || TARGET_AVX2)"
+{
+ extern void ix86_expand_sse_movcc (rtx, rtx, rtx, rtx);
+
+ rtx tmp[9];
+ tmp[0] = gen_reg_rtx (<sseintvecmode>mode);
+ tmp[1] = force_reg (<sseintvecmode>mode, CONST0_RTX (<sseintvecmode>mode));
+ if (<sseintvecmode>mode == V4SImode)
+ emit_insn (gen_sse2_gtv4si3 (tmp[0], tmp[1], operands[1]));
+ else
+ emit_insn (gen_avx2_gtv8si3 (tmp[0], tmp[1], operands[1]));
+ tmp[1] = expand_simple_binop (<sseintvecmode>mode, LSHIFTRT,
+ operands[1], const1_rtx, NULL_RTX,
+ 1, OPTAB_DIRECT);
+ tmp[2] = force_reg (<sseintvecmode>mode,
+ ix86_build_const_vector (<sseintvecmode>mode,
+ 1, const1_rtx));
+ tmp[3] = expand_simple_binop (<sseintvecmode>mode, AND,
+ operands[1], tmp[2], NULL_RTX, 1,
+ OPTAB_DIRECT);
+ tmp[4] = expand_simple_binop (<sseintvecmode>mode, IOR,
+ tmp[1], tmp[3], NULL_RTX, 1, OPTAB_DIRECT);
+ tmp[5] = gen_reg_rtx (<sseintvecmode>mode);
+ ix86_expand_sse_movcc (tmp[5], tmp[0], tmp[4], operands[1]);
+ tmp[6] = gen_reg_rtx (<MODE>mode);
+ emit_insn (gen_float<sseintvecmodelower><mode>2 (tmp[6], tmp[5]));
+ tmp[7] = expand_simple_binop (<MODE>mode, AND,
+ gen_lowpart (<MODE>mode, tmp[0]), tmp[6],
+ NULL_RTX, 1, OPTAB_DIRECT);
+ tmp[8] = expand_simple_binop (<MODE>mode, PLUS, tmp[6], tmp[7], operands[0],
+ 1, OPTAB_DIRECT);
+ gcc_assert (tmp[8] == operands[0]);
+ DONE;
})
(define_insn "avx_cvtps2dq256"
@@ -205,7 +205,7 @@ main ()
inttoflttestsl ();
inttoflttestuc ();
inttoflttestus ();
-// inttoflttestui ();
+ inttoflttestui ();
inttoflttestul ();
return 0;
}