|
From: <sv...@va...> - 2006-09-11 11:05:33
|
Author: sewardj
Date: 2006-09-11 12:05:26 +0100 (Mon, 11 Sep 2006)
New Revision: 6046
Log:
Add regtest for #132918 (amd64 fprem).
Added:
trunk/none/tests/amd64/bug132918.c
trunk/none/tests/amd64/bug132918.stderr.exp
trunk/none/tests/amd64/bug132918.stdout.exp
trunk/none/tests/amd64/bug132918.vgtest
Modified:
trunk/none/tests/amd64/Makefile.am
Modified: trunk/none/tests/amd64/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/amd64/Makefile.am 2006-09-10 22:34:20 UTC (rev 6045)
+++ trunk/none/tests/amd64/Makefile.am 2006-09-11 11:05:26 UTC (rev 6046)
@@ -8,6 +8,7 @@
bug127521-64.vgtest bug127521-64.stdout.exp bug127521-64.stderr.exp \
bug132813-amd64.vgtest bug132813-amd64.stdout.exp \
bug132813-amd64.stderr.exp \
+ bug132918.vgtest bug132918.stderr.exp bug132918.stdout.exp \
clc.vgtest clc.stdout.exp clc.stderr.exp \
faultstatus.disabled faultstatus.stderr.exp \
fcmovnu.vgtest fcmovnu.stderr.exp fcmovnu.stdout.exp \
@@ -24,7 +25,7 @@
=20
=20
check_PROGRAMS =3D \
- bug127521-64 bug132813-amd64 \
+ bug127521-64 bug132813-amd64 bug132918 \
clc \
faultstatus fcmovnu fxtract $(INSN_TESTS) looper jrcxz smc1 shrld \
nibz_bennee_mmap
@@ -34,6 +35,7 @@
AM_CXXFLAGS =3D $(AM_CFLAGS)
=20
# generic C ones
+bug132918_LDADD =3D -lm
insn_basic_SOURCES =3D insn_basic.def
insn_basic_LDADD =3D -lm
insn_mmx_SOURCES =3D insn_mmx.def
Added: trunk/none/tests/amd64/bug132918.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/amd64/bug132918.c (rev 0)
+++ trunk/none/tests/amd64/bug132918.c 2006-09-11 11:05:26 UTC (rev 6046)
@@ -0,0 +1,55 @@
+
+#include <stdio.h>
+#include <math.h>
+
+typedef unsigned long long int ULong;
+
+typedef
+ struct { double d; int i; } Res;
+
+static void do_fprem ( Res* res, double x, double y )
+{
+ ULong c3210;
+ double f64;
+ double xx =3D x;
+ double yy =3D y;
+ __asm__ __volatile__(
+ "finit\n\t"
+ "fldl %2\n\t"
+ "fldl %3\n\t"
+ "fprem\n\t"
+ "fstpl %1\n\t"
+ "movq %%rax,%%r15\n\t"
+ "xorq %%rax,%%rax\n\t"
+ "fnstsw %%ax\n\t"
+ "movq %%rax,%0\n\t"
+ "movq %%r15,%%rax"
+ : /*out*/ "=3Dr" (c3210)
+ : /*in*/ "m" (f64), "m" (xx), "m" (yy)
+ : /*trash*/ "r15", "rax", "%st", "%st(1)", "cc"
+ );
+ res->d =3D f64;
+ res->i =3D (int)(c3210 & 0x4700); /* mask for C3,2,1,0 */
+}
+
+static void show ( char* s, Res* res )
+{
+ printf("%s -> 0x%04x %f\n", s, (int)res->i, (double)res->d);
+}
+
+int main ( void )
+{
+ Res r;
+ int i;
+ double theta;
+=20
+ do_fprem(&r, 10.1, 200.2); show("xx1", &r);
+ do_fprem(&r, 20.3, 1.44); show("xx2", &r);
+
+ for (i =3D 0; i < 20; i++) {
+ theta =3D (2.0 * 3.14159) / 10.0 * (double)i;
+ do_fprem(&r, 12.3*sin(theta), cos(theta)); show("xx", &r);
+ }
+
+ return 0;
+}
Added: trunk/none/tests/amd64/bug132918.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/amd64/bug132918.stderr.exp (=
rev 0)
+++ trunk/none/tests/amd64/bug132918.stderr.exp 2006-09-11 11:05:26 UTC (=
rev 6046)
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/amd64/bug132918.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/amd64/bug132918.stdout.exp (=
rev 0)
+++ trunk/none/tests/amd64/bug132918.stdout.exp 2006-09-11 11:05:26 UTC (=
rev 6046)
@@ -0,0 +1,22 @@
+xx1 -> 0x4200 8.300000
+xx2 -> 0x0000 1.440000
+xx -> 0x0000 nan
+xx -> 0x0000 0.809017
+xx -> 0x0000 0.309018
+xx -> 0x0000 -0.309015
+xx -> 0x0000 -0.809016
+xx -> 0x4100 -0.000002
+xx -> 0x0000 -0.809019
+xx -> 0x0000 -0.309021
+xx -> 0x0000 0.309013
+xx -> 0x0000 0.809014
+xx -> 0x4300 0.000002
+xx -> 0x0000 0.809020
+xx -> 0x0000 0.309023
+xx -> 0x0000 -0.309010
+xx -> 0x0000 -0.809013
+xx -> 0x0100 -0.000067
+xx -> 0x0000 -0.809022
+xx -> 0x0000 -0.309026
+xx -> 0x0000 0.309008
+xx -> 0x0000 0.809011
Added: trunk/none/tests/amd64/bug132918.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/amd64/bug132918.vgtest (rev =
0)
+++ trunk/none/tests/amd64/bug132918.vgtest 2006-09-11 11:05:26 UTC (rev =
6046)
@@ -0,0 +1 @@
+prog: bug132918
|