On 17/02/2022 09:46, Matheus K. Ferst wrote:
On 17/02/2022 05:09, Cédric Le Goater wrote:
On 2/8/22 21:31, matheus.fe...@eldorado.org.br wrote:
From: Matheus Ferst <matheus.fe...@eldorado.org.br>
LLVM/Clang doesn't like inline asm with __int128, use a vector type
instead.
Signed-off-by: Matheus Ferst <matheus.fe...@eldorado.org.br>
---
Alternatively, we could pass VSR values in GPR pairs, as we did in
tests/tcg/ppc64le/non_signalling_xscv.c
---
tests/tcg/ppc64le/bcdsub.c | 92 +++++++++++++++++++++-----------------
1 file changed, 52 insertions(+), 40 deletions(-)
diff --git a/tests/tcg/ppc64le/bcdsub.c b/tests/tcg/ppc64le/bcdsub.c
index 8c188cae6d..17403daf22 100644
--- a/tests/tcg/ppc64le/bcdsub.c
+++ b/tests/tcg/ppc64le/bcdsub.c
@@ -1,6 +1,7 @@
#include <assert.h>
#include <unistd.h>
#include <signal.h>
+#include <altivec.h>
#define CRF_LT (1 << 3)
#define CRF_GT (1 << 2)
@@ -8,6 +9,16 @@
#define CRF_SO (1 << 0)
#define UNDEF 0
+#ifdef __LITTLE_ENDIAN__
Shouldn't we be using :
#if BYTE_ORDER == LITTLE_ENDIAN
instead ?
I guess it is better, I'll send a v2.
Actually, it doesn't work for LLVM and needs endian.h for GCC[1]. This
check is also used in sigbus and sha1 tests. The first shouldn't be a
problem (allow_fail is zero for ppc), but sha1 gives the wrong result
for BE:
$ ./qemu-ppc64le tests/tcg/ppc64le-linux-user/sha1
SHA1=15dd99a1991e0b3826fede3deffc1feba42278e6
$ ./qemu-ppc64 tests/tcg/ppc64-linux-user/sha1
SHA1=70f1d4d65eb47309ffacc5a28ff285ad826006da
and 'make check-tcg' succeeds anyway...
[1] https://godbolt.org/z/fYbzbbexn
--
Matheus K. Ferst
Instituto de Pesquisas ELDORADO <http://www.eldorado.org.br/>
Analista de Software
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>