e2k: Add mpsadbh instr.

This commit is contained in:
Denis Drakhnia 2021-01-16 17:39:36 +02:00 committed by Denis Drakhnia
parent d2b6bb3f9c
commit acc2f18f97
3 changed files with 9 additions and 1 deletions

View File

@ -131,6 +131,7 @@ DEF_HELPER_2(psadbw, i64, i64, i64)
DEF_HELPER_2(pavgusb, i64, i64, i64)
DEF_HELPER_2(pavgush, i64, i64, i64)
DEF_HELPER_2(phminposuh, i64, i64, i64)
DEF_HELPER_2(mpsadbh, i64, i64, i64)
/* Float 32/64 Ops */
#define DEF_HELPER_3_32_64(name) \

View File

@ -190,6 +190,13 @@ GEN_HELPER_PACKED(pmulubhh, uh, { \
dst.uh[i] = (((int16_t) s1.ub[i] * s2.sh[i]) + s1.ub[i]) >> 8; \
})
GEN_HELPER_PACKED(mpsadbh, uh, { \
dst.uh[i] = abs((int16_t) s1.ub[i ] - s2.ub[0]) \
+ abs((int16_t) s1.ub[i + 1] - s2.ub[1]) \
+ abs((int16_t) s1.ub[i + 2] - s2.ub[2]) \
+ abs((int16_t) s1.ub[i + 3] - s2.ub[3]); \
})
#define mul_sign(a, b) ((b) < 0 ? -(a) : ((b) > 0 ? (a) : 0))
GEN_HELPER_PACKED_OP(psignb, sb, mul_sign)

View File

@ -3113,6 +3113,7 @@ static void gen_op(DisasContext *ctx, Instr *instr)
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_MPSADBH: gen_alopf1_ddd(instr, gen_helper_mpsadbh); break;
case OP_PSADBW: gen_alopf1_ddd(instr, gen_helper_psadbw); break;
case OP_PSIGNB: gen_alopf1_ddd(instr, gen_helper_psignb); break;
case OP_PSIGNH: gen_alopf1_ddd(instr, gen_helper_psignh); break;
@ -3439,7 +3440,6 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_MOVX:
case OP_MOVXA:
case OP_MOVXC:
case OP_MPSADBH:
case OP_PFHADDS:
case OP_PFHSUBS:
case OP_PFADDSUBS: