e2k: Add pavgus{b,h} instrs.

This commit is contained in:
Denis Drakhnia 2021-01-16 01:41:53 +02:00 committed by Denis Drakhnia
parent 0335773d70
commit e777b64356
3 changed files with 7 additions and 2 deletions

View File

@ -86,6 +86,8 @@ DEF_HELPER_2(pmaddubsh, i64, i64, i64)
/* Packed uncategorized */
DEF_HELPER_2(psadbw, i64, i64, i64)
DEF_HELPER_2(pavgusb, i64, i64, i64)
DEF_HELPER_2(pavgush, i64, i64, i64)
/* Float 32/64 Ops */
#define DEF_HELPER_3_32_64(name) \

View File

@ -212,6 +212,9 @@ GEN_HELPER_PACKED_MAD(pmaddubsh, sh, ub, int16_t, satsh)
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; })
uint64_t HELPER(pmovmskb)(uint64_t src1, uint64_t src2)
{
int i;

View File

@ -3068,6 +3068,8 @@ static void gen_op(DisasContext *ctx, Instr *instr)
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_PAVGUSB: gen_alopf1_ddd(instr, gen_helper_pavgusb); break;
case OP_PAVGUSH: gen_alopf1_ddd(instr, gen_helper_pavgush); 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;
@ -3238,8 +3240,6 @@ static void gen_op(DisasContext *ctx, Instr *instr)
case OP_GETVA:
case OP_LDRD:
case OP_PUTTC:
case OP_PAVGUSB:
case OP_PAVGUSH:
case OP_PFDIVS:
case OP_PFDIVD:
case OP_PFMINS: