Signed-off-by: Taylor Simpson <[email protected]>
---
tests/tcg/hexagon/multiple-writes.c | 46 +++++++++++++++++++++++++++++
tests/tcg/hexagon/Makefile.target | 1 +
2 files changed, 47 insertions(+)
diff --git a/tests/tcg/hexagon/multiple-writes.c
b/tests/tcg/hexagon/multiple-writes.c
index 4305903547..b93f2ab32e 100644
--- a/tests/tcg/hexagon/multiple-writes.c
+++ b/tests/tcg/hexagon/multiple-writes.c
@@ -199,6 +199,49 @@ static int test_post_increment3(void)
return sig;
}
+static int test_vreg_legal_predicated(void)
+{
+ int sig;
+
+ asm volatile(
+ "r0 = #0\n"
+ "r1 = ##1f\n"
+ "memw(%1) = r1\n"
+ "r2 = #7\n"
+ "r3 = #13\n"
+ "p0 = cmp.eq(r2, r3)\n"
+ "{\n"
+ " if (p0) v0 = v1\n"
+ " if (!p0) v0 = v2\n"
+ "}\n"
+ "1:\n"
+ "%0 = #23\n"
+ : "=r"(sig)
+ : "r"(&resume_pc)
+ : "r0", "r1", "r2", "r3", "p0", "v0", "v1", "memory");
+
+ return sig;
+}
+
+static int test_vreg_illegal(void)
+{
+ int sig;
+
+ asm volatile(
+ "r0 = #0\n"
+ "r1 = ##1f\n"
+ "memw(%1) = r1\n"
+ ".word 0x1e0361e0 /* { v0 = v1 */\n"
+ ".word 0x1e03e2e0 /* v0 = v2 } */\n"
+ "1:\n"
+ "%0 = r0\n"
+ : "=r"(sig)
+ : "r"(&resume_pc)
+ : "r0", "r1", "memory");
+
+ return sig;
+}
+
int main()
{
struct sigaction act;
@@ -224,6 +267,9 @@ int main()
assert(test_post_increment2() == SIGILL);
assert(test_post_increment3() == SIGILL);
+ assert(test_vreg_legal_predicated() == 23);
+ assert(test_vreg_illegal() == SIGILL);
+
puts("PASS");
return EXIT_SUCCESS;
}
diff --git a/tests/tcg/hexagon/Makefile.target
b/tests/tcg/hexagon/Makefile.target
index f86f02bb31..ea73413bf4 100644
--- a/tests/tcg/hexagon/Makefile.target
+++ b/tests/tcg/hexagon/Makefile.target
@@ -118,6 +118,7 @@ vector_add_int: CFLAGS += -mhvx -fvectorize
hvx_misc: hvx_misc.c hvx_misc.h
hvx_misc: CFLAGS += -mhvx
hvx_histogram: CFLAGS += -mhvx -Wno-gnu-folding-constant
+multiple-writes: CFLAGS += -mhvx
v68_hvx: v68_hvx.c hvx_misc.h v6mpy_ref.c.inc
v68_hvx: CFLAGS += -mhvx -Wno-unused-function
v69_hvx: v69_hvx.c hvx_misc.h
--
2.43.0