[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 27/31] tests/tcg/ppc64le: tests for brh/brw/brd
From: |
Alex Bennée |
Subject: |
[PATCH v3 27/31] tests/tcg/ppc64le: tests for brh/brw/brd |
Date: |
Wed, 12 May 2021 11:20:47 +0100 |
From: Matheus Ferst <matheus.ferst@eldorado.org.br>
Tests for Byte-Reverse Halfword, Word and Doubleword
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Tested-by: Fabiano Rosas <farosas@linux.ibm.com>
[AJB: tweak to make rules for skip/plugins]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210423205757.1752480-3-matheus.ferst@eldorado.org.br>
---
tests/tcg/ppc64le/byte_reverse.c | 21 +++++++++++++++++++++
tests/tcg/ppc64/Makefile.target | 13 +++++++++++++
tests/tcg/ppc64le/Makefile.target | 13 +++++++++++++
3 files changed, 47 insertions(+)
create mode 100644 tests/tcg/ppc64le/byte_reverse.c
diff --git a/tests/tcg/ppc64le/byte_reverse.c b/tests/tcg/ppc64le/byte_reverse.c
new file mode 100644
index 0000000000..53b76fc2e2
--- /dev/null
+++ b/tests/tcg/ppc64le/byte_reverse.c
@@ -0,0 +1,21 @@
+#include <assert.h>
+
+int main(void)
+{
+ unsigned long var;
+
+ var = 0xFEDCBA9876543210;
+ asm("brh %0, %0" : "+r"(var));
+ assert(var == 0xDCFE98BA54761032);
+
+ var = 0xFEDCBA9876543210;
+ asm("brw %0, %0" : "+r"(var));
+ assert(var == 0x98BADCFE10325476);
+
+ var = 0xFEDCBA9876543210;
+ asm("brd %0, %0" : "+r"(var));
+ assert(var == 0x1032547698BADCFE);
+
+ return 0;
+}
+
diff --git a/tests/tcg/ppc64/Makefile.target b/tests/tcg/ppc64/Makefile.target
index 0c6a4585fc..a6a4ddaeca 100644
--- a/tests/tcg/ppc64/Makefile.target
+++ b/tests/tcg/ppc64/Makefile.target
@@ -10,4 +10,17 @@ PPC64_TESTS=bcdsub
endif
bcdsub: CFLAGS += -mpower8-vector
+PPC64_TESTS += byte_reverse
+ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),)
+run-byte_reverse: QEMU_OPTS+=-cpu POWER10
+run-plugin-byte_reverse-with-%: QEMU_OPTS+=-cpu POWER10
+else
+byte_reverse:
+ $(call skip-test, "BUILD of $@", "missing compiler support")
+run-byte_reverse:
+ $(call skip-test, "RUN of byte_reverse", "not built")
+run-plugin-byte_reverse-with-%:
+ $(call skip-test, "RUN of byte_reverse ($*)", "not built")
+endif
+
TESTS += $(PPC64_TESTS)
diff --git a/tests/tcg/ppc64le/Makefile.target
b/tests/tcg/ppc64le/Makefile.target
index 1acfcff94a..c0c14ffbad 100644
--- a/tests/tcg/ppc64le/Makefile.target
+++ b/tests/tcg/ppc64le/Makefile.target
@@ -9,4 +9,17 @@ PPC64LE_TESTS=bcdsub
endif
bcdsub: CFLAGS += -mpower8-vector
+PPC64LE_TESTS += byte_reverse
+ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),)
+run-byte_reverse: QEMU_OPTS+=-cpu POWER10
+run-plugin-byte_reverse-with-%: QEMU_OPTS+=-cpu POWER10
+else
+byte_reverse:
+ $(call skip-test, "BUILD of $@", "missing compiler support")
+run-byte_reverse:
+ $(call skip-test, "RUN of byte_reverse", "not built")
+run-plugin-byte_reverse-with-%:
+ $(call skip-test, "RUN of byte_reverse ($*)", "not built")
+endif
+
TESTS += $(PPC64LE_TESTS)
--
2.20.1
- [PATCH v3 20/31] tests/tcg/tricore: Add fadd test, (continued)
- [PATCH v3 20/31] tests/tcg/tricore: Add fadd test, Alex Bennée, 2021/05/12
- [PATCH v3 24/31] tests/tcg/tricore: Add msub test, Alex Bennée, 2021/05/12
- [PATCH v3 22/31] tests/tcg/tricore: Add ftoi test, Alex Bennée, 2021/05/12
- [PATCH v3 29/31] tests/tcg: fix missing return, Alex Bennée, 2021/05/12
- [PATCH v3 11/31] tests/tcg: Add docker_as and docker_ld cmds, Alex Bennée, 2021/05/12
- [PATCH v3 30/31] tests/tcg: don't allow clang as a cross compiler, Alex Bennée, 2021/05/12
- [PATCH v3 21/31] tests/tcg/tricore: Add fmul test, Alex Bennée, 2021/05/12
- [PATCH v3 17/31] tests/tcg/tricore: Add bmerge test, Alex Bennée, 2021/05/12
- [PATCH v3 31/31] configure: use cc, not host_cc to set cross_cc for build arch, Alex Bennée, 2021/05/12
- [PATCH v3 27/31] tests/tcg/ppc64le: tests for brh/brw/brd,
Alex Bennée <=
- [PATCH v3 26/31] tests/docker: gcc-10 based images for ppc64{, le} tests, Alex Bennée, 2021/05/12
- [PATCH v3 14/31] tests/tcg/tricore: Add build infrastructure, Alex Bennée, 2021/05/12
- [PATCH v3 25/31] tests/tcg/tricore: Add muls test, Alex Bennée, 2021/05/12
- [PATCH v3 28/31] cirrus.yml: Fix the MSYS2 task, Alex Bennée, 2021/05/12
- [PATCH v3 16/31] tests/tcg/tricore: Add macros to create tests and first test 'abs', Alex Bennée, 2021/05/12
- [PATCH v3 18/31] tests/tcg/tricore: Add clz test, Alex Bennée, 2021/05/12
- [PATCH v3 23/31] tests/tcg/tricore: Add madd test, Alex Bennée, 2021/05/12
- Re: [PATCH v3 00/31] testing/next pre-PR (hexagon, tricore, misc), no-reply, 2021/05/12