+2007-10-10 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline:
+ 2007-09-14 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/33438
+ * config/i386/i386.md (fmodxf3): Copy operands[2] to temporary
+ register when operands[2] equals operands[1].
+ (dremxf3): Ditto.
+
+ 2007-09-10 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/33369
+ * gcc/config/i386/sse.md (ashr<mode>3): Change op2 mode to SImode.
+ Use 'N' operand constraint for op2.
+ (lshr<mode>3): Ditto.
+ (ashl<mode>3): Ditto.
+ (vec_shl_<mode>): Use const_0_to_255_mul_8_operand predicate for op2.
+ (vec_shr_<mode>): Use const_0_to_255_mul_8_operand predicate for op2.
+
+ * gcc/config/i386/i386.c (ix86_expand_builtin) [IX86_BUILTIN_PSLL?128,
+ IX86_BUILTIN_PSRA*?128, IX86_BUILTIN_PSRL?128]: Convert op1 to SImode.
+
2007-10-10 Richard Guenther <rguenther@suse.de>
- Backport from mainline
+ Backport from mainline:
2007-10-03 Doug Kwan <dougkwan@google.com>
Richard Guenther <rguenther@suse.de>
if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
op0 = copy_to_reg (op0);
- op1 = simplify_gen_subreg (TImode, op1, GET_MODE (op1), 0);
- if (! (*insn_data[icode].operand[2].predicate) (op1, TImode))
+ op1 = simplify_gen_subreg (SImode, op1, GET_MODE (op1), 0);
+ if (! (*insn_data[icode].operand[2].predicate) (op1, SImode))
op1 = copy_to_reg (op1);
target = gen_reg_rtx (tmode);
{
rtx label = gen_label_rtx ();
- emit_label (label);
+ rtx op2;
- emit_insn (gen_fpremxf4 (operands[1], operands[2],
- operands[1], operands[2]));
+ if (rtx_equal_p (operands[1], operands[2]))
+ {
+ op2 = gen_reg_rtx (XFmode);
+ emit_move_insn (op2, operands[2]);
+ }
+ else
+ op2 = operands[2];
+
+ emit_label (label);
+ emit_insn (gen_fpremxf4 (operands[1], op2, operands[1], op2));
ix86_emit_fp_unordered_jump (label);
+ LABEL_NUSES (label) = 1;
emit_move_insn (operands[0], operands[1]);
DONE;
{
rtx label = gen_label_rtx ();
- emit_label (label);
+ rtx op2;
- emit_insn (gen_fprem1xf4 (operands[1], operands[2],
- operands[1], operands[2]));
+ if (rtx_equal_p (operands[1], operands[2]))
+ {
+ op2 = gen_reg_rtx (XFmode);
+ emit_move_insn (op2, operands[2]);
+ }
+ else
+ op2 = operands[2];
+
+ emit_label (label);
+ emit_insn (gen_fprem1xf4 (operands[1], op2, operands[1], op2));
ix86_emit_fp_unordered_jump (label);
+ LABEL_NUSES (label) = 1;
emit_move_insn (operands[0], operands[1]);
DONE;
[(set (match_operand:SSEMODE24 0 "register_operand" "=x")
(ashiftrt:SSEMODE24
(match_operand:SSEMODE24 1 "register_operand" "0")
- (match_operand:TI 2 "nonmemory_operand" "xn")))]
+ (match_operand:SI 2 "nonmemory_operand" "xN")))]
"TARGET_SSE2"
"psra<ssevecsize>\t{%2, %0|%0, %2}"
[(set_attr "type" "sseishft")
[(set (match_operand:SSEMODE248 0 "register_operand" "=x")
(lshiftrt:SSEMODE248
(match_operand:SSEMODE248 1 "register_operand" "0")
- (match_operand:TI 2 "nonmemory_operand" "xn")))]
+ (match_operand:SI 2 "nonmemory_operand" "xN")))]
"TARGET_SSE2"
"psrl<ssevecsize>\t{%2, %0|%0, %2}"
[(set_attr "type" "sseishft")
[(set (match_operand:SSEMODE248 0 "register_operand" "=x")
(ashift:SSEMODE248
(match_operand:SSEMODE248 1 "register_operand" "0")
- (match_operand:TI 2 "nonmemory_operand" "xn")))]
+ (match_operand:SI 2 "nonmemory_operand" "xN")))]
"TARGET_SSE2"
"psll<ssevecsize>\t{%2, %0|%0, %2}"
[(set_attr "type" "sseishft")
(define_expand "vec_shl_<mode>"
[(set (match_operand:SSEMODEI 0 "register_operand" "")
(ashift:TI (match_operand:SSEMODEI 1 "register_operand" "")
- (match_operand:SI 2 "general_operand" "")))]
+ (match_operand:SI 2 "const_0_to_255_mul_8_operand" "")))]
"TARGET_SSE2"
{
- if (!const_0_to_255_mul_8_operand (operands[2], SImode))
- FAIL;
operands[0] = gen_lowpart (TImode, operands[0]);
operands[1] = gen_lowpart (TImode, operands[1]);
})
(define_expand "vec_shr_<mode>"
[(set (match_operand:SSEMODEI 0 "register_operand" "")
(lshiftrt:TI (match_operand:SSEMODEI 1 "register_operand" "")
- (match_operand:SI 2 "general_operand" "")))]
+ (match_operand:SI 2 "const_0_to_255_mul_8_operand" "")))]
"TARGET_SSE2"
{
- if (!const_0_to_255_mul_8_operand (operands[2], SImode))
- FAIL;
operands[0] = gen_lowpart (TImode, operands[0]);
operands[1] = gen_lowpart (TImode, operands[1]);
})
+2007-10-10 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline:
+ 2007-09-14 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/33438
+ * gcc.target/i386/pr33438.c: New test.
+
+ 2007-09-10 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/33369
+ * gcc.dg/vect/pr33369.c: New test.
+
2007-10-10 Richard Guenther <rguenther@suse.de>
- Backport from mainline
+ Backport from mainline:
2007-10-03 Doug Kwan <dougkwan@google.com>
Richard Guenther <rguenther@suse.de>
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_shift } */
+
+typedef struct tagPOINT
+{
+ int x;
+ int y;
+} POINT;
+
+void
+f (POINT * ptBuf)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ ptBuf[i].x = ((ptBuf[i].x) << 4);
+ ptBuf[i].y = ((ptBuf[i].y) << 4);
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+long double f1 (long double x)
+{
+ return __builtin_fmodl (x, x);
+}
+
+long double f2 (long double x)
+{
+ return __builtin_remainderl (x, x);
+}