e2k: Add pmulhh, pmulhuh and pmullh instrs.

This commit is contained in:
Denis Drakhnia 2021-01-16 01:58:45 +02:00 committed by Denis Drakhnia
parent e777b64356
commit 7fa077d557
3 changed files with 16 additions and 3 deletions

View File

@ -83,6 +83,9 @@ DEF_HELPER_2(psraw, i64, i64, i64)
/* Packed Mul */
DEF_HELPER_2(pmaddh, i64, i64, i64)
DEF_HELPER_2(pmaddubsh, i64, i64, i64)
DEF_HELPER_2(pmulhh, i64, i64, i64)
DEF_HELPER_2(pmullh, i64, i64, i64)
DEF_HELPER_2(pmulhuh, i64, i64, i64)
/* Packed uncategorized */
DEF_HELPER_2(psadbw, i64, i64, i64)

View File

@ -215,6 +215,16 @@ GEN_HELPER_PACKED(psadbw, ub, { dst.uw[0] += s1.ub[i] - s2.ub[i]; })
GEN_HELPER_PACKED(pavgusb, ub, { dst.ub[i] = (s1.ub[i] + s2.ub[i] + 1) >> 1; })
GEN_HELPER_PACKED(pavgush, uh, { dst.uh[i] = (s1.uh[i] + s2.uh[i] + 1) >> 1; })
GEN_HELPER_PACKED(pmulhh, sh, { \
dst.sh[i] = ((int32_t) s1.sh[i] * s2.sh[i]) >> 16; \
})
GEN_HELPER_PACKED(pmullh, sh, { \
dst.sh[i] = ((int32_t) s1.sh[i] * s2.sh[i]) & 0xffff; \
})
GEN_HELPER_PACKED(pmulhuh, uh, { \
dst.uh[i] = ((uint32_t) s1.uh[i] * s2.uh[i]) >> 16; \
})
uint64_t HELPER(pmovmskb)(uint64_t src1, uint64_t src2)
{
int i;

View File

@ -3057,6 +3057,9 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_PSUBSH: gen_alopf1_ddd(instr, gen_helper_psubsh); break;
case OP_PSUBUSB: gen_alopf1_ddd(instr, gen_helper_psubusb); break;
case OP_PSUBUSH: gen_alopf1_ddd(instr, gen_helper_psubush); break;
case OP_PMULHH: gen_alopf1_ddd(instr, gen_helper_pmulhh); break;
case OP_PMULLH: gen_alopf1_ddd(instr, gen_helper_pmullh); break;
case OP_PMULHUH: gen_alopf1_ddd(instr, gen_helper_pmulhuh); break;
case OP_PMADDH: gen_alopf1_ddd(instr, gen_helper_pmaddh); break;
case OP_PMADDUBSH: gen_alopf1_ddd(instr, gen_helper_pmaddubsh); break;
case OP_PSADBW: gen_alopf1_ddd(instr, gen_helper_psadbw); break;
@ -3228,9 +3231,6 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_FSQRTTD:
case OP_PFMULS:
case OP_PFMULD:
case OP_PMULHUH:
case OP_PMULHH:
case OP_PMULLH:
case OP_PFADDS:
case OP_PFADDD:
case OP_PFSUBS: