Hexagon (target/hexagon) fix l2fetch instructions
authorTaylor Simpson <tsimpson@quicinc.com>
Tue, 1 Jun 2021 23:19:42 +0000 (18:19 -0500)
committerTaylor Simpson <tsimpson@quicinc.com>
Tue, 29 Jun 2021 16:32:50 +0000 (11:32 -0500)
Y4_l2fetch == l2fetch(Rs32, Rt32)
Y5_l2fetch == l2fetch(Rs32, Rtt32)

The semantics for these instructions are present, but the encodings
are missing.

Note that these are treated as nops in qemu, so we add overrides.

Test case added to tests/tcg/hexagon/misc.c

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <1622589584-22571-3-git-send-email-tsimpson@quicinc.com>

target/hexagon/gen_tcg.h
target/hexagon/imported/encode_pp.def
tests/tcg/hexagon/misc.c

index 18fcdbc7e4886670a0f784c8264003798583558c..a375d6a7c59003363fc9ebc25bdd706f7bde886b 100644 (file)
 #define fGEN_TCG_F2_dfmpyhh(SHORTCODE) \
     gen_helper_dfmpyhh(RxxV, cpu_env, RxxV, RssV, RttV)
 
+/* Nothing to do for these in qemu, need to suppress compiler warnings */
+#define fGEN_TCG_Y4_l2fetch(SHORTCODE) \
+    do { \
+        RsV = RsV; \
+        RtV = RtV; \
+    } while (0)
+#define fGEN_TCG_Y5_l2fetch(SHORTCODE) \
+    do { \
+        RsV = RsV; \
+    } while (0)
+
 #endif
index 35ae3d236987b3ab7750363ab448f3e3f85e8d5c..939c6fc55fbc134db4dcc609e0ff049a2f5082e2 100644 (file)
@@ -493,6 +493,9 @@ DEF_ENC32(Y2_dccleana,     ICLASS_ST" 000 00 00sssss PP------ --------")
 DEF_ENC32(Y2_dcinva,       ICLASS_ST" 000 00 01sssss PP------ --------")
 DEF_ENC32(Y2_dccleaninva,  ICLASS_ST" 000 00 10sssss PP------ --------")
 
+DEF_ENC32(Y4_l2fetch,      ICLASS_ST" 011 00 00sssss PP-ttttt 000-----")
+DEF_ENC32(Y5_l2fetch,      ICLASS_ST" 011 01 00sssss PP-ttttt --------")
+
 /*******************************/
 /*                             */
 /*                             */
index 9e139f3e857f36a9fe4bd1712ac289ea559c8c3f..f0b1947fb3a886502c123017c16a5f3b3aabac76 100644 (file)
@@ -326,6 +326,13 @@ void test_lsbnew(void)
     check(result, 5);
 }
 
+void test_l2fetch(void)
+{
+    /* These don't do anything in qemu, just make sure they don't assert */
+    asm volatile ("l2fetch(r0, r1)\n\t"
+                  "l2fetch(r0, r3:2)\n\t");
+}
+
 int main()
 {
     int res;
@@ -459,6 +466,8 @@ int main()
 
     test_lsbnew();
 
+    test_l2fetch();
+
     puts(err ? "FAIL" : "PASS");
     return err;
 }