aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/hexagon
diff options
context:
space:
mode:
authorTaylor Simpson <tsimpson@quicinc.com>2021-06-01 18:19:41 -0500
committerTaylor Simpson <tsimpson@quicinc.com>2021-06-29 11:32:50 -0500
commit07c0f65385b94bbc8efc398ff82edd05953e39c2 (patch)
tree177e93c33990a7724c66c350a930dec62fb9e52e /tests/tcg/hexagon
parent13d5f87cc3b94bfccc501142df4a7b12fee3a6e7 (diff)
Hexagon (target/hexagon) fix bug in fLSBNEW*
Change fLSBNEW/fLSBNEW0/fLSBNEW1 from copy to "x & 1" Remove gen_logical_not function Clean up fLSBNEWNOT to use andi-1 followed by xori-1 Test cases 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-2-git-send-email-tsimpson@quicinc.com>
Diffstat (limited to 'tests/tcg/hexagon')
-rw-r--r--tests/tcg/hexagon/misc.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/tests/tcg/hexagon/misc.c b/tests/tcg/hexagon/misc.c
index 17c39198fc..9e139f3e85 100644
--- a/tests/tcg/hexagon/misc.c
+++ b/tests/tcg/hexagon/misc.c
@@ -181,6 +181,19 @@ static inline void S4_storeirifnew_io(void *p, int pred)
: "p0", "memory");
}
+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"
+ "}\n\t"
+ : "=r"(result) : "r"(pred), "r"(p)
+ : "p0");
+ return result;
+}
+
/*
* Test that compound-compare-jump is executed in 2 parts
* First we have to do all the compares in the packet and
@@ -298,8 +311,24 @@ static int auto_and(void)
return retval;
}
+void test_lsbnew(void)
+{
+ int result;
+
+ asm("r0 = #2\n\t"
+ "r1 = #5\n\t"
+ "{\n\t"
+ " p0 = r0\n\t"
+ " if (p0.new) r1 = #3\n\t"
+ "}\n\t"
+ "%0 = r1\n\t"
+ : "=r"(result) :: "r0", "r1", "p0");
+ check(result, 5);
+}
+
int main()
{
+ int res;
long long res64;
int pred;
@@ -394,6 +423,12 @@ int main()
S4_storeirifnew_io(&array[8], 1);
check(array[9], 9);
+ memcpy(array, init, sizeof(array));
+ res = L2_ploadrifnew_pi(&array[6], 0);
+ check(res, 6);
+ res = L2_ploadrifnew_pi(&array[7], 1);
+ check(res, 31);
+
int x = cmpnd_cmp_jump();
check(x, 12);
@@ -406,7 +441,7 @@ int main()
check((int)pair, 5);
check((int)(pair >> 32), 7);
- int res = test_clrtnew(1, 7);
+ res = test_clrtnew(1, 7);
check(res, 0);
res = test_clrtnew(2, 7);
check(res, 7);
@@ -422,6 +457,8 @@ int main()
res = auto_and();
check(res, 0);
+ test_lsbnew();
+
puts(err ? "FAIL" : "PASS");
return err;
}