{
op_true = force_reg (mode, op_true);
- gen = gen_mmx_pblendvb64;
+ gen = gen_mmx_pblendvb_v8qi;
if (mode != V8QImode)
d = gen_reg_rtx (V8QImode);
op_false = gen_lowpart (V8QImode, op_false);
{
op_true = force_reg (mode, op_true);
- gen = gen_mmx_pblendvb32;
+ gen = gen_mmx_pblendvb_v4qi;
if (mode != V4QImode)
d = gen_reg_rtx (V4QImode);
op_false = gen_lowpart (V4QImode, op_false);
cmp = gen_lowpart (V4QImode, cmp);
}
break;
+ case E_V2QImode:
+ if (TARGET_SSE4_1)
+ {
+ op_true = force_reg (mode, op_true);
+
+ gen = gen_mmx_pblendvb_v2qi;
+ }
+ break;
case E_V16QImode:
case E_V8HImode:
case E_V8HFmode:
vperm = force_reg (vmode, vperm);
if (GET_MODE_SIZE (vmode) == 4)
- emit_insn (gen_mmx_pblendvb32 (target, op0, op1, vperm));
+ emit_insn (gen_mmx_pblendvb_v4qi (target, op0, op1, vperm));
else if (GET_MODE_SIZE (vmode) == 8)
- emit_insn (gen_mmx_pblendvb64 (target, op0, op1, vperm));
+ emit_insn (gen_mmx_pblendvb_v8qi (target, op0, op1, vperm));
else if (GET_MODE_SIZE (vmode) == 16)
emit_insn (gen_sse4_1_pblendvb (target, op0, op1, vperm));
else
})
(define_expand "vcond<mode><mode>"
- [(set (match_operand:VI_32 0 "register_operand")
- (if_then_else:VI_32
+ [(set (match_operand:VI_16_32 0 "register_operand")
+ (if_then_else:VI_16_32
(match_operator 3 ""
- [(match_operand:VI_32 4 "register_operand")
- (match_operand:VI_32 5 "register_operand")])
- (match_operand:VI_32 1)
- (match_operand:VI_32 2)))]
- "TARGET_SSE2"
+ [(match_operand:VI_16_32 4 "register_operand")
+ (match_operand:VI_16_32 5 "register_operand")])
+ (match_operand:VI_16_32 1)
+ (match_operand:VI_16_32 2)))]
+ "TARGET_SSE4_1"
{
bool ok = ix86_expand_int_vcond (operands);
gcc_assert (ok);
})
(define_expand "vcondu<mode><mode>"
- [(set (match_operand:VI_32 0 "register_operand")
- (if_then_else:VI_32
+ [(set (match_operand:VI_16_32 0 "register_operand")
+ (if_then_else:VI_16_32
(match_operator 3 ""
- [(match_operand:VI_32 4 "register_operand")
- (match_operand:VI_32 5 "register_operand")])
- (match_operand:VI_32 1)
- (match_operand:VI_32 2)))]
- "TARGET_SSE2"
+ [(match_operand:VI_16_32 4 "register_operand")
+ (match_operand:VI_16_32 5 "register_operand")])
+ (match_operand:VI_16_32 1)
+ (match_operand:VI_16_32 2)))]
+ "TARGET_SSE4_1"
{
bool ok = ix86_expand_int_vcond (operands);
gcc_assert (ok);
})
(define_expand "vcond_mask_<mode><mode>"
- [(set (match_operand:VI_32 0 "register_operand")
- (vec_merge:VI_32
- (match_operand:VI_32 1 "register_operand")
- (match_operand:VI_32 2 "register_operand")
- (match_operand:VI_32 3 "register_operand")))]
- "TARGET_SSE2"
+ [(set (match_operand:VI_16_32 0 "register_operand")
+ (vec_merge:VI_16_32
+ (match_operand:VI_16_32 1 "register_operand")
+ (match_operand:VI_16_32 2 "register_operand")
+ (match_operand:VI_16_32 3 "register_operand")))]
+ "TARGET_SSE4_1"
{
ix86_expand_sse_movcc (operands[0], operands[3],
operands[1], operands[2]);
DONE;
})
-(define_insn "mmx_pblendvb64"
+(define_insn "mmx_pblendvb_v8qi"
[(set (match_operand:V8QI 0 "register_operand" "=Yr,*x,x")
(unspec:V8QI
[(match_operand:V8QI 1 "register_operand" "0,0,x")
(set_attr "btver2_decode" "vector")
(set_attr "mode" "TI")])
-(define_insn "mmx_pblendvb32"
- [(set (match_operand:V4QI 0 "register_operand" "=Yr,*x,x")
- (unspec:V4QI
- [(match_operand:V4QI 1 "register_operand" "0,0,x")
- (match_operand:V4QI 2 "register_operand" "Yr,*x,x")
- (match_operand:V4QI 3 "register_operand" "Yz,Yz,x")]
+(define_insn "mmx_pblendvb_<mode>"
+ [(set (match_operand:VI_16_32 0 "register_operand" "=Yr,*x,x")
+ (unspec:VI_16_32
+ [(match_operand:VI_16_32 1 "register_operand" "0,0,x")
+ (match_operand:VI_16_32 2 "register_operand" "Yr,*x,x")
+ (match_operand:VI_16_32 3 "register_operand" "Yz,Yz,x")]
UNSPEC_BLENDV))]
"TARGET_SSE4_1"
"@
--- /dev/null
+/* PR target/103861 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse4" } */
+
+typedef unsigned char __attribute__((__vector_size__ (2))) __v2qu;
+typedef char __attribute__((__vector_size__ (2))) __v2qi;
+
+__v2qu au, bu;
+__v2qi as, bs;
+
+__v2qu uu (__v2qu a, __v2qu b) { return (a > b) ? au : bu; }
+__v2qu us (__v2qi a, __v2qi b) { return (a > b) ? au : bu; }
+__v2qi su (__v2qu a, __v2qu b) { return (a > b) ? as : bs; }
+__v2qi ss (__v2qi a, __v2qi b) { return (a > b) ? as : bs; }
+
+/* { dg-final { scan-assembler-times "pcmpeqb" 2 } } */
+/* { dg-final { scan-assembler-times "pcmpgtb" 2 } } */