e2k: Add pmovmskps and pmovmskpd instrs.
This commit is contained in:
parent
c998387f79
commit
b9d7c5874a
@ -27,7 +27,6 @@ DEF_HELPER_2(probe_read_access, int, env, tl)
|
||||
DEF_HELPER_2(probe_write_access, int, env, tl)
|
||||
DEF_HELPER_3(packed_shuffle_i64, i64, i64, i64, i64)
|
||||
|
||||
DEF_HELPER_2(pmovmskb, i64, i64, i64)
|
||||
DEF_HELPER_1(aau_load_program, void, env)
|
||||
DEF_HELPER_3(mova_ptr, tl, env, int, int)
|
||||
DEF_HELPER_3(aau_am, void, env, int, int)
|
||||
@ -87,6 +86,11 @@ DEF_HELPER_2(pmulhh, i64, i64, i64)
|
||||
DEF_HELPER_2(pmullh, i64, i64, i64)
|
||||
DEF_HELPER_2(pmulhuh, i64, i64, i64)
|
||||
|
||||
/* Packed Move Mask */
|
||||
DEF_HELPER_2(pmovmskb, i64, i64, i64)
|
||||
DEF_HELPER_2(pmovmskps, i64, i64, i64)
|
||||
DEF_HELPER_2(pmovmskpd, i64, i64, i64)
|
||||
|
||||
/* Packed uncategorized */
|
||||
DEF_HELPER_2(psadbw, i64, i64, i64)
|
||||
DEF_HELPER_2(pavgusb, i64, i64, i64)
|
||||
|
@ -225,23 +225,11 @@ 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;
|
||||
vec64 s1, s2;
|
||||
uint16_t ret = 0;
|
||||
|
||||
s1.ud[0] = src1;
|
||||
s2.ud[0] = src2;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (s1.sb[i] < 0) {
|
||||
ret |= 1 << (i + 8);
|
||||
}
|
||||
if (s2.sb[i] < 0) {
|
||||
ret |= 1 << i;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
#define MOVMASK(mask_type, type) { \
|
||||
dst.mask_type[0] |= (s1.type[i] < 0) << (i + glue(vec64_, type)); \
|
||||
dst.mask_type[0] |= (s2.type[i] < 0) << (i ); \
|
||||
}
|
||||
|
||||
GEN_HELPER_PACKED(pmovmskb, sb, MOVMASK(uh, sb))
|
||||
GEN_HELPER_PACKED(pmovmskps, sw, MOVMASK(ub, sw))
|
||||
GEN_HELPER_PACKED(pmovmskpd, sd, MOVMASK(ub, sd))
|
||||
|
@ -3106,6 +3106,8 @@ static void gen_op(DisasContext *ctx, Instr *instr)
|
||||
case OP_PUTTAGS: gen_puttag_i32(instr); break;
|
||||
case OP_PUTTAGD: gen_puttag_i64(instr); break;
|
||||
case OP_PMOVMSKB: gen_alopf1_ddd(instr, gen_helper_pmovmskb); break;
|
||||
case OP_PMOVMSKPS: gen_alopf1_ddd(instr, gen_helper_pmovmskps); break;
|
||||
case OP_PMOVMSKPD: gen_alopf1_ddd(instr, gen_helper_pmovmskpd); break;
|
||||
case OP_STAAB: gen_staa_i32(instr, MO_8); break;
|
||||
case OP_STAAH: gen_staa_i32(instr, MO_16); break;
|
||||
case OP_STAAW: gen_staa_i32(instr, MO_32); break;
|
||||
@ -3306,8 +3308,6 @@ static void gen_op(DisasContext *ctx, Instr *instr)
|
||||
case OP_PFCMPNLTD:
|
||||
case OP_PFCMPNLED:
|
||||
case OP_PFCMPODD:
|
||||
case OP_PMOVMSKPS:
|
||||
case OP_PMOVMSKPD:
|
||||
case OP_PACKSSHB:
|
||||
case OP_PACKUSHB:
|
||||
case OP_PSHUFW:
|
||||
|
Loading…
Reference in New Issue
Block a user