&& SUBREG_P (op1)
&& GET_MODE (SUBREG_REG (op1)) == TImode
&& TARGET_64BIT && TARGET_SSE
- && can_create_pseudo_p ())
+ && ix86_pre_reload_split ())
{
rtx tmp = gen_reg_rtx (V2DImode);
rtx lo = gen_reg_rtx (DImode);
if (!(INTEGER_CLASS_P (class1) || INTEGER_CLASS_P (class2)))
return true;
+ /* If the target says that inter-unit moves are more expensive
+ than moving through memory, then don't generate them. */
+ if ((SSE_CLASS_P (class1) && !TARGET_INTER_UNIT_MOVES_FROM_VEC)
+ || (SSE_CLASS_P (class2) && !TARGET_INTER_UNIT_MOVES_TO_VEC))
+ return true;
+
+ /* With SSE4.1, *mov{ti,di}_internal supports moves between
+ SSE_REGS and GENERAL_REGS using pinsr{q,d} or pextr{q,d}. */
+ if (TARGET_SSE4_1
+ && (TARGET_64BIT ? mode == TImode : mode == DImode))
+ return false;
+
int msize = GET_MODE_SIZE (mode);
/* Between SSE and general, we have moves no larger than word size. */
if (msize < minsize)
return true;
-
- /* If the target says that inter-unit moves are more expensive
- than moving through memory, then don't generate them. */
- if ((SSE_CLASS_P (class1) && !TARGET_INTER_UNIT_MOVES_FROM_VEC)
- || (SSE_CLASS_P (class2) && !TARGET_INTER_UNIT_MOVES_TO_VEC))
- return true;
}
return false;
DONE;
})
+(define_peephole2
+ [(set (match_operand:DI 0 "general_reg_operand")
+ (match_operand:DI 1 "general_reg_operand"))
+ (parallel [(set (match_dup 0)
+ (ashiftrt:DI (match_dup 0)
+ (const_int 63)))
+ (clobber (reg:CC FLAGS_REG))])
+ (set (match_operand:DI 2 "general_reg_operand") (match_dup 1))
+ (set (match_operand:DI 3 "general_reg_operand") (match_dup 0))]
+ "(optimize_function_for_size_p (cfun) || TARGET_USE_CLTD)
+ && REGNO (operands[2]) == AX_REG
+ && REGNO (operands[3]) == DX_REG
+ && peep2_reg_dead_p (4, operands[0])
+ && !reg_mentioned_p (operands[0], operands[1])
+ && !reg_mentioned_p (operands[2], operands[0])"
+ [(set (match_dup 2) (match_dup 1))
+ (parallel [(set (match_dup 3) (ashiftrt:DI (match_dup 2) (const_int 63)))
+ (clobber (reg:CC FLAGS_REG))])])
+
(define_insn "extend<mode>di2"
[(set (match_operand:DI 0 "register_operand" "=r")
(sign_extend:DI
return (x & 1000) * (y & 1000);
}
-/* { dg-final { scan-assembler-times "\tmulq" 1 } } */
+/* { dg-final { scan-assembler-times "\tmul\[qx\]" 1 } } */
/* { dg-final { scan-assembler-times "\timulq" 1 } } */
/* { dg-final { scan-assembler-not "addq" } } */
/* { dg-final { scan-assembler-not "xorl" } } */
--- /dev/null
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -fno-vect-cost-model -msse4.1" } */
+
+struct aq { long x,y; };
+long testq(struct aq a) { return a.x+a.y; }
+
+struct aw { short a0,a1,a2,a3,a4,a5,a6,a7; };
+short testw(struct aw a) { return a.a0+a.a1+a.a2+a.a3+a.a4+a.a5+a.a6+a.a7; }
+
+struct ad { int x,y,z,w; };
+int testd(struct ad a) { return a.x+a.y+a.z+a.w; }
+/* { dg-final { scan-assembler-not "%rsp" } } */