aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mthi.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tcg/mips/user/ase/dsp/test_dsp_r1_mthi.c')
-rw-r--r--tests/tcg/mips/user/ase/dsp/test_dsp_r1_mthi.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mthi.c b/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mthi.c
new file mode 100644
index 0000000000..43a80669d1
--- /dev/null
+++ b/tests/tcg/mips/user/ase/dsp/test_dsp_r1_mthi.c
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+ int achi, acho;
+ int result;
+
+ achi = 0x004433;
+ result = 0x004433;
+
+ __asm
+ ("mthi %1, $ac1\n\t"
+ "mfhi %0, $ac1\n\t"
+ : "=r"(acho)
+ : "r"(achi)
+ );
+ assert(result == acho);
+
+ return 0;
+}