@@ -296,6 +296,7 @@ typedef enum S390Opcode {
296
296
VRRa_VUPH = 0xe7d7 ,
297
297
VRRa_VUPL = 0xe7d6 ,
298
298
VRRc_VX = 0xe76d ,
299
+ VRRe_VSEL = 0xe78d ,
299
300
VRRf_VLVGP = 0xe762 ,
300
301
301
302
VRSa_VERLL = 0xe733 ,
@@ -647,6 +648,18 @@ static void tcg_out_insn_VRRc(TCGContext *s, S390Opcode op,
647
648
tcg_out16 (s, (op & 0x00ff ) | RXB (v1, v2, v3, 0 ) | (m4 << 12 ));
648
649
}
649
650
651
+ static void tcg_out_insn_VRRe (TCGContext *s, S390Opcode op,
652
+ TCGReg v1, TCGReg v2, TCGReg v3, TCGReg v4)
653
+ {
654
+ tcg_debug_assert (is_vector_reg (v1));
655
+ tcg_debug_assert (is_vector_reg (v2));
656
+ tcg_debug_assert (is_vector_reg (v3));
657
+ tcg_debug_assert (is_vector_reg (v4));
658
+ tcg_out16 (s, (op & 0xff00 ) | ((v1 & 0xf ) << 4 ) | (v2 & 0xf ));
659
+ tcg_out16 (s, v3 << 12 );
660
+ tcg_out16 (s, (op & 0x00ff ) | RXB (v1, v2, v3, v4) | (v4 << 12 ));
661
+ }
662
+
650
663
static void tcg_out_insn_VRRf (TCGContext *s, S390Opcode op,
651
664
TCGReg v1, TCGReg r2, TCGReg r3)
652
665
{
@@ -2787,6 +2800,10 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
2787
2800
tcg_out_insn (s, VRRc, VMXL, a0, a1, a2, vece);
2788
2801
break ;
2789
2802
2803
+ case INDEX_op_bitsel_vec:
2804
+ tcg_out_insn (s, VRRe, VSEL, a0, a1, a2, args[3 ]);
2805
+ break ;
2806
+
2790
2807
case INDEX_op_cmp_vec:
2791
2808
switch ((TCGCond)args[3 ]) {
2792
2809
case TCG_COND_EQ:
@@ -2827,6 +2844,7 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece)
2827
2844
case INDEX_op_add_vec:
2828
2845
case INDEX_op_and_vec:
2829
2846
case INDEX_op_andc_vec:
2847
+ case INDEX_op_bitsel_vec:
2830
2848
case INDEX_op_neg_vec:
2831
2849
case INDEX_op_not_vec:
2832
2850
case INDEX_op_or_vec:
@@ -3168,6 +3186,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op)
3168
3186
case INDEX_op_shrs_vec:
3169
3187
case INDEX_op_sars_vec:
3170
3188
return C_O1_I2 (v, v, r);
3189
+ case INDEX_op_bitsel_vec:
3190
+ return C_O1_I3 (v, v, v, v);
3171
3191
3172
3192
default :
3173
3193
g_assert_not_reached ();
0 commit comments