[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 42/66] Hexagon TCG generation - step 05
From: |
Taylor Simpson |
Subject: |
[RFC PATCH 42/66] Hexagon TCG generation - step 05 |
Date: |
Mon, 10 Feb 2020 18:40:20 -0600 |
Override predicated store instructions
Signed-off-by: Taylor Simpson <address@hidden>
---
target/hexagon/helper_overrides.h | 54 +++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/target/hexagon/helper_overrides.h
b/target/hexagon/helper_overrides.h
index 648fc5d..9791d33 100644
--- a/target/hexagon/helper_overrides.h
+++ b/target/hexagon/helper_overrides.h
@@ -877,4 +877,58 @@
#define fWRAP_S2_storerinewgp(GENHLPR, SHORTCODE) \
fWRAP_STORE(SHORTCODE)
+/* Predicated stores */
+#define fWRAP_PRED_STORE(GET_EA, PRED, SRC, SIZE, INC) \
+ do { \
+ TCGv LSB = tcg_temp_local_new(); \
+ TCGv NEWREG_ST = tcg_temp_local_new(); \
+ TCGv BYTE = tcg_temp_local_new(); \
+ TCGv HALF = tcg_temp_local_new(); \
+ TCGLabel *label = gen_new_label(); \
+ GET_EA; \
+ PRED; \
+ PRED_STORE_CANCEL(LSB, EA); \
+ tcg_gen_brcondi_tl(TCG_COND_EQ, LSB, 0, label); \
+ INC; \
+ fSTORE(1, SIZE, EA, SRC); \
+ gen_set_label(label); \
+ tcg_temp_free(LSB); \
+ tcg_temp_free(NEWREG_ST); \
+ tcg_temp_free(BYTE); \
+ tcg_temp_free(HALF); \
+ } while (0)
+
+#define NOINC do {} while (0)
+
+#define fWRAP_S4_pstorerinewfnew_rr(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_RRs(RsV, RuV, uiV), fLSBNEWNOT(PvN), \
+ hex_new_value[NtX], 4, NOINC)
+#define fWRAP_S2_pstorerdtnew_pi(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_REG(RxV), fLSBNEW(PvN), \
+ RttV, 8, tcg_gen_addi_tl(RxV, RxV, IMMNO(0)))
+#define fWRAP_S4_pstorerdtnew_io(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_RI(RsV, uiV), fLSBNEW(PvN), \
+ RttV, 8, NOINC)
+#define fWRAP_S4_pstorerbtnew_io(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_RI(RsV, uiV), fLSBNEW(PvN), \
+ fGETBYTE(0, RtV), 1, NOINC)
+#define fWRAP_S2_pstorerhtnew_pi(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_REG(RxV), fLSBNEW(PvN), \
+ fGETHALF(0, RtV), 2, tcg_gen_addi_tl(RxV, RxV, IMMNO(0)))
+#define fWRAP_S2_pstoreritnew_pi(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_REG(RxV), fLSBNEW(PvN), \
+ RtV, 4, tcg_gen_addi_tl(RxV, RxV, IMMNO(0)))
+#define fWRAP_S2_pstorerif_io(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_RI(RsV, uiV), fLSBOLDNOT(PvV), \
+ RtV, 4, NOINC)
+#define fWRAP_S4_pstorerit_abs(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_IMM(uiV), fLSBOLD(PvV), \
+ RtV, 4, NOINC)
+#define fWRAP_S2_pstorerinewf_io(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_RI(RsV, uiV), fLSBOLDNOT(PvV), \
+ hex_new_value[NtX], 4, NOINC)
+#define fWRAP_S4_pstorerbnewfnew_abs(GENHLPR, SHORTCODE) \
+ fWRAP_PRED_STORE(fEA_IMM(uiV), fLSBNEWNOT(PvN), \
+ fGETBYTE(0, hex_new_value[NtX]), 1, NOINC)
+
#endif
--
2.7.4
- [RFC PATCH 31/66] Hexagon macros referenced in instruction semantics, (continued)
- [RFC PATCH 31/66] Hexagon macros referenced in instruction semantics, Taylor Simpson, 2020/02/10
- [RFC PATCH 34/66] Hexagon TCG generation helpers - step 2, Taylor Simpson, 2020/02/10
- [RFC PATCH 38/66] Hexagon TCG generation - step 01, Taylor Simpson, 2020/02/10
- [RFC PATCH 37/66] Hexagon TCG generation helpers - step 5, Taylor Simpson, 2020/02/10
- [RFC PATCH 39/66] Hexagon TCG generation - step 02, Taylor Simpson, 2020/02/10
- [RFC PATCH 40/66] Hexagon TCG generation - step 03, Taylor Simpson, 2020/02/10
- [RFC PATCH 41/66] Hexagon TCG generation - step 04, Taylor Simpson, 2020/02/10
- [RFC PATCH 46/66] Hexagon TCG generation - step 09, Taylor Simpson, 2020/02/10
- [RFC PATCH 43/66] Hexagon TCG generation - step 06, Taylor Simpson, 2020/02/10
- [RFC PATCH 15/66] Hexagon arch import - instruction semantics definitions, Taylor Simpson, 2020/02/10
- [RFC PATCH 42/66] Hexagon TCG generation - step 05,
Taylor Simpson <=
- [RFC PATCH 47/66] Hexagon TCG generation - step 10, Taylor Simpson, 2020/02/10
- [RFC PATCH 44/66] Hexagon TCG generation - step 07, Taylor Simpson, 2020/02/10
- [RFC PATCH 45/66] Hexagon TCG generation - step 08, Taylor Simpson, 2020/02/10
- [RFC PATCH 49/66] Hexagon TCG generation - step 12, Taylor Simpson, 2020/02/10
- [RFC PATCH 53/66] Hexagon - Add Hexagon Vector eXtensions (HVX) to core definition, Taylor Simpson, 2020/02/10
- [RFC PATCH 48/66] Hexagon TCG generation - step 11, Taylor Simpson, 2020/02/10
- [RFC PATCH 54/66] Hexagon HVX support in gdbstub, Taylor Simpson, 2020/02/10
- [RFC PATCH 66/66] Hexagon HVX build infrastructure, Taylor Simpson, 2020/02/10
- [RFC PATCH 50/66] Hexagon translation, Taylor Simpson, 2020/02/10
- [RFC PATCH 64/66] Hexagon HVX TCG generation, Taylor Simpson, 2020/02/10