aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorTaylor Simpson <tsimpson@quicinc.com>2021-08-13 00:31:12 -0500
committerTaylor Simpson <tsimpson@quicinc.com>2021-11-03 16:01:32 -0500
commit32488192c7fcfc9818ed1a59997a6cca7f0fcf50 (patch)
treeba53500671eafe14aac2e908867176c356ec60a9 /target
parent7ba7657bc9359b74576efe1b7b4de58271ea97b9 (diff)
Hexagon HVX (target/hexagon) helper overrides - vector assign & cmov
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Diffstat (limited to 'target')
-rw-r--r--target/hexagon/gen_tcg_hvx.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/target/hexagon/gen_tcg_hvx.h b/target/hexagon/gen_tcg_hvx.h
index a560504b78..916230e5d8 100644
--- a/target/hexagon/gen_tcg_hvx.h
+++ b/target/hexagon/gen_tcg_hvx.h
@@ -124,4 +124,35 @@ static inline void assert_vhist_tmp(DisasContext *ctx)
} while (0)
+#define fGEN_TCG_V6_vassign(SHORTCODE) \
+ tcg_gen_gvec_mov(MO_64, VdV_off, VuV_off, \
+ sizeof(MMVector), sizeof(MMVector))
+
+/* Vector conditional move */
+#define fGEN_TCG_VEC_CMOV(PRED) \
+ do { \
+ TCGv lsb = tcg_temp_new(); \
+ TCGLabel *false_label = gen_new_label(); \
+ TCGLabel *end_label = gen_new_label(); \
+ tcg_gen_andi_tl(lsb, PsV, 1); \
+ tcg_gen_brcondi_tl(TCG_COND_NE, lsb, PRED, false_label); \
+ tcg_temp_free(lsb); \
+ tcg_gen_gvec_mov(MO_64, VdV_off, VuV_off, \
+ sizeof(MMVector), sizeof(MMVector)); \
+ tcg_gen_br(end_label); \
+ gen_set_label(false_label); \
+ tcg_gen_ori_tl(hex_slot_cancelled, hex_slot_cancelled, \
+ 1 << insn->slot); \
+ gen_set_label(end_label); \
+ } while (0)
+
+
+/* Vector conditional move (true) */
+#define fGEN_TCG_V6_vcmov(SHORTCODE) \
+ fGEN_TCG_VEC_CMOV(1)
+
+/* Vector conditional move (false) */
+#define fGEN_TCG_V6_vncmov(SHORTCODE) \
+ fGEN_TCG_VEC_CMOV(0)
+
#endif