e2k: Add pextrh instr.

This commit is contained in:
Denis Drakhnia 2021-01-16 10:42:17 +02:00 committed by Denis Drakhnia
parent 7b06c53816
commit c998387f79
1 changed files with 13 additions and 1 deletions

View File

@ -1898,6 +1898,18 @@ static inline void gen_pinsh(TCGv_i64 ret, TCGv_i64 src1,
}
}
static inline void gen_pextrh(TCGv_i64 ret, TCGv_i64 src1,
TCGv_i64 src2, int i)
{
if (i < 4) {
tcg_gen_extract_i64(ret, src2, i * 16, 16);
} else if (i < 8) {
tcg_gen_extract_i64(ret, src1, (i - 4) * 16, 16);
} else {
tcg_gen_movi_i64(ret, 0);
}
}
static void gen_aad_tag(TCGv_i64 ret, TCGv_i32 tag)
{
TCGv_i32 t0 = tcg_temp_new_i32();
@ -3088,6 +3100,7 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_PSRLQL: gen_alopf11_dddi(instr, gen_psrlql); break;
case OP_PSRLQH: gen_alopf11_dddi(instr, gen_psrlqh); break;
case OP_PINSH: gen_alopf11_dddi(instr, gen_pinsh); break;
case OP_PEXTRH: gen_alopf11_dddi(instr, gen_pextrh); break;
case OP_GETTAGS: gen_gettag_i32(instr); break;
case OP_GETTAGD: gen_gettag_i64(instr); break;
case OP_PUTTAGS: gen_puttag_i32(instr); break;
@ -3258,7 +3271,6 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_PFMAXS:
case OP_PFMAXD:
case OP_PFSQRTTD:
case OP_PEXTRH:
case OP_CAST:
case OP_TDTOMP:
case OP_ODTOAP: