target: e2k: Impl pcmpeqb.

This commit is contained in:
Denis Drakhnia 2020-12-03 20:38:46 +02:00
parent dc52e237dc
commit 6b0e8814cc
3 changed files with 28 additions and 0 deletions

View File

@ -17,6 +17,7 @@ DEF_HELPER_2(setwd, void, env, i32)
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(pcmpeqb, i64, i64, i64)
DEF_HELPER_4(set_aad_i64, void, env, i64, int, int)
DEF_HELPER_4(set_aad_i32, void, env, i32, int, int)
DEF_HELPER_3(set_aasti_i64, void, env, i64, int)

View File

@ -87,3 +87,23 @@ uint64_t HELPER(packed_shuffle_i64)(uint64_t src1, uint64_t src2, uint64_t src3)
return ret.n;
}
// FIXME: not tested
uint64_t HELPER(pcmpeqb)(uint64_t src1, uint64_t src2)
{
unsigned int i;
u8x8 s1, s2, ret;
s1.n = src1;
s2.n = src2;
for (i = 0; i < 8; i++) {
if (s1.s[i] == s2.s[i]) {
ret.s[i] = 0xff;
} else {
ret.s[i] = 0;
}
}
return ret.n;
}

View File

@ -1600,6 +1600,13 @@ static void execute_ext_01(DisasContext *dc, int chan)
e2k_tr_gen_exception(dc, E2K_EXCP_ILLOPC);
}
break;
case 0x18:
if (chan == 0 || chan == 3) {
gen_alopf1_i64(dc, chan, gen_helper_pcmpeqb);
} else {
e2k_tr_gen_exception(dc, E2K_EXCP_ILLOPC);
}
break;
case 0x20:
if (is_cmp_chan(chan)) {
gen_alopf1_i32(dc, chan, tcg_gen_mul_i32); /* muls */