Hexagon (target/hexagon) decide if pred has been written at TCG gen time

Multiple writes to the same preg are and'ed together.  Rather than
generating a runtime check, we can determine at TCG generation time
if the predicate has previously been written in the packet.

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

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <1617930474-31979-7-git-send-email-tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Taylor Simpson 2021-04-08 20:07:34 -05:00 committed by Richard Henderson
parent 743debbc37
commit 6c677c60ae
5 changed files with 44 additions and 10 deletions

View file

@ -264,6 +264,22 @@ static long long creg_pair(int x, int y)
return retval;
}
/* Check that predicates are auto-and'ed in a packet */
static int auto_and(void)
{
int retval;
asm ("r5 = #1\n\t"
"{\n\t"
" p0 = cmp.eq(r1, #1)\n\t"
" p0 = cmp.eq(r1, #2)\n\t"
"}\n\t"
"%0 = p0\n\t"
: "=r"(retval)
:
: "r5", "p0");
return retval;
}
int main()
{
@ -375,6 +391,9 @@ int main()
res = test_clrtnew(2, 7);
check(res, 7);
res = auto_and();
check(res, 0);
puts(err ? "FAIL" : "PASS");
return err;
}