tests/tcg/hexagon: fix underspecifed asm constraints
authorMukilan Thiyagarajan <quic_mthiyaga@quicinc.com>
Thu, 29 Dec 2022 08:18:36 +0000 (13:48 +0530)
committerTaylor Simpson <tsimpson@quicinc.com>
Thu, 5 Jan 2023 17:19:02 +0000 (09:19 -0800)
There are two test cases where the inline asm doesn't
have the correct constraints causing them to fail.

In misc.c, the 'result' output needs the early clobber
modifier since the rest of the inputs are read after
assignment to the output register.

In mem_noshuf.c, the register r7 is written to but
not specified in the clobber list.

Signed-off-by: Mukilan Thiyagarajan <quic_mthiyaga@quicinc.com>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id: <20221229081836.12130-1-quic_mthiyaga@quicinc.com>

tests/tcg/hexagon/mem_noshuf.c
tests/tcg/hexagon/misc.c

index 0f4064e700b22fdd2770e82b03303f58cc3c7193..210b2f1208af77cde15c01b01329facc68ebf39a 100644 (file)
@@ -144,7 +144,7 @@ static inline long long pred_ld_sd_pi(int pred, long long *p, long long *q,
                  "}:mem_noshuf\n"
                  : "=&r"(ret)
                  : "r"(p), "r"(q), "r"(x), "r"(y), "r"(pred)
-                 : "p0", "memory");
+                 : "r7", "p0", "memory");
     return ret;
 }
 
index f0b1947fb3a886502c123017c16a5f3b3aabac76..e73ab5733496fb27ddc03699781ea7aacc4b10d9 100644 (file)
@@ -186,10 +186,10 @@ static int L2_ploadrifnew_pi(void *p, int pred)
   int result;
   asm volatile("%0 = #31\n\t"
                "{\n\t"
-               "    p0 = cmp.eq(%1, #1)\n\t"
-               "    if (!p0.new) %0 = memw(%2++#4)\n\t"
+               "    p0 = cmp.eq(%2, #1)\n\t"
+               "    if (!p0.new) %0 = memw(%1++#4)\n\t"
                "}\n\t"
-               : "=r"(result) : "r"(pred), "r"(p)
+               : "=&r"(result), "+r"(p) : "r"(pred)
                : "p0");
   return result;
 }