summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-25 10:00:07 +0000
committeredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-25 10:00:07 +0000
commit1b893ef3269532c5b438237da599d338b33b75d0 (patch)
tree682795cdd1209b3000202e6ce92fe345fcf6a05c
parent5d4a534dec61df1dc2e521093040e965c180f63b (diff)
Add testcase for CRIS ftag/fidx cache flushing insns.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3991 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--tests/cris/Makefile1
-rw-r--r--tests/cris/check_ftag.c33
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/cris/Makefile b/tests/cris/Makefile
index a6a28f4ecc..47c93f2a45 100644
--- a/tests/cris/Makefile
+++ b/tests/cris/Makefile
@@ -55,6 +55,7 @@ TESTCASES += check_cmpxm.tst
TESTCASES += check_cmp-2.tst
TESTCASES += check_clrjmp1.tst
TESTCASES += check_dstep.tst
+TESTCASES += check_ftag.tst
TESTCASES += check_int64.tst
# check_jsr is broken.
#TESTCASES += check_jsr.tst
diff --git a/tests/cris/check_ftag.c b/tests/cris/check_ftag.c
new file mode 100644
index 0000000000..40d1507a87
--- /dev/null
+++ b/tests/cris/check_ftag.c
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "sys.h"
+#include "crisutils.h"
+
+extern inline void cris_ftag_i(unsigned int x) {
+ register unsigned int v asm("$r10") = x;
+ asm ("ftagi\t[%0]\n" : : "r" (v) );
+}
+extern inline void cris_ftag_d(unsigned int x) {
+ register unsigned int v asm("$r10") = x;
+ asm ("ftagd\t[%0]\n" : : "r" (v) );
+}
+extern inline void cris_fidx_i(unsigned int x) {
+ register unsigned int v asm("$r10") = x;
+ asm ("fidxi\t[%0]\n" : : "r" (v) );
+}
+extern inline void cris_fidx_d(unsigned int x) {
+ register unsigned int v asm("$r10") = x;
+ asm ("fidxd\t[%0]\n" : : "r" (v) );
+}
+
+
+int main(void)
+{
+ cris_ftag_i(0);
+ cris_ftag_d(0);
+ cris_fidx_i(0);
+ cris_fidx_d(0);
+ pass();
+ return 0;
+}