|
|
|
@ -1514,32 +1514,6 @@ static void tgen_movcond(TCGContext *s, TCGType type, TCGCond c, TCGReg dest, |
|
|
|
tgen_movcond_int(s, type, dest, v3, v3const, v4, cc, inv_cc); |
|
|
|
} |
|
|
|
|
|
|
|
static void tgen_ctpop(TCGContext *s, TCGType type, TCGReg dest, TCGReg src) |
|
|
|
{ |
|
|
|
/* With MIE3, and bit 0 of m4 set, we get the complete result. */ |
|
|
|
if (HAVE_FACILITY(MISC_INSN_EXT3)) { |
|
|
|
if (type == TCG_TYPE_I32) { |
|
|
|
tcg_out_ext32u(s, dest, src); |
|
|
|
src = dest; |
|
|
|
} |
|
|
|
tcg_out_insn(s, RRFc, POPCNT, dest, src, 8); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
/* Without MIE3, each byte gets the count of bits for the byte. */ |
|
|
|
tcg_out_insn(s, RRFc, POPCNT, dest, src, 0); |
|
|
|
|
|
|
|
/* Multiply to sum each byte at the top of the word. */ |
|
|
|
if (type == TCG_TYPE_I32) { |
|
|
|
tcg_out_insn(s, RIL, MSFI, dest, 0x01010101); |
|
|
|
tcg_out_sh32(s, RS_SRL, dest, TCG_REG_NONE, 24); |
|
|
|
} else { |
|
|
|
tcg_out_movi(s, TCG_TYPE_I64, TCG_TMP0, 0x0101010101010101ull); |
|
|
|
tcg_out_insn(s, RRE, MSGR, dest, TCG_TMP0); |
|
|
|
tcg_out_sh64(s, RSY_SRLG, dest, dest, TCG_REG_NONE, 56); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static void tgen_deposit(TCGContext *s, TCGReg dest, TCGReg src, |
|
|
|
int ofs, int len, int z) |
|
|
|
{ |
|
|
|
@ -2268,6 +2242,37 @@ static const TCGOutOpBinary outop_clz = { |
|
|
|
.out_rri = tgen_clzi, |
|
|
|
}; |
|
|
|
|
|
|
|
static void tgen_ctpop(TCGContext *s, TCGType type, TCGReg dest, TCGReg src) |
|
|
|
{ |
|
|
|
/* With MIE3, and bit 0 of m4 set, we get the complete result. */ |
|
|
|
if (HAVE_FACILITY(MISC_INSN_EXT3)) { |
|
|
|
if (type == TCG_TYPE_I32) { |
|
|
|
tcg_out_ext32u(s, dest, src); |
|
|
|
src = dest; |
|
|
|
} |
|
|
|
tcg_out_insn(s, RRFc, POPCNT, dest, src, 8); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
/* Without MIE3, each byte gets the count of bits for the byte. */ |
|
|
|
tcg_out_insn(s, RRFc, POPCNT, dest, src, 0); |
|
|
|
|
|
|
|
/* Multiply to sum each byte at the top of the word. */ |
|
|
|
if (type == TCG_TYPE_I32) { |
|
|
|
tcg_out_insn(s, RIL, MSFI, dest, 0x01010101); |
|
|
|
tcg_out_sh32(s, RS_SRL, dest, TCG_REG_NONE, 24); |
|
|
|
} else { |
|
|
|
tcg_out_movi(s, TCG_TYPE_I64, TCG_TMP0, 0x0101010101010101ull); |
|
|
|
tcg_out_insn(s, RRE, MSGR, dest, TCG_TMP0); |
|
|
|
tcg_out_sh64(s, RSY_SRLG, dest, dest, TCG_REG_NONE, 56); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static const TCGOutOpUnary outop_ctpop = { |
|
|
|
.base.static_constraint = C_O1_I1(r, r), |
|
|
|
.out_rr = tgen_ctpop, |
|
|
|
}; |
|
|
|
|
|
|
|
static const TCGOutOpBinary outop_ctz = { |
|
|
|
.base.static_constraint = C_NotImplemented, |
|
|
|
}; |
|
|
|
@ -2914,13 +2919,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, |
|
|
|
tgen_sextract(s, args[0], args[1], args[2], args[3]); |
|
|
|
break; |
|
|
|
|
|
|
|
case INDEX_op_ctpop_i32: |
|
|
|
tgen_ctpop(s, TCG_TYPE_I32, args[0], args[1]); |
|
|
|
break; |
|
|
|
case INDEX_op_ctpop_i64: |
|
|
|
tgen_ctpop(s, TCG_TYPE_I64, args[0], args[1]); |
|
|
|
break; |
|
|
|
|
|
|
|
case INDEX_op_mb: |
|
|
|
/* The host memory model is quite strong, we simply need to |
|
|
|
serialize the instruction stream. */ |
|
|
|
@ -3429,8 +3427,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
|
|
|
case INDEX_op_extract_i64: |
|
|
|
case INDEX_op_sextract_i32: |
|
|
|
case INDEX_op_sextract_i64: |
|
|
|
case INDEX_op_ctpop_i32: |
|
|
|
case INDEX_op_ctpop_i64: |
|
|
|
return C_O1_I1(r, r); |
|
|
|
|
|
|
|
case INDEX_op_qemu_ld_i32: |
|
|
|
|