* [PATCH 1/2] Hexagon (hvx_misc test): fix uninitialized regs at test_load_tmp2
2023-05-30 13:45 [PATCH 0/2] Hexagon tests: fix test_load_tmp2 and non-portable format Matheus Tavares Bernardino
@ 2023-05-30 13:45 ` Matheus Tavares Bernardino
2023-05-30 13:45 ` [PATCH 2/2] Hexagon (tests/.../hex_test.h): use portable printf formats Matheus Tavares Bernardino
1 sibling, 0 replies; 3+ messages in thread
From: Matheus Tavares Bernardino @ 2023-05-30 13:45 UTC (permalink / raw)
To: qemu-devel; +Cc: tsimpson, bcain, quic_mliebel
From: Marco Liebel <quic_mliebel@quicinc.com>
This test case was using some vector registers which were not properly
initialized.
Signed-off-by: Marco Liebel <quic_mliebel@quicinc.com>
Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
---
tests/tcg/hexagon/hvx_misc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/tcg/hexagon/hvx_misc.c b/tests/tcg/hexagon/hvx_misc.c
index b45170acd1..b56b8f9cc5 100644
--- a/tests/tcg/hexagon/hvx_misc.c
+++ b/tests/tcg/hexagon/hvx_misc.c
@@ -66,6 +66,11 @@ static void test_load_tmp2(void)
void *pout1 = &output[1];
asm volatile(
+ "r0 = #0x0\n\t"
+ "v14 = vsplat(r0)\n\t"
+ "v15 = vsplat(r0)\n\t"
+ "v24 = vsplat(r0)\n\t"
+ "v25 = vsplat(r0)\n\t"
"r0 = #0x03030303\n\t"
"v16 = vsplat(r0)\n\t"
"r0 = #0x04040404\n\t"
@@ -79,7 +84,7 @@ static void test_load_tmp2(void)
"vmem(%0 + #0) = v24\n\t"
"vmem(%1 + #0) = v25\n\t"
: : "r"(pout0), "r"(pout1)
- : "r0", "v16", "v18", "v21", "v24", "v25", "memory"
+ : "r0", "v14", "v15", "v16", "v18", "v21", "v24", "v25", "memory"
);
for (int i = 0; i < MAX_VEC_SIZE_BYTES / 4; ++i) {
--
2.37.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] Hexagon (tests/.../hex_test.h): use portable printf formats
2023-05-30 13:45 [PATCH 0/2] Hexagon tests: fix test_load_tmp2 and non-portable format Matheus Tavares Bernardino
2023-05-30 13:45 ` [PATCH 1/2] Hexagon (hvx_misc test): fix uninitialized regs at test_load_tmp2 Matheus Tavares Bernardino
@ 2023-05-30 13:45 ` Matheus Tavares Bernardino
1 sibling, 0 replies; 3+ messages in thread
From: Matheus Tavares Bernardino @ 2023-05-30 13:45 UTC (permalink / raw)
To: qemu-devel; +Cc: tsimpson, bcain, quic_mliebel
This fixes compiler messages like "warning: format specifies type
'unsigned int' but the argument has type 'uint32_t' (aka 'unsigned
long') [-Wformat]".
Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
---
tests/tcg/hexagon/hex_test.h | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/tests/tcg/hexagon/hex_test.h b/tests/tcg/hexagon/hex_test.h
index cfed06a58b..fe253b56e5 100644
--- a/tests/tcg/hexagon/hex_test.h
+++ b/tests/tcg/hexagon/hex_test.h
@@ -19,10 +19,13 @@
#ifndef HEX_TEST_H
#define HEX_TEST_H
+#include <inttypes.h>
+
static inline void __check32(int line, uint32_t val, uint32_t expect)
{
if (val != expect) {
- printf("ERROR at line %d: 0x%08x != 0x%08x\n", line, val, expect);
+ printf("ERROR at line %d: 0x%08"PRIx32" != 0x%08"PRIx32"\n",
+ line, val, expect);
err++;
}
}
@@ -32,7 +35,8 @@ static inline void __check32(int line, uint32_t val, uint32_t expect)
static inline void __check64(int line, uint64_t val, uint64_t expect)
{
if (val != expect) {
- printf("ERROR at line %d: 0x%016llx != 0x%016llx\n", line, val, expect);
+ printf("ERROR at line %d: 0x%016"PRIx64" != 0x%016"PRIx64"\n",
+ line, val, expect);
err++;
}
}
@@ -62,7 +66,8 @@ static inline void __checkp(int line, void *p, void *expect)
static inline void __check32_ne(int line, uint32_t val, uint32_t expect)
{
if (val == expect) {
- printf("ERROR at line %d: 0x%08x == 0x%08x\n", line, val, expect);
+ printf("ERROR at line %d: 0x%08"PRIx32" == 0x%08"PRIx32"\n",
+ line, val, expect);
err++;
}
}
@@ -72,7 +77,8 @@ static inline void __check32_ne(int line, uint32_t val, uint32_t expect)
static inline void __check64_ne(int line, uint64_t val, uint64_t expect)
{
if (val == expect) {
- printf("ERROR at line %d: 0x%016llx == 0x%016llx\n", line, val, expect);
+ printf("ERROR at line %d: 0x%016"PRIx64" == 0x%016"PRIx64"\n",
+ line, val, expect);
err++;
}
}
--
2.37.2
^ permalink raw reply related [flat|nested] 3+ messages in thread