diff --git a/target/e2k/helper.h b/target/e2k/helper.h index ac4fc55289..f6543d61a4 100644 --- a/target/e2k/helper.h +++ b/target/e2k/helper.h @@ -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) diff --git a/target/e2k/helper_vec.c b/target/e2k/helper_vec.c index e32714f67d..d87a5e4d4b 100644 --- a/target/e2k/helper_vec.c +++ b/target/e2k/helper_vec.c @@ -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; \ diff --git a/target/e2k/translate/alc.c b/target/e2k/translate/alc.c index 2083b5193f..0bacc45557 100644 --- a/target/e2k/translate/alc.c +++ b/target/e2k/translate/alc.c @@ -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: