[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/15] tests/tcg: target/mips: Add wrappers for some
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PULL 08/15] tests/tcg: target/mips: Add wrappers for some MIPS64R6 instructions |
Date: |
Tue, 5 Mar 2019 19:05:20 +0100 |
From: Aleksandar Markovic <address@hidden>
Add wrappers for some MIPS64R6 instructions.
Signed-off-by: Aleksandar Markovic <address@hidden>
Reviewed-by: Aleksandar Rikalo <address@hidden>
Message-Id: <address@hidden>
---
tests/tcg/mips/include/wrappers_mips64r6.h | 83 ++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
create mode 100644 tests/tcg/mips/include/wrappers_mips64r6.h
diff --git a/tests/tcg/mips/include/wrappers_mips64r6.h
b/tests/tcg/mips/include/wrappers_mips64r6.h
new file mode 100644
index 0000000..d1e5edb
--- /dev/null
+++ b/tests/tcg/mips/include/wrappers_mips64r6.h
@@ -0,0 +1,83 @@
+/*
+ * Header file for wrappers around MIPS64R6 instructions assembler
+ * invocations
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <address@hidden>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef WRAPPERS_MIPS64R6_H
+#define WRAPPERS_MIPS64R6_H
+
+
+#define DO_MIPS64R6__RD__RS(suffix, mnemonic) \
+static inline void do_mips64r6_##suffix(const void *input, \
+ void *output) \
+{ \
+ __asm__ volatile ( \
+ "ld $t1, 0(%0)\n\t" \
+ #mnemonic " $t0, $t1\n\t" \
+ "sd $t0, 0(%1)\n\t" \
+ : \
+ : "r" (input), "r" (output) \
+ : "t0", "t1", "memory" \
+ ); \
+}
+
+DO_MIPS64R6__RD__RS(CLO, clo)
+DO_MIPS64R6__RD__RS(CLZ, clz)
+DO_MIPS64R6__RD__RS(DCLO, dclo)
+DO_MIPS64R6__RD__RS(DCLZ, dclz)
+
+DO_MIPS64R6__RD__RS(BITSWAP, bitswap)
+DO_MIPS64R6__RD__RS(DBITSWAP, dbitswap)
+
+
+#define DO_MIPS64R6__RD__RS_RT(suffix, mnemonic) \
+static inline void do_mips64r6_##suffix(const void *input1, \
+ const void *input2, \
+ void *output) \
+{ \
+ __asm__ volatile ( \
+ "ld $t1, 0(%0)\n\t" \
+ "ld $t2, 0(%1)\n\t" \
+ #mnemonic " $t0, $t1, $t2\n\t" \
+ "sd $t0, 0(%2)\n\t" \
+ : \
+ : "r" (input1), "r" (input2), "r" (output) \
+ : "t0", "t1", "memory" \
+ ); \
+}
+
+DO_MIPS64R6__RD__RS_RT(SLLV, sllv)
+DO_MIPS64R6__RD__RS_RT(SRLV, srlv)
+DO_MIPS64R6__RD__RS_RT(SRAV, srav)
+DO_MIPS64R6__RD__RS_RT(DSLLV, dsllv)
+DO_MIPS64R6__RD__RS_RT(DSRLV, dsrlv)
+DO_MIPS64R6__RD__RS_RT(DSRAV, dsrav)
+
+DO_MIPS64R6__RD__RS_RT(MUL, mul)
+DO_MIPS64R6__RD__RS_RT(MUH, muh)
+DO_MIPS64R6__RD__RS_RT(MULU, mulu)
+DO_MIPS64R6__RD__RS_RT(MUHU, muhu)
+DO_MIPS64R6__RD__RS_RT(DMUL, dmul)
+DO_MIPS64R6__RD__RS_RT(DMUH, dmuh)
+DO_MIPS64R6__RD__RS_RT(DMULU, dmulu)
+DO_MIPS64R6__RD__RS_RT(DMUHU, dmuhu)
+
+
+#endif
--
2.7.4
- [Qemu-devel] [PULL 00/15] MIPS queue for March 5th, 2019, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 03/15] tests/tcg: target/mips: Add wrappers for various MSA instructions, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 04/15] tests/tcg: target/mips: Add test utilities for 32-bit tests, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 06/15] tests/tcg: target/mips: Fix test utilities for 128-bit tests, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 07/15] tests/tcg: target/mips: Extend functionality of MSA wrapper macros, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 05/15] tests/tcg: target/mips: Add test utilities for 64-bit tests, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 10/15] tests/tcg: target/mips: Add tests for MIPS64R6 bit swap instructions, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 02/15] disas: nanoMIPS: Add graphical description of pool organization, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 12/15] tests/tcg: target/mips: Add tests for MIPS64R6 shift instructions, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 01/15] disas: nanoMIPS: Correct comments to handlers of some DSP instructions, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 08/15] tests/tcg: target/mips: Add wrappers for some MIPS64R6 instructions,
Aleksandar Markovic <=
- [Qemu-devel] [PULL 09/15] tests/tcg: target/mips: Add tests for MIPS64R6 logic instructions, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 11/15] tests/tcg: target/mips: Add tests for MIPS64R6 bit count instructions, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 14/15] tests/tcg: target/mips: Add tests for MSA pack instructions, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 13/15] tests/tcg: target/mips: Add tests for MIPS64R6 int multiply instructions, Aleksandar Markovic, 2019/03/05
- [Qemu-devel] [PULL 15/15] target/mips: Add tests for integer add MSA instruction group, Aleksandar Markovic, 2019/03/05
- Re: [Qemu-devel] [PULL 00/15] MIPS queue for March 5th, 2019, Peter Maydell, 2019/03/06