else
{
HOST_WIDE_INT val = trunc_int_for_mode (INTVAL (value), DImode);
- return (HOST_WIDE_INT)(int)val == val;
+ return trunc_int_for_mode (val, SImode) == val;
}
break;
if (((TARGET_SSE && GET_MODE (operands[0]) == SFmode)
|| (TARGET_SSE2 && GET_MODE (operands[0]) == DFmode))
&& GET_MODE (ix86_compare_op0) == GET_MODE (operands[0])
+ /* The SSE comparisons does not support the LTGT/UNEQ pair. */
+ && (!TARGET_IEEE_FP
+ || (GET_CODE (operands[1]) != LTGT && GET_CODE (operands[1]) != UNEQ))
/* We may be called from the post-reload splitter. */
&& (!REG_P (operands[0])
|| SSE_REG_P (operands[0])
ix86_compare_op1);
}
/* Similary try to manage result to be first operand of conditional
- move. */
- if (rtx_equal_p (operands[0], operands[3]))
+ move. We also don't support the NE comparison on SSE, so try to
+ avoid it. */
+ if (rtx_equal_p (operands[0], operands[3])
+ || GET_CODE (operands[1]) == NE)
{
rtx tmp = operands[2];
operands[2] = operands[3];
;; based moves emulation or to usual cmove sequence. Little bit unfortunate
;; fact is that compares supported by the cmp??ss instructions are exactly
;; swapped of those supported by cmove sequence.
+;; The EQ/NE comparisons also needs bit care, since they are not directly
+;; supported by i387 comparisons and we do need to emit two conditional moves
+;; in tandem.
(define_insn "sse_movsfcc"
[(set (match_operand:SF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?f#xr,?f#xr,?r#xf,?r#xf,?r#xf,?r#xf")
(match_operand:SF 3 "nonimmediate_operand" "x#fr,x#fr,0#fx,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx")))
(clobber (match_scratch:SF 6 "=2,&4,X,X,X,X,X,X,X,X"))
(clobber (reg:CC 17))]
+ "TARGET_SSE
+ && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)
+ && (!TARGET_IEEE_FP
+ || (GET_CODE (operands[1]) != EQ && GET_CODE (operands[1]) != NE))"
+ "#")
+
+(define_insn "sse_movsfcc_eq"
+ [(set (match_operand:SF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?r#xf,?r#xf")
+ (if_then_else:SF (eq (match_operand:SF 3 "nonimmediate_operand" "%0#fx,x#fx,f#x,xm#f,f#x,xm#f")
+ (match_operand:SF 4 "nonimmediate_operand" "xm#f,xm#f,f#x,x#f,f#x,x#f"))
+ (match_operand:SF 1 "nonimmediate_operand" "x#fr,0#fr,0#fx,0#fx,0#rx,0#rx")
+ (match_operand:SF 2 "nonimmediate_operand" "x#fr,x#fr,f#fx,f#fx,rm#rx,rm#rx")))
+ (clobber (match_scratch:SF 5 "=1,&4,X,X,X,X"))
+ (clobber (reg:CC 17))]
"TARGET_SSE
&& (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)"
"#")
(clobber (match_scratch:DF 6 "=2,&4,X,X,X,X,X,X,X,X"))
(clobber (reg:CC 17))]
"TARGET_SSE2
+ && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)
+ && (!TARGET_IEEE_FP
+ || (GET_CODE (operands[1]) != EQ && GET_CODE (operands[1]) != NE))"
+ "#")
+
+(define_insn "sse_movdfcc_eq"
+ [(set (match_operand:DF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?r#xf,?r#xf")
+ (if_then_else:DF (eq (match_operand:DF 3 "nonimmediate_operand" "%0#fx,x#fx,f#x,xm#f,f#x,xm#f")
+ (match_operand:DF 4 "nonimmediate_operand" "xm#f,xm#f,f#x,x#f,f#x,x#f"))
+ (match_operand:DF 1 "nonimmediate_operand" "x#fr,0#fr,0#fx,0#fx,0#rx,0#rx")
+ (match_operand:DF 2 "nonimmediate_operand" "x#fr,x#fr,f#fx,f#fx,rm#rx,rm#rx")))
+ (clobber (match_scratch:DF 5 "=1,&3,X,X,X,X"))
+ (clobber (reg:CC 17))]
+ "TARGET_SSE
&& (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)"
"#")