summaryrefslogtreecommitdiffstats
path: root/tests/tcg/mips/include
diff options
context:
space:
mode:
authorAleksandar Markovic2019-06-06 18:27:18 +0200
committerAleksandar Markovic2019-06-07 11:53:07 +0200
commitca693d1c9271e27e8a02cd11a5bb3248cbbcf420 (patch)
tree54f5c3ed423b9170a4629591a538cf040855ee56 /tests/tcg/mips/include
parenttests/tcg: target/mips: Move four tests to a better location (diff)
downloadqemu-ca693d1c9271e27e8a02cd11a5bb3248cbbcf420.tar.gz
qemu-ca693d1c9271e27e8a02cd11a5bb3248cbbcf420.tar.xz
qemu-ca693d1c9271e27e8a02cd11a5bb3248cbbcf420.zip
tests/tcg: target/mips: Add utility function reset_msa_registers()
Add function reset_msa_registers() and utilize it in each MSA test. This is needed to ensure independency of test results on the state of MSA registers before test execution. This also allows for correction of tests for VSHF* instructions, that are now independent on the previous state of MSA registers. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1559838440-9866-9-git-send-email-aleksandar.markovic@rt-rk.com>
Diffstat (limited to 'tests/tcg/mips/include')
-rw-r--r--tests/tcg/mips/include/wrappers_msa.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/tcg/mips/include/wrappers_msa.h b/tests/tcg/mips/include/wrappers_msa.h
index 1f9c4c2a74..5d28cb531a 100644
--- a/tests/tcg/mips/include/wrappers_msa.h
+++ b/tests/tcg/mips/include/wrappers_msa.h
@@ -23,6 +23,54 @@
#define WRAPPERS_MSA_H
+#define RESET_MSA_REGISTER(wi) \
+ __asm__ volatile ( \
+ "xor.v $" #wi ", $" #wi ", $" #wi "\n\t" \
+ : \
+ : \
+ : \
+ )
+
+
+static inline void reset_msa_registers()
+{
+
+ RESET_MSA_REGISTER(w0);
+ RESET_MSA_REGISTER(w1);
+ RESET_MSA_REGISTER(w2);
+ RESET_MSA_REGISTER(w3);
+ RESET_MSA_REGISTER(w4);
+ RESET_MSA_REGISTER(w5);
+ RESET_MSA_REGISTER(w6);
+ RESET_MSA_REGISTER(w7);
+ RESET_MSA_REGISTER(w8);
+ RESET_MSA_REGISTER(w9);
+ RESET_MSA_REGISTER(w10);
+ RESET_MSA_REGISTER(w11);
+ RESET_MSA_REGISTER(w12);
+ RESET_MSA_REGISTER(w13);
+ RESET_MSA_REGISTER(w14);
+ RESET_MSA_REGISTER(w15);
+ RESET_MSA_REGISTER(w16);
+ RESET_MSA_REGISTER(w17);
+ RESET_MSA_REGISTER(w18);
+ RESET_MSA_REGISTER(w19);
+ RESET_MSA_REGISTER(w20);
+ RESET_MSA_REGISTER(w21);
+ RESET_MSA_REGISTER(w22);
+ RESET_MSA_REGISTER(w23);
+ RESET_MSA_REGISTER(w24);
+ RESET_MSA_REGISTER(w25);
+ RESET_MSA_REGISTER(w26);
+ RESET_MSA_REGISTER(w27);
+ RESET_MSA_REGISTER(w28);
+ RESET_MSA_REGISTER(w29);
+ RESET_MSA_REGISTER(w30);
+ RESET_MSA_REGISTER(w31);
+
+}
+
+
#define DO_MSA__WD__WS(suffix, mnemonic) \
static inline void do_msa_##suffix(const void *input, \
const void *output) \