e2k: Add psra{h,w} instrs.

This commit is contained in:
Denis Drakhnia 2021-01-16 00:23:31 +02:00 committed by Denis Drakhnia
parent c559bfb032
commit 7cb77dbe33
3 changed files with 15 additions and 3 deletions

View File

@ -76,6 +76,10 @@ DEF_HELPER_2(psllw, i64, i64, i64)
DEF_HELPER_2(psrlh, i64, i64, i64)
DEF_HELPER_2(psrlw, i64, i64, i64)
/* Packed shifts with sign */
DEF_HELPER_2(psrah, i64, i64, i64)
DEF_HELPER_2(psraw, i64, i64, i64)
/* Float 32/64 Ops */
#define DEF_HELPER_3_32_64(name) \
DEF_HELPER_3(name##s, i32, env, i32, i32) \

View File

@ -183,6 +183,14 @@ GEN_HELPER_PACKED_SCALAR_BINOP(psllw, uw, <<)
GEN_HELPER_PACKED_SCALAR_BINOP(psrlh, uh, >>)
GEN_HELPER_PACKED_SCALAR_BINOP(psrlw, uw, >>)
#define GEN_HELPER_PACKED_SRA(name, type, t) \
GEN_HELPER_PACKED_SCALAR(name, type, { \
dst.type[i] = (t) s1.type[i] >> s2; \
})
GEN_HELPER_PACKED_SRA(psrah, sh, int32_t)
GEN_HELPER_PACKED_SRA(psraw, sw, int64_t)
uint64_t HELPER(pmovmskb)(uint64_t src1, uint64_t src2)
{
unsigned int i;

View File

@ -3058,7 +3058,9 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_PSLLD: gen_alopf1_ddd(instr, tcg_gen_shl_i64); break;
case OP_PSRLH: gen_alopf1_ddd(instr, gen_helper_psrlh); break;
case OP_PSRLW: gen_alopf1_ddd(instr, gen_helper_psrlw); break;
case OP_PSRLD: gen_alopf1_ddd(instr, tcg_gen_shr_i64); break;
case OP_PSRLD: gen_alopf1_ddd(instr, tcg_gen_shr_i64); break;
case OP_PSRAH: gen_alopf1_ddd(instr, gen_helper_psrah); break;
case OP_PSRAW: gen_alopf1_ddd(instr, gen_helper_psraw); break;
case OP_PSLLQL: gen_alopf11_dddi(instr, gen_psllql); break;
case OP_PSLLQH: gen_alopf11_dddi(instr, gen_psllqh); break;
case OP_PSRLQL: gen_alopf11_dddi(instr, gen_psrlql); break;
@ -3222,8 +3224,6 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_PMULHH:
case OP_PMULLH:
case OP_PMADDH:
case OP_PSRAW:
case OP_PSRAH:
case OP_PFADDS:
case OP_PFADDD:
case OP_PFSUBS: