|
From: <sv...@va...> - 2006-10-04 18:01:11
|
Author: sewardj
Date: 2006-10-04 19:01:05 +0100 (Wed, 04 Oct 2006)
New Revision: 6173
Log:
A a test for the 'mcrfs' insn.
Added:
trunk/none/tests/ppc32/mcrfs.c
trunk/none/tests/ppc32/mcrfs.stderr.exp
trunk/none/tests/ppc32/mcrfs.stdout.exp
trunk/none/tests/ppc32/mcrfs.vgtest
Modified:
trunk/none/tests/ppc32/Makefile.am
Modified: trunk/none/tests/ppc32/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/ppc32/Makefile.am 2006-10-04 17:38:13 UTC (rev 6172)
+++ trunk/none/tests/ppc32/Makefile.am 2006-10-04 18:01:05 UTC (rev 6173)
@@ -8,6 +8,7 @@
jm-fp.stderr.exp jm-fp.stdout.exp jm-fp.vgtest \
jm-vmx.stderr.exp jm-vmx.stdout.exp jm-vmx.vgtest \
mftocrf.stderr.exp mftocrf.stdout.exp mftocrf.vgtest \
+ mcrfs.stderr.exp mcrfs.stdout.exp mcrfs.vgtest \
round.stderr.exp round.stdout.exp round.vgtest \
test_fx.stderr.exp test_fx.stdout.exp test_fx.vgtest \
test_gx.stderr.exp test_gx.stdout.exp test_gx.vgtest \
@@ -16,8 +17,8 @@
xlc_dbl_u32.stderr.exp xlc_dbl_u32.stdout.exp xlc_dbl_u32.vgtest
=20
check_PROGRAMS =3D \
- ldstrev lsw jm-insns mftocrf round test_fx test_gx testVMX \
- twi xlc_dbl_u32
+ ldstrev lsw jm-insns mftocrf mcrfs round test_fx test_gx \
+ testVMX twi xlc_dbl_u32
=20
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/inc=
lude \
@FLAG_M32@
Added: trunk/none/tests/ppc32/mcrfs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/ppc32/mcrfs.c (rev 0)
+++ trunk/none/tests/ppc32/mcrfs.c 2006-10-04 18:01:05 UTC (rev 6173)
@@ -0,0 +1,52 @@
+
+#include <stdio.h>
+
+typedef unsigned int UInt;
+
+void set_fpscr ( UInt x )
+{
+ UInt d[2];
+ d[0] =3D 0;
+ d[1] =3D x;
+ __asm__ __volatile__(
+ "lfd %%f0,0(%0)\n\t"
+ "mtfsf 255,%%f0"
+ : /*out*/
+ : /*in*/ "b"(&d[0])
+ : /*trash*/ "fr0", "cc", "memory"
+ );
+
+}
+
+int main ( void )
+{
+ int i;
+ UInt r;
+ for (i =3D 0; i < 16; i++) {
+ set_fpscr(i);
+ __asm__ __volatile__(
+ "li %0,0\n\t"
+ "mtcr %0\n\t"
+ "mcrfs 1,7\n\t"
+ "mfcr %0"
+ : /*out*/ "=3Db"(r)
+ : /*in*/=20
+ : /*trash*/ "cc"=20
+ );
+ printf("0x%x -> 0x%08x\n", i, r);
+ }
+ for (i =3D 0; i < 16; i++) {
+ set_fpscr(i);
+ __asm__ __volatile__(
+ "li %0,-1\n\t"
+ "mtcr %0\n\t"
+ "mcrfs 1,7\n\t"
+ "mfcr %0"
+ : /*out*/ "=3Db"(r)
+ : /*in*/=20
+ : /*trash*/ "cc"=20
+ );
+ printf("0x%x -> 0x%08x\n", i, r);
+ }
+ return 0;
+}
Added: trunk/none/tests/ppc32/mcrfs.stderr.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/ppc32/mcrfs.stderr.exp (rev =
0)
+++ trunk/none/tests/ppc32/mcrfs.stderr.exp 2006-10-04 18:01:05 UTC (rev =
6173)
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/ppc32/mcrfs.stdout.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/ppc32/mcrfs.stdout.exp (rev =
0)
+++ trunk/none/tests/ppc32/mcrfs.stdout.exp 2006-10-04 18:01:05 UTC (rev =
6173)
@@ -0,0 +1,32 @@
+0x0 -> 0x00000000
+0x1 -> 0x01000000
+0x2 -> 0x02000000
+0x3 -> 0x03000000
+0x4 -> 0x00000000
+0x5 -> 0x01000000
+0x6 -> 0x02000000
+0x7 -> 0x03000000
+0x8 -> 0x00000000
+0x9 -> 0x01000000
+0xa -> 0x02000000
+0xb -> 0x03000000
+0xc -> 0x00000000
+0xd -> 0x01000000
+0xe -> 0x02000000
+0xf -> 0x03000000
+0x0 -> 0xf0ffffff
+0x1 -> 0xf1ffffff
+0x2 -> 0xf2ffffff
+0x3 -> 0xf3ffffff
+0x4 -> 0xf0ffffff
+0x5 -> 0xf1ffffff
+0x6 -> 0xf2ffffff
+0x7 -> 0xf3ffffff
+0x8 -> 0xf0ffffff
+0x9 -> 0xf1ffffff
+0xa -> 0xf2ffffff
+0xb -> 0xf3ffffff
+0xc -> 0xf0ffffff
+0xd -> 0xf1ffffff
+0xe -> 0xf2ffffff
+0xf -> 0xf3ffffff
Added: trunk/none/tests/ppc32/mcrfs.vgtest
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/ppc32/mcrfs.vgtest (rev 0)
+++ trunk/none/tests/ppc32/mcrfs.vgtest 2006-10-04 18:01:05 UTC (rev 6173=
)
@@ -0,0 +1 @@
+prog: mcrfs
|