diff mbox series

[RFC,v2,46/67] Hexagon TCG generation - step 08

Message ID 1582908244-304-47-git-send-email-tsimpson@quicinc.com (mailing list archive)
State New, archived
Headers show
Series Hexagon patch series | expand

Commit Message

Taylor Simpson Feb. 28, 2020, 4:43 p.m. UTC
Override mathematical operations with more than one definition

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
---
 target/hexagon/helper_overrides.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
diff mbox series

Patch

diff --git a/target/hexagon/helper_overrides.h b/target/hexagon/helper_overrides.h
index 1ac363e..d18aea4 100644
--- a/target/hexagon/helper_overrides.h
+++ b/target/hexagon/helper_overrides.h
@@ -1200,4 +1200,34 @@ 
 #define fWRAP_SL2_return_fnew(GENHLPR, SHORTCODE) \
     fWRAP_COND_RETURN_SUBINSN(fLSBNEW0NOT)
 
+/*
+ * Mathematical operations with more than one definition require
+ * special handling
+ */
+/*
+ * Approximate reciprocal
+ * r3,p1 = sfrecipa(r0, r1)
+ */
+#define fWRAP_F2_sfrecipa(GENHLPR, SHORTCODE) \
+    do { \
+        gen_helper_sfrecipa_val(RdV, cpu_env, RsV, RtV);  \
+        gen_helper_sfrecipa_pred(PeV, cpu_env, RsV, RtV);  \
+    } while (0)
+
+/*
+ * Approximation of the reciprocal square root
+ * r1,p0 = sfinvsqrta(r0)
+ */
+#define fWRAP_F2_sfinvsqrta(GENHLPR, SHORTCODE) \
+    do { \
+        gen_helper_sfinvsqrta_val(RdV, cpu_env, RsV); \
+        gen_helper_sfinvsqrta_pred(PeV, cpu_env, RsV); \
+    } while (0)
+
+#define fWRAP_A5_ACS(GENHLPR, SHORTCODE) \
+    do { \
+        gen_helper_vacsh_val(RxxV, cpu_env, RxxV, RssV, RttV); \
+        gen_helper_vacsh_pred(PeV, cpu_env, RxxV, RssV, RttV); \
+    } while (0)
+
 #endif