diff --git a/target/e2k/helper.h b/target/e2k/helper.h index ccc98784ec..e31911e174 100644 --- a/target/e2k/helper.h +++ b/target/e2k/helper.h @@ -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) diff --git a/target/e2k/helper_vec.c b/target/e2k/helper_vec.c index 7700db564f..0523dc4e0c 100644 --- a/target/e2k/helper_vec.c +++ b/target/e2k/helper_vec.c @@ -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; +} diff --git a/target/e2k/translate/alc.c b/target/e2k/translate/alc.c index 0441b52814..4029035e25 100644 --- a/target/e2k/translate/alc.c +++ b/target/e2k/translate/alc.c @@ -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 */