e2k: Add pmulhrsh instr.

This commit is contained in:
Denis Drakhnia 2021-01-16 16:30:10 +02:00 committed by Denis Drakhnia
parent 9440e28b68
commit 2e0f2dce66
3 changed files with 4 additions and 1 deletions

View File

@ -95,6 +95,7 @@ DEF_HELPER_2(pmulhh, i64, i64, i64)
DEF_HELPER_2(pmullh, i64, i64, i64)
DEF_HELPER_2(pmulhuh, i64, i64, i64)
DEF_HELPER_2(pmulubhh, i64, i64, i64)
DEF_HELPER_2(pmulhrsh, i64, i64, i64)
/* Packed Sign Mul */
DEF_HELPER_2(psignb, i64, i64, i64)

View File

@ -39,6 +39,7 @@ typedef union {
#define ident(x) x
#define shr16(x) ((x) >> 16)
#define shr14_add1_shr1(x) ((((x) >> 14) + 1) >> 1)
#define and16(x) ((x) & 0xffff)
#define satsb(x) MIN(MAX(x, -128), 127)
#define satsh(x) MIN(MAX(x, -32768), 32767)
@ -183,6 +184,7 @@ GEN_HELPER_PACKED(pavgush, uh, { dst.uh[i] = (s1.uh[i] + s2.uh[i] + 1) >> 1; })
GEN_HELPER_PACKED_MULH(pmulhh, sh, int32_t, shr16)
GEN_HELPER_PACKED_MULH(pmullh, sh, int32_t, and16)
GEN_HELPER_PACKED_MULH(pmulhuh, uh, uint32_t, shr16)
GEN_HELPER_PACKED_MULH(pmulhrsh, sh, int32_t, shr14_add1_shr1)
GEN_HELPER_PACKED(pmulubhh, uh, { \
dst.uh[i] = (((int16_t) s1.ub[i] * s2.sh[i]) + s1.ub[i]) >> 8; \

View File

@ -3110,6 +3110,7 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_PMULLH: gen_alopf1_ddd(instr, gen_helper_pmullh); break;
case OP_PMULHUH: gen_alopf1_ddd(instr, gen_helper_pmulhuh); break;
case OP_PMULUBHH: gen_alopf1_ddd(instr, gen_helper_pmulubhh); break;
case OP_PMULHRSH: gen_alopf1_ddd(instr, gen_helper_pmulhrsh); 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;
@ -3443,7 +3444,6 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_PFADDSUBS:
case OP_PFSTOIFS:
case OP_PFDTOIFD:
case OP_PMULHRSH:
case OP_PHMINPOSUH:
case OP_PUTTST:
case OP_FSCALES: