You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(9) |
2
(7) |
3
(15) |
4
(14) |
|
5
(12) |
6
(18) |
7
(16) |
8
(13) |
9
(14) |
10
(20) |
11
(26) |
|
12
(14) |
13
(25) |
14
(20) |
15
(15) |
16
(14) |
17
(13) |
18
(12) |
|
19
(8) |
20
(16) |
21
(15) |
22
(37) |
23
(15) |
24
(18) |
25
(12) |
|
26
(8) |
27
(13) |
28
(12) |
|
|
|
|
|
From: <sv...@va...> - 2006-02-06 23:22:38
|
Author: sewardj
Date: 2006-02-06 23:22:31 +0000 (Mon, 06 Feb 2006)
New Revision: 5616
Log:
This causes problems on setups where ld.so is mapped at just over 1M:
it zeroes out that area (as a result of one of the mmaps) and the
program consequently goes into an infinite loop. Change the map sizes
to just one page to avoid that.
Modified:
trunk/memcheck/tests/zeropage.c
Modified: trunk/memcheck/tests/zeropage.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/memcheck/tests/zeropage.c 2006-02-06 05:31:37 UTC (rev 5615)
+++ trunk/memcheck/tests/zeropage.c 2006-02-06 23:22:31 UTC (rev 5616)
@@ -11,25 +11,25 @@
int main(void)
{
/* mmap(0x0, ... FIXED) should fail */
- int* m =3D mmap(0x0, 1000000, PROT_READ|PROT_WRITE,=20
+ int* m =3D mmap(0x0, 4096, PROT_READ|PROT_WRITE,=20
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
if (m !=3D (int*)-1)
printf("succeeded?!\n");
=20
/* mmap(0x1000, ... FIXED) should fail */
- m =3D mmap((void*)0x1000, 1000000, PROT_READ|PROT_WRITE,=20
+ m =3D mmap((void*)0x1000, 4096, PROT_READ|PROT_WRITE,=20
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
if (m !=3D (int*)-1)
printf("succeeded?!\n");
=20
/* mmap(0xa000, ... FIXED) should fail */
- m =3D mmap((void*)0xa000, 1000000, PROT_READ|PROT_WRITE,=20
+ m =3D mmap((void*)0xa000, 4096, PROT_READ|PROT_WRITE,=20
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
if (m !=3D (int*)-1)
printf("succeeded?!\n");
=20
/* mmap(0x10000, ... FIXED) should fail */
- m =3D mmap((void*)0x10000, 1000000, PROT_READ|PROT_WRITE,=20
+ m =3D mmap((void*)0x10000, 4096, PROT_READ|PROT_WRITE,=20
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0);
if (m =3D=3D (int*)-1)
printf("failed?!\n");
|
|
From: <sv...@va...> - 2006-02-06 22:19:21
|
Author: sewardj
Date: 2006-02-06 22:19:17 +0000 (Mon, 06 Feb 2006)
New Revision: 1570
Log:
fre: observe the current rounding mode
Modified:
trunk/priv/guest-ppc/toIR.c
Modified: trunk/priv/guest-ppc/toIR.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/priv/guest-ppc/toIR.c 2006-02-06 22:18:38 UTC (rev 1569)
+++ trunk/priv/guest-ppc/toIR.c 2006-02-06 22:19:17 UTC (rev 1570)
@@ -5828,10 +5828,8 @@
frD_addr, frB_addr);
{ IRExpr* ieee_one
=3D IRExpr_Const(IRConst_F64i(0x3ff0000000000000ULL));
- /* Does this really depend on the rounding mode? Play safe
- and use the default. */
assign( frD, triop( Iop_DivF64,=20
- mkU32(Irrm_NEAREST),=20
+ rm,
ieee_one, mkexpr(frB) ));
}
break;
|
|
From: <sv...@va...> - 2006-02-06 22:18:46
|
Author: sewardj
Date: 2006-02-06 22:18:38 +0000 (Mon, 06 Feb 2006)
New Revision: 1569
Log:
Redo x86g_calculate_FXTRACT to only use integer arithmetic.
Modified:
trunk/priv/guest-x86/ghelpers.c
Modified: trunk/priv/guest-x86/ghelpers.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/priv/guest-x86/ghelpers.c 2006-02-06 03:58:31 UTC (rev 1568)
+++ trunk/priv/guest-x86/ghelpers.c 2006-02-06 22:18:38 UTC (rev 1569)
@@ -1250,11 +1250,10 @@
otherwise. */
ULong x86g_calculate_FXTRACT ( ULong arg, UInt getExp )
{
- ULong uSig;
- Long sSig;
- Double dSig, dExp;
+ ULong uSig, uExp;
+ /* Long sSig; */
Int sExp, i;
- UInt sign;
+ UInt sign, expExp;
=20
/*
S 7FF 0------0 infinity
@@ -1269,6 +1268,7 @@
const ULong negZero =3D 0x8000000000000000ULL;
const ULong bit51 =3D 1ULL << 51;
const ULong bit52 =3D 1ULL << 52;
+ const ULong sigMask =3D bit52 - 1;
=20
/* Mimic PIII behaviour for special cases. */
if (arg =3D=3D posInf)
@@ -1286,7 +1286,7 @@
sign =3D ((UInt)(arg >> 63)) & 1;
=20
/* Mask off exponent & sign. uSig is in range 0 .. 2^52-1. */
- uSig =3D arg & (bit52 - 1);
+ uSig =3D arg & sigMask;
=20
/* Get the exponent. */
sExp =3D ((Int)(arg >> 52)) & 0x7FF;
@@ -1310,20 +1310,45 @@
}
=20
/* Roll in the sign. */
- sSig =3D uSig;
- if (sign) sSig =3D- sSig;
+ /* sSig =3D uSig; */
+ /* if (sign) sSig =3D- sSig; */
=20
/* Convert sig into a double. This should be an exact conversion.
Then divide by 2^52, which should give a value in the range 1.0
to 2.0-epsilon, at least for normalised args. */
- dSig =3D (Double)sSig;
- dSig /=3D 67108864.0; /* 2^26 */
- dSig /=3D 67108864.0; /* 2^26 */
+ /* dSig =3D (Double)sSig; */
+ /* dSig /=3D 67108864.0; */ /* 2^26 */
+ /* dSig /=3D 67108864.0; */ /* 2^26 */
+ uSig &=3D sigMask;
+ uSig |=3D 0x3FF0000000000000ULL;
+ if (sign)
+ uSig ^=3D negZero;
=20
/* Convert exp into a double. Also an exact conversion. */
- dExp =3D (Double)(sExp - 1023);
+ /* dExp =3D (Double)(sExp - 1023); */
+ sExp -=3D 1023;
+ if (sExp =3D=3D 0) {
+ uExp =3D 0;
+ } else {
+ uExp =3D sExp < 0 ? -sExp : sExp;
+ expExp =3D 0x3FF +52;
+ /* 1 <=3D uExp <=3D 1074 */
+ /* Skip first 42 iterations of normalisation loop as we know they
+ will always happen */
+ uExp <<=3D 42;
+ expExp -=3D 42;
+ for (i =3D 0; i < 52-42; i++) {
+ if (uExp & bit52)
+ break;
+ uExp <<=3D 1;
+ expExp--;
+ }
+ uExp &=3D sigMask;
+ uExp |=3D ((ULong)expExp) << 52;
+ if (sExp < 0) uExp ^=3D negZero;
+ }
=20
- return *(ULong*)(getExp ? &dExp : &dSig);
+ return getExp ? uExp : uSig;
}
=20
=20
@@ -1442,7 +1467,7 @@
{
Int stno, preg;
UInt tag;
- Double* vexRegs =3D (Double*)(&vex_state->guest_FPREG[0]);
+ ULong* vexRegs =3D (ULong*)(&vex_state->guest_FPREG[0]);
UChar* vexTags =3D (UChar*)(&vex_state->guest_FPTAG[0]);
Fpu_State* x87 =3D (Fpu_State*)x87_state;
UInt ftop =3D (x87->env[FP_ENV_STAT] >> 11) & 7;
@@ -1464,7 +1489,7 @@
of sync, in that it thinks all FP registers are defined by
this helper, but in reality some have not been updated. */
if (moveRegs)
- vexRegs[preg] =3D 0.0;
+ vexRegs[preg] =3D 0; /* IEEE754 64-bit zero */
vexTags[preg] =3D 0;
} else {
/* register is non-empty */
@@ -1502,7 +1527,7 @@
{
Int i, stno, preg;
UInt tagw;
- Double* vexRegs =3D (Double*)(&vex_state->guest_FPREG[0]);
+ ULong* vexRegs =3D (ULong*)(&vex_state->guest_FPREG[0]);
UChar* vexTags =3D (UChar*)(&vex_state->guest_FPTAG[0]);
Fpu_State* x87 =3D (Fpu_State*)x87_state;
UInt ftop =3D vex_state->guest_FTOP;
|
|
From: <js...@ac...> - 2006-02-06 11:21:56
|
Nightly build on minnie ( SuSE 10.0, ppc32 ) started at 2006-02-06 05:00:01 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 191 tests, 11 stderr failures, 5 stdout failures ================= memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/mempool (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/stack_changes (stdout) memcheck/tests/stack_changes (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-fp (stderr) none/tests/ppc32/test_fx (stdout) none/tests/ppc32/test_fx (stderr) none/tests/ppc32/test_gx (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 190 tests, 11 stderr failures, 5 stdout failures ================= memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/mempool (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/stack_changes (stdout) memcheck/tests/stack_changes (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-fp (stderr) none/tests/ppc32/test_fx (stdout) none/tests/ppc32/test_fx (stderr) none/tests/ppc32/test_gx (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Feb 6 05:10:31 2006 --- new.short Mon Feb 6 05:20:49 2006 *************** *** 8,10 **** ! == 190 tests, 11 stderr failures, 5 stdout failures ================= memcheck/tests/leak-cycle (stderr) --- 8,10 ---- ! == 191 tests, 11 stderr failures, 5 stdout failures ================= memcheck/tests/leak-cycle (stderr) |
|
From: Robert W. <rj...@du...> - 2006-02-06 05:48:29
|
> I agree. I tried once, but those two are tricky suckers and I didn't w= ant > to break anything so I didn't. They're in the the debug sym code that > only Helgrind uses, and so it may have bitrotted somewhat. Before I left for my conference, I did a hack fix that moved both nested functions out and passed in pointers to any variables they modified. It compiled and no extra tests failed, but as I said, it was hacky. Patch i= s attached. If you're all OK with it, I'll commit it. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. "We bring dead things to life" |
|
From: <sv...@va...> - 2006-02-06 05:31:41
|
Author: sewardj
Date: 2006-02-06 05:31:37 +0000 (Mon, 06 Feb 2006)
New Revision: 5615
Log:
Set fpscr back to a known state after running generated code (64-bit mode=
).
Modified:
trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S
Modified: trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/coregrind/m_dispatch/dispatch-ppc64-linux.S 2006-02-06 05:14:31=
UTC (rev 5614)
+++ trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S 2006-02-06 05:31:37=
UTC (rev 5615)
@@ -432,19 +432,15 @@
/* We're leaving. Check that nobody messed with
VSCR or FPSCR. */
=20
- /* This check avoidance may be removable if stfiwx is
- implemented. */
-# if 0 //!defined(ENABLE_INNER)
- /* Check FPSCR & 0xFF =3D=3D 0 (lowest 8bits are controls) */
- mffs 4 /* fpscr -> fpr */
- li 5,144 /* =3D> 96(parent_sp) */
- stfiwx 4,5,1 /* fpr to stack */
- lwzx 6,5,1 /* load to gpr */
- andi. 6,6,0xFF /* mask wanted bits */
- cmplwi 6,0x0 /* cmp with zero */
- bne .invariant_violation /* branch if not zero */
-# endif
-
+ /* Set fpscr back to a known state, since vex-generated code
+ may have messed with fpscr[rm]. */
+ li 5,0
+ addi 1,1,-16
+ stw 5,0(1)
+ lfs 3,0(1)
+ addi 1,1,16
+ mtfsf 0xFF,3 /* fpscr =3D f3 */
+=09
/* Using r11 - value used again further on, so don't trash! */
ld 11,.tocent__vgPlain_machine_ppc64_has_VMX@toc(2)
ld 11,0(11)
|
|
From: <sv...@va...> - 2006-02-06 05:14:36
|
Author: sewardj
Date: 2006-02-06 05:14:31 +0000 (Mon, 06 Feb 2006)
New Revision: 5614
Log:
Set fpscr back to a known state after running generated code.
Modified:
trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
Modified: trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/coregrind/m_dispatch/dispatch-ppc32-linux.S 2006-02-06 04:49:58=
UTC (rev 5613)
+++ trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S 2006-02-06 05:14:31=
UTC (rev 5614)
@@ -399,18 +399,14 @@
cmplwi 10,0
beq LafterFP8
=20
- /* This check avoidance may be removable if stfiwx is
- implemented. */
-# if 0 //!defined(ENABLE_INNER)
- /* Check FPSCR & 0xFF =3D=3D 0 (lowest 8bits are controls) */
- mffs 4 /* fpscr -> fpr */
- li 5,48
- stfiwx 4,5,1 /* fpr to stack */
- lwzx 6,5,1 /* load to gpr */
- andi. 6,6,0xFF /* mask wanted bits */
- cmplwi 6,0x0 /* cmp with zero */
- bne invariant_violation /* branch if not zero */
-# endif
+ /* Set fpscr back to a known state, since vex-generated code
+ may have messed with fpscr[rm]. */
+ li 5,0
+ addi 1,1,-16
+ stw 5,0(1)
+ lfs 3,0(1)
+ addi 1,1,16
+ mtfsf 0xFF,3 /* fpscr =3D f3 */
LafterFP8:
=20
/* Using r11 - value used again further on, so don't trash! */
|
|
From: <sv...@va...> - 2006-02-06 04:50:05
|
Author: sewardj
Date: 2006-02-06 04:49:58 +0000 (Mon, 06 Feb 2006)
New Revision: 5613
Log:
Test program aimed at exercising x87 insns a bit on amd64.
Added:
trunk/memcheck/tests/amd64/more_x87_fp.c
trunk/memcheck/tests/amd64/more_x87_fp.stderr.exp
trunk/memcheck/tests/amd64/more_x87_fp.stdout.exp
trunk/memcheck/tests/amd64/more_x87_fp.vgtest
Modified:
trunk/memcheck/tests/amd64/Makefile.am
Modified: trunk/memcheck/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/memcheck/tests/amd64/Makefile.am 2006-02-06 04:20:51 UTC (rev 5=
612)
+++ trunk/memcheck/tests/amd64/Makefile.am 2006-02-06 04:49:58 UTC (rev 5=
613)
@@ -8,11 +8,16 @@
$(addsuffix .stderr.exp,$(INSN_TESTS)) \
$(addsuffix .stdout.exp,$(INSN_TESTS)) \
$(addsuffix .vgtest,$(INSN_TESTS)) \
+ more_x87_fp.stderr.exp more_x87_fp.stdout.exp more_x87_fp.vgtest \
sse_memory.stderr.exp sse_memory.stdout.exp sse_memory.vgtest
=20
-check_PROGRAMS =3D sse_memory
+check_PROGRAMS =3D more_x87_fp sse_memory
=20
AM_CPPFLAGS =3D -I$(top_srcdir)/include
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/inc=
lude
@FLAG_M64@
AM_CXXFLAGS =3D $(AM_CFLAGS)
+
+more_x87_fp_CFLAGS =3D $(AM_CFLAGS) -O -ffast-math -mfpmath=3D387 \
+ -mfancy-math-387
+more_x87_fp_LDADD =3D -lm
Added: trunk/memcheck/tests/amd64/more_x87_fp.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/memcheck/tests/amd64/more_x87_fp.c (rev=
0)
+++ trunk/memcheck/tests/amd64/more_x87_fp.c 2006-02-06 04:49:58 UTC (rev=
5613)
@@ -0,0 +1,273 @@
+
+/* On amd64, to exercise x87, compile with=20
+ gcc4 -ffast-math -mfpmath=3D387 -mfancy-math-387
+
+ gcc4 really does generate all the sin cos tan stuff as=20
+ x87 insns inline. gcc 3.3 doesn't, which makes the test
+ pretty useless, but it should still pass. To be on the safe
+ side we need to link with -lm to handle the gcc 3.3 behaviour.
+*/
+
+/* Derived from: */
+
+/*
+ * x86 CPU test
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <inttypes.h>
+#include <math.h>
+
+/**********************************************/
+
+void test_fops(double a, double b)
+{
+ printf("a=3D%f b=3D%f a+b=3D%f\n", a, b, a + b);
+ printf("a=3D%f b=3D%f a-b=3D%f\n", a, b, a - b);
+ printf("a=3D%f b=3D%f a*b=3D%f\n", a, b, a * b);
+ printf("a=3D%f b=3D%f a/b=3D%f\n", a, b, a / b);
+ // requires fprem/fprem1 -- not done
+ //printf("a=3D%f b=3D%f fmod(a, b)=3D%f\n", a, b, fmod(a, b));
+ printf("a=3D%f sqrt(a)=3D%f\n", a, sqrt(a));
+ printf("a=3D%f sin(a)=3D%f\n", a, sin(a));
+ printf("a=3D%f cos(a)=3D%f\n", a, cos(a));
+ printf("a=3D%f tan(a)=3D%f\n", a, tan(a));
+ printf("a=3D%f log(a)=3D%f\n", a, log(a));
+ printf("a=3D%f exp(a)=3D%f\n", a, exp(a));
+ printf("a=3D%f b=3D%f atan2(a, b)=3D%f\n", a, b, atan2(a, b));
+ /* just to test some op combining */
+ printf("a=3D%f asin(sin(a))=3D%f\n", a, asin(sin(a)));
+ printf("a=3D%f acos(cos(a))=3D%f\n", a, acos(cos(a)));
+ printf("a=3D%f atan(tan(a))=3D%f\n", a, atan(tan(a)));
+}
+#define CC_C 0x0001
+#define CC_P 0x0004
+#define CC_A 0x0010
+#define CC_Z 0x0040
+#define CC_S 0x0080
+#define CC_O 0x0800
+
+
+void test_fcmp(double a, double b)
+{
+ printf("(%f<%f)=3D%d\n",
+ a, b, a < b);
+ printf("(%f<=3D%f)=3D%d\n",
+ a, b, a <=3D b);
+ printf("(%f=3D=3D%f)=3D%d\n",
+ a, b, a =3D=3D b);
+ printf("(%f>%f)=3D%d\n",
+ a, b, a > b);
+ printf("(%f<=3D%f)=3D%d\n",
+ a, b, a >=3D b);
+ {
+ unsigned long long int eflags;
+ /* test f(u)comi instruction */
+ asm("fcomi %2, %1\n"
+ "pushfq\n"
+ "popq %0\n"
+ : "=3Dr" (eflags)
+ : "t" (a), "u" (b));
+ printf("fcomi(%f %f)=3D%08llx\n", a, b, eflags & (CC_Z | CC_P | =
CC_C));
+ }
+}
+
+void test_fcvt(double a)
+{
+ float fa;
+ long double la;
+ int16_t fpuc;
+ int i;
+ int64_t lla;
+ int ia;
+ int16_t wa;
+ double ra;
+
+ fa =3D a;
+ la =3D a;
+ printf("(float)%e =3D %e\n", a, fa);
+ printf("(long double)%f =3D %Lf\n", a, la);
+ printf("a=3D%016Lx\n", *(long long *)&a);
+ printf("la=3D%016Lx %04x\n", *(long long *)&la,=20
+ *(unsigned short *)((char *)(&la) + 8));
+
+ /* test all roundings */
+ asm volatile ("fstcw %0" : "=3Dm" (fpuc));
+ for(i=3D0;i<4;i++) {
+ int16_t tmp =3D (fpuc & ~0x0c00) | (i << 10);
+ asm volatile ("fldcw %0" : : "m" (tmp));
+ wa=3D0;//asm volatile ("fist %0" : "=3Dm" (wa) : "t" (a));
+ asm volatile ("fistl %0" : "=3Dm" (ia) : "t" (a));
+ asm volatile ("fistpll %0" : "=3Dm" (lla) : "t" (a) : "st");
+ asm volatile ("frndint ; fstl %0" : "=3Dm" (ra) : "t" (a));
+ asm volatile ("fldcw %0" : : "m" (fpuc));
+ printf("(short)a =3D %d\n", wa);
+ printf("(int)a =3D %d\n", ia);
+ printf("(int64_t)a =3D %lld\n", (long long int)lla);
+ printf("rint(a) =3D %f\n", ra);
+ }
+}
+
+#define TEST(N) \
+ asm("fld" #N : "=3Dt" (a)); \
+ printf("fld" #N "=3D %f\n", a);
+
+void test_fconst(void)
+{
+ double a;
+ TEST(1);
+ TEST(l2t);
+ TEST(l2e);
+ TEST(pi);
+ TEST(lg2);
+ TEST(ln2);
+ TEST(z);
+}
+
+void test_fbcd(double a)
+{
+ unsigned short bcd[5];
+ double b;
+
+ asm("fbstp %0" : "=3Dm" (bcd[0]) : "t" (a) : "st");
+ asm("fbld %1" : "=3Dt" (b) : "m" (bcd[0]));
+ printf("a=3D%f bcd=3D%04x%04x%04x%04x%04x b=3D%f\n",=20
+ a, bcd[4], bcd[3], bcd[2], bcd[1], bcd[0], b);
+}
+
+#define TEST_ENV(env, save, restore)\
+{\
+ memset((env), 0xaa, sizeof(*(env)));\
+ for(i=3D0;i<5;i++)\
+ asm volatile ("fldl %0" : : "m" (dtab[i]));\
+ asm(save " %0\n" : : "m" (*(env)));\
+ asm(restore " %0\n": : "m" (*(env)));\
+ for(i=3D0;i<5;i++)\
+ asm volatile ("fstpl %0" : "=3Dm" (rtab[i]));\
+ for(i=3D0;i<5;i++)\
+ printf("res[%d]=3D%f\n", i, rtab[i]);\
+ printf("fpuc=3D%04x fpus=3D%04x fptag=3D%04x\n",\
+ (env)->fpuc,\
+ (env)->fpus & 0xff00,\
+ (env)->fptag);\
+}
+
+void test_fenv(void)
+{
+ struct __attribute__((packed)) {
+ uint16_t fpuc;
+ uint16_t dummy1;
+ uint16_t fpus;
+ uint16_t dummy2;
+ uint16_t fptag;
+ uint16_t dummy3;
+ uint32_t ignored[4];
+ long double fpregs[8];
+ } float_env32;
+ struct __attribute__((packed)) {
+ uint16_t fpuc;
+ uint16_t fpus;
+ uint16_t fptag;
+ uint16_t ignored[4];
+ long double fpregs[8];
+ } float_env16;
+ double dtab[8];
+ double rtab[8];
+ int i;
+
+ for(i=3D0;i<8;i++)
+ dtab[i] =3D i + 1;
+
+ TEST_ENV(&float_env16, "data16 fnstenv", "data16 fldenv");
+ TEST_ENV(&float_env16, "data16 fnsave", "data16 frstor");
+ TEST_ENV(&float_env32, "fnstenv", "fldenv");
+ TEST_ENV(&float_env32, "fnsave", "frstor");
+
+ /* test for ffree */
+ for(i=3D0;i<5;i++)
+ asm volatile ("fldl %0" : : "m" (dtab[i]));
+ asm volatile("ffree %st(2)");
+ asm volatile ("fnstenv %0\n" : : "m" (float_env32));
+ asm volatile ("fninit");
+ printf("fptag=3D%04x\n", float_env32.fptag);
+}
+
+
+#define TEST_FCMOV(a, b, eflags, CC)\
+{\
+ double res;\
+ asm("pushq %3\n"\
+ "popfq\n"\
+ "fcmov" CC " %2, %0\n"\
+ : "=3Dt" (res)\
+ : "0" (a), "u" (b), "g" ((long long int)eflags));\
+ printf("fcmov%s eflags=3D0x%04llx-> %f\n", \
+ CC, (long long int)eflags, res);\
+}
+
+void test_fcmov(void)
+{
+ double a, b;
+ long long int eflags, i;
+
+ a =3D 1.0;
+ b =3D 2.0;
+ for(i =3D 0; i < 4; i++) {
+ eflags =3D 0;
+ if (i & 1)
+ eflags |=3D CC_C;
+ if (i & 2)
+ eflags |=3D CC_Z;
+ TEST_FCMOV(a, b, eflags, "b");
+ TEST_FCMOV(a, b, eflags, "e");
+ TEST_FCMOV(a, b, eflags, "be");
+ TEST_FCMOV(a, b, eflags, "nb");
+ TEST_FCMOV(a, b, eflags, "ne");
+ TEST_FCMOV(a, b, eflags, "nbe");
+ }
+ TEST_FCMOV(a, b, 0, "u");
+ TEST_FCMOV(a, b, CC_P, "u");
+ TEST_FCMOV(a, b, 0, "nu");
+ TEST_FCMOV(a, b, CC_P, "nu");
+}
+
+void test_floats(void)
+{
+ test_fops(2, 3);
+ test_fops(1.4, -5);
+ test_fcmp(2, -1);
+ test_fcmp(2, 2);
+ test_fcmp(2, 3);
+ test_fcvt(0.5);
+ test_fcvt(-0.5);
+ test_fcvt(1.0/7.0);
+ test_fcvt(-1.0/9.0);
+ test_fcvt(32768);
+ test_fcvt(-1e20);
+ test_fconst();
+}
+
+int main ( void )
+{
+ test_floats();
+ return 0;
+}
Added: trunk/memcheck/tests/amd64/more_x87_fp.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
Added: trunk/memcheck/tests/amd64/more_x87_fp.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/memcheck/tests/amd64/more_x87_fp.stdout.exp =
(rev 0)
+++ trunk/memcheck/tests/amd64/more_x87_fp.stdout.exp 2006-02-06 04:49:58=
UTC (rev 5613)
@@ -0,0 +1,173 @@
+a=3D2.000000 b=3D3.000000 a+b=3D5.000000
+a=3D2.000000 b=3D3.000000 a-b=3D-1.000000
+a=3D2.000000 b=3D3.000000 a*b=3D6.000000
+a=3D2.000000 b=3D3.000000 a/b=3D0.666667
+a=3D2.000000 sqrt(a)=3D1.414214
+a=3D2.000000 sin(a)=3D0.909297
+a=3D2.000000 cos(a)=3D-0.416147
+a=3D2.000000 tan(a)=3D-2.185040
+a=3D2.000000 log(a)=3D0.693147
+a=3D2.000000 exp(a)=3D7.389056
+a=3D2.000000 b=3D3.000000 atan2(a, b)=3D0.588003
+a=3D2.000000 asin(sin(a))=3D1.141593
+a=3D2.000000 acos(cos(a))=3D2.000000
+a=3D2.000000 atan(tan(a))=3D-1.141593
+a=3D1.400000 b=3D-5.000000 a+b=3D-3.600000
+a=3D1.400000 b=3D-5.000000 a-b=3D6.400000
+a=3D1.400000 b=3D-5.000000 a*b=3D-7.000000
+a=3D1.400000 b=3D-5.000000 a/b=3D-0.280000
+a=3D1.400000 sqrt(a)=3D1.183216
+a=3D1.400000 sin(a)=3D0.985450
+a=3D1.400000 cos(a)=3D0.169967
+a=3D1.400000 tan(a)=3D5.797884
+a=3D1.400000 log(a)=3D0.336472
+a=3D1.400000 exp(a)=3D4.055200
+a=3D1.400000 b=3D-5.000000 atan2(a, b)=3D2.868584
+a=3D1.400000 asin(sin(a))=3D1.400000
+a=3D1.400000 acos(cos(a))=3D1.400000
+a=3D1.400000 atan(tan(a))=3D1.400000
+(2.000000<-1.000000)=3D0
+(2.000000<=3D-1.000000)=3D0
+(2.000000=3D=3D-1.000000)=3D0
+(2.000000>-1.000000)=3D1
+(2.000000<=3D-1.000000)=3D1
+fcomi(2.000000 -1.000000)=3D00000000
+(2.000000<2.000000)=3D0
+(2.000000<=3D2.000000)=3D1
+(2.000000=3D=3D2.000000)=3D1
+(2.000000>2.000000)=3D0
+(2.000000<=3D2.000000)=3D1
+fcomi(2.000000 2.000000)=3D00000040
+(2.000000<3.000000)=3D1
+(2.000000<=3D3.000000)=3D1
+(2.000000=3D=3D3.000000)=3D0
+(2.000000>3.000000)=3D0
+(2.000000<=3D3.000000)=3D0
+fcomi(2.000000 3.000000)=3D00000001
+(float)5.000000e-01 =3D 5.000000e-01
+(long double)0.500000 =3D 0.500000
+a=3D3fe0000000000000
+la=3D8000000000000000 3ffe
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D 0.000000
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D 0.000000
+(short)a =3D 0
+(int)a =3D 1
+(int64_t)a =3D 1
+rint(a) =3D 1.000000
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D 0.000000
+(float)-5.000000e-01 =3D -5.000000e-01
+(long double)-0.500000 =3D -0.500000
+a=3Dbfe0000000000000
+la=3D8000000000000000 bffe
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D -0.000000
+(short)a =3D 0
+(int)a =3D -1
+(int64_t)a =3D -1
+rint(a) =3D -1.000000
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D -0.000000
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D -0.000000
+(float)1.428571e-01 =3D 1.428571e-01
+(long double)0.142857 =3D 0.142857
+a=3D3fc2492492492492
+la=3D9249249249249000 3ffc
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D 0.000000
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D 0.000000
+(short)a =3D 0
+(int)a =3D 1
+(int64_t)a =3D 1
+rint(a) =3D 1.000000
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D 0.000000
+(float)-1.111111e-01 =3D -1.111111e-01
+(long double)-0.111111 =3D -0.111111
+a=3Dbfbc71c71c71c71c
+la=3De38e38e38e38e000 bffb
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D -0.000000
+(short)a =3D 0
+(int)a =3D -1
+(int64_t)a =3D -1
+rint(a) =3D -1.000000
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D -0.000000
+(short)a =3D 0
+(int)a =3D 0
+(int64_t)a =3D 0
+rint(a) =3D -0.000000
+(float)3.276800e+04 =3D 3.276800e+04
+(long double)32768.000000 =3D 32768.000000
+a=3D40e0000000000000
+la=3D8000000000000000 400e
+(short)a =3D 0
+(int)a =3D 32768
+(int64_t)a =3D 32768
+rint(a) =3D 32768.000000
+(short)a =3D 0
+(int)a =3D 32768
+(int64_t)a =3D 32768
+rint(a) =3D 32768.000000
+(short)a =3D 0
+(int)a =3D 32768
+(int64_t)a =3D 32768
+rint(a) =3D 32768.000000
+(short)a =3D 0
+(int)a =3D 32768
+(int64_t)a =3D 32768
+rint(a) =3D 32768.000000
+(float)-1.000000e+20 =3D -1.000000e+20
+(long double)-100000000000000000000.000000 =3D -100000000000000000000.00=
0000
+a=3Dc415af1d78b58c40
+la=3Dad78ebc5ac620000 c041
+(short)a =3D 0
+(int)a =3D -2147483648
+(int64_t)a =3D -9223372036854775808
+rint(a) =3D -100000000000000000000.000000
+(short)a =3D 0
+(int)a =3D -2147483648
+(int64_t)a =3D -9223372036854775808
+rint(a) =3D -100000000000000000000.000000
+(short)a =3D 0
+(int)a =3D -2147483648
+(int64_t)a =3D -9223372036854775808
+rint(a) =3D -100000000000000000000.000000
+(short)a =3D 0
+(int)a =3D -2147483648
+(int64_t)a =3D -9223372036854775808
+rint(a) =3D -100000000000000000000.000000
+fld1=3D 1.000000
+fldl2t=3D 3.321928
+fldl2e=3D 1.442695
+fldpi=3D 3.141593
+fldlg2=3D 0.301030
+fldln2=3D 0.693147
+fldz=3D 0.000000
Added: trunk/memcheck/tests/amd64/more_x87_fp.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/memcheck/tests/amd64/more_x87_fp.vgtest =
(rev 0)
+++ trunk/memcheck/tests/amd64/more_x87_fp.vgtest 2006-02-06 04:49:58 UTC=
(rev 5613)
@@ -0,0 +1,2 @@
+prog: more_x87_fp
+vgopts: -q
|
|
From: <sv...@va...> - 2006-02-06 04:20:54
|
Author: sewardj
Date: 2006-02-06 04:20:51 +0000 (Mon, 06 Feb 2006)
New Revision: 5612
Log:
Regtest for a double -> unsigned int conversion that xlc generates
inline, which requires observing rounding modes properly for fadd.
=20
Added:
trunk/none/tests/ppc32/xlc_dbl_u32.c
trunk/none/tests/ppc32/xlc_dbl_u32.stderr.exp
trunk/none/tests/ppc32/xlc_dbl_u32.stdout.exp
trunk/none/tests/ppc32/xlc_dbl_u32.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-02-06 04:19:30 UTC (rev 5611)
+++ trunk/none/tests/ppc32/Makefile.am 2006-02-06 04:20:51 UTC (rev 5612)
@@ -8,10 +8,11 @@
jm-vmx.stderr.exp jm-vmx.stdout.exp jm-vmx.vgtest \
test_fx.stderr.exp test_fx.stdout.exp test_fx.vgtest \
test_gx.stderr.exp test_gx.stdout.exp test_gx.vgtest \
- testVMX.stderr.exp testVMX.stdout.exp testVMX.vgtest
+ testVMX.stderr.exp testVMX.stdout.exp testVMX.vgtest \
+ xlc_dbl_u32.stderr.exp xlc_dbl_u32.stdout.exp xlc_dbl_u32.vgtest
=20
check_PROGRAMS =3D \
- lsw jm-insns test_fx test_gx testVMX
+ lsw jm-insns test_fx test_gx testVMX xlc_dbl_u32
=20
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/inc=
lude \
@FLAG_M32@
Added: trunk/none/tests/ppc32/xlc_dbl_u32.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/xlc_dbl_u32.c (rev 0)
+++ trunk/none/tests/ppc32/xlc_dbl_u32.c 2006-02-06 04:20:51 UTC (rev 561=
2)
@@ -0,0 +1,62 @@
+
+/* This is code generated by xlc -O3 for conversion of a double to an
+ unsigned 32-bit int, in a "floor" style. It relies on doing an
+ fadd with a non-standard rounding mode and so checks that V handles
+ the rounding mode correctly. r will be 1 if that is not so. */
+
+#include <stdio.h>
+
+extern unsigned int xlc_double_to_u32 ( double );
+asm("\n"
+".text\n"
+".global xlc_double_to_u32\n"
+".type xlc_double_to_u32, @function\n"
+"xlc_double_to_u32:\n"
+" stwu %r1,-48(%r1)\n"
+" addis %r4,%r0,.const_dr@ha\n"
+" addis %r0,%r0,17376\n"
+" fabs %f0,%f1\n"
+" addi %r3,%r0,0\n"
+" mffs %f3\n"
+" mtfsb1 4*cr7+so\n"
+" lfs %f2,.const_dr@l(%r4)\n"
+" fcmpu 0,%f1,%f0\n"
+" fadd %f0,%f0,%f2\n"
+" mtfsf 255,%f3\n"
+" stfd %f0,24(%r1)\n"
+" bne- $+0x1c\n"
+" lwz %r3,24(%r1)\n"
+" subf %r0,%r3,%r0\n"
+" srawi %r0,%r0,31\n"
+" ori %r0,%r0,0x0000\n"
+" lwz %r4,28(%r1)\n"
+" or %r3,%r4,%r0\n"
+" addi %r1,%r1,48\n"
+" blr\n"
+".size xlc_double_to_u32, . - xlc_double_to_u32\n"
+" .long 0\n"
+" .long 0x00000000\n"
+" .long 0x00000000\n"
+"\n"
+" .section \".rodata\",\"a\"\n"
+" .align 3\n"
+" .type .const_dr,@object\n"
+" .size .const_dr,20\n"
+".const_dr:\n"
+" .long 0x59804000\n"
+" .long 0x49424d20\n"
+" .long 0x3fe66666\n"
+" .long 0x66666666\n"
+" .long 0x25640a00\n"
+);
+
+int main (int argc, char** argv)
+{
+ unsigned int r =3D xlc_double_to_u32 ( 0.7 );
+ if (r =3D=3D 0)
+ printf("pass\n");
+ else=20
+ printf("fail\n");
+
+ return 0;
+}
Added: trunk/none/tests/ppc32/xlc_dbl_u32.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/xlc_dbl_u32.stderr.exp =
(rev 0)
+++ trunk/none/tests/ppc32/xlc_dbl_u32.stderr.exp 2006-02-06 04:20:51 UTC=
(rev 5612)
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/ppc32/xlc_dbl_u32.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/xlc_dbl_u32.stdout.exp =
(rev 0)
+++ trunk/none/tests/ppc32/xlc_dbl_u32.stdout.exp 2006-02-06 04:20:51 UTC=
(rev 5612)
@@ -0,0 +1 @@
+pass
Added: trunk/none/tests/ppc32/xlc_dbl_u32.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/xlc_dbl_u32.vgtest (re=
v 0)
+++ trunk/none/tests/ppc32/xlc_dbl_u32.vgtest 2006-02-06 04:20:51 UTC (re=
v 5612)
@@ -0,0 +1 @@
+prog: xlc_dbl_u32
|
|
From: <sv...@va...> - 2006-02-06 04:19:34
|
Author: sewardj
Date: 2006-02-06 04:19:30 +0000 (Mon, 06 Feb 2006)
New Revision: 5611
Log:
Add a program for checking behaviour of ppc floating point insns in
the presence of different rounding modes. This should really be a ppc
regression test, but the output is so large (~30MB) that the
.stdout.exp file would be unviably large.
Added:
trunk/auxprogs/ppcfround.c
Modified:
trunk/auxprogs/Makefile.am
Modified: trunk/auxprogs/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/auxprogs/Makefile.am 2006-02-04 15:43:14 UTC (rev 5610)
+++ trunk/auxprogs/Makefile.am 2006-02-06 04:19:30 UTC (rev 5611)
@@ -4,7 +4,8 @@
bin_PROGRAMS =3D valgrind-listener
=20
noinst_SCRIPTS =3D gen-mdg DotToScc.hs primes.c \
- gsl16test gsl16-badfree.patch gsl16-wavelet.patch
+ gsl16test gsl16-badfree.patch gsl16-wavelet.patch \
+ ppcfround.c
=20
EXTRA_DIST =3D $(noinst_SCRIPTS)
=20
Added: trunk/auxprogs/ppcfround.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/auxprogs/ppcfround.c (rev 0)
+++ trunk/auxprogs/ppcfround.c 2006-02-06 04:19:30 UTC (rev 5611)
@@ -0,0 +1,541 @@
+
+#include <assert.h>
+#include <stdio.h>
+#include <malloc.h>
+
+typedef unsigned int UInt;
+typedef unsigned long long int ULong;
+
+typedef
+ struct {
+ double fres;
+ UInt cr;
+ UInt fpscr; =20
+ }
+ Result;
+
+
+static void set_NEAREST ( void ) {
+ __asm__ __volatile__("mtfsb0 30 ; mtfsb0 31");
+}
+static void set_ZERO ( void ) {
+ __asm__ __volatile__("mtfsb0 30 ; mtfsb1 31");
+}
+static void set_PosINF ( void ) {
+ __asm__ __volatile__("mtfsb1 30 ; mtfsb0 31");
+}
+static void set_NegINF ( void ) {
+ __asm__ __volatile__("mtfsb1 30 ; mtfsb1 31");
+}
+
+
+static ULong double_as_ULong ( double d )
+{
+ union { double dd; ULong ll; } u;
+ assert(sizeof(u) =3D=3D 8);
+ u.dd =3D d;
+ return u.ll;
+}
+
+static ULong round_with_mask ( ULong x, ULong mask )
+{
+ if (mask =3D=3D 1) {
+ switch (x & 1) {
+ case 0: return x;
+ case 1: return x+1;
+ }
+ assert(0);
+ }
+
+ if (mask =3D=3D 3) {
+ switch (x & 3) {
+ case 0: return x;
+ case 1: return x-1;
+ case 2: return x+2;
+ case 3: return x+1;
+ }
+ assert(0);
+ }
+
+ if (mask =3D=3D 7) {
+ switch (x & 7) {
+ case 0: return x;
+ case 1: return x-1;
+ case 2: return x-2;
+ case 3: return x-3;
+ case 4: return x+4;
+ case 5: return x+3;
+ case 6: return x+2;
+ case 7: return x+1;
+ }
+ assert(0);
+ }
+
+ if (mask =3D=3D 15) {
+ switch (x & 15) {
+ case 0: return x;
+ case 1: return x-1;
+ case 2: return x-2;
+ case 3: return x-3;
+ case 4: return x-4;
+ case 5: return x-5;
+ case 6: return x-6;
+ case 7: return x-7;
+ case 8: return x+8;
+ case 9: return x+7;
+ case 10: return x+6;
+ case 11: return x+5;
+ case 12: return x+4;
+ case 13: return x+3;
+ case 14: return x+2;
+ case 15: return x+1;
+ }
+ assert(0);
+ }
+
+ assert(0);
+}
+
+static void showResult ( Result r, ULong hideMask )
+{
+ /* hidemask should have 1 for every result bit we **don't**=20
+ want to show. viz should be all zeroes normally. */
+#if 0
+ printf("(%016llx cr1 0x%01x fprf 0x%02x)",
+ double_as_ULong(r.fres) & ~hidemask,=20
+ (r.cr >> 24) & 0xF, (r.fpscr >> 12) & 0x1F);
+#else
+ printf("(%016llx cr1 ... fprf ...)",
+ (hideMask =3D=3D 0x1 || hideMask =3D=3D 0x3 || hideMask =3D=3D 0x7)
+ ? round_with_mask( double_as_ULong(r.fres), hideMask )
+ : double_as_ULong(r.fres) & ~hideMask
+ );
+#endif
+}
+
+
+/* Give an insn string such as "fmadd %%f4, %%f1,%%f2,%%f3". Args are
+ in f1, f2, f3, and result should go in f4. */
+#define INSN(name,insn) =
\
+ =
\
+ static Result insn_##name ( double arg1, double arg2, double arg3 ) =
\
+ { =
\
+ struct { =
\
+ /* 0 */ double a1; =
\
+ /* 8 */ double a2; =
\
+ /* 16 */ double a3; =
\
+ /* 24 */ double res; =
\
+ /* 32 */ UInt fpscr_after; =
\
+ /* 36 */ UInt cr_after; =
\
+ } foo; =
\
+ assert(sizeof(foo) =3D=3D 40); =
\
+ foo.a1 =3D foo.a2 =3D foo.a3 =3D foo.res =3D 0; =
\
+ foo.fpscr_after =3D foo.cr_after =3D 0; =
\
+ foo.a1 =3D arg1; =
\
+ foo.a2 =3D arg2; =
\
+ foo.a3 =3D arg3; =
\
+ __asm__ __volatile__( =
\
+ "lfd %%f1, 0(%0)\n\t" /* a1 */ =
\
+ "lfd %%f2, 8(%0)\n\t" /* a2 */ =
\
+ "lfd %%f3, 16(%0)\n\t" /* a3 */ =
\
+ insn "\n\t" =
\
+ "stfd %%f4, 24(%0)\n\t" /* res */ =
\
+ "mffs %%f4\n\t" =
\
+ "addi %0,%0,32\n\t" =
\
+ "stfiwx %%f4, %%r0,%0\n\t" /* fpscr_after. r0 reads as zero */ =
\
+ "addi %0,%0,-32\n\t" =
\
+ "mfcr %%r31\n\t" =
\
+ "stw %%r31, 36(%0)" /* cr_after */ =
\
+ : /*out*/ =
\
+ : /*in*/ "b" (&foo.a1) =
\
+ : /*trash*/ "memory","cc", "fr1","fr2","fr3","fr4", "r31" =
\
+ ); =
\
+ { Result result; =
\
+ result.fres =3D foo.res; =
\
+ result.cr =3D foo.cr_after; =
\
+ result.fpscr =3D foo.fpscr_after; =
\
+ return result; =
\
+ } =
\
+ }
+
+INSN(fabs, "fabs %%f4, %%f1");
+INSN(fabs_, "fabs. %%f4, %%f1");
+
+INSN(fnabs, "fnabs %%f4, %%f1");
+INSN(fnabs_, "fnabs. %%f4, %%f1");
+
+INSN(fadd, "fadd %%f4, %%f1,%%f2");
+INSN(fadd_, "fadd. %%f4, %%f1,%%f2");
+
+INSN(fadds, "fadds %%f4, %%f1,%%f2");
+INSN(fadds_, "fadds. %%f4, %%f1,%%f2");
+
+INSN(fcfid, "fcfid %%f4, %%f1");
+INSN(fcfid_, "fcfid. %%f4, %%f1");
+
+INSN(fctid, "fctid %%f4, %%f1");
+INSN(fctid_, "fctid. %%f4, %%f1");
+
+INSN(fctidz, "fctidz %%f4, %%f1");
+INSN(fctidz_, "fctidz. %%f4, %%f1");
+
+INSN(fctiw, "fctiw %%f4, %%f1");
+INSN(fctiw_, "fctiw. %%f4, %%f1");
+
+INSN(fctiwz, "fctiwz %%f4, %%f1");
+INSN(fctiwz_, "fctiwz. %%f4, %%f1");
+
+INSN(fdiv, "fdiv %%f4, %%f1,%%f2");
+INSN(fdiv_, "fdiv. %%f4, %%f1,%%f2");
+
+INSN(fdivs, "fdivs %%f4, %%f1,%%f2");
+INSN(fdivs_, "fdivs. %%f4, %%f1,%%f2");
+
+INSN(fmadd, "fmadd %%f4, %%f1,%%f2,%%f3");
+INSN(fmadd_, "fmadd. %%f4, %%f1,%%f2,%%f3");
+
+INSN(fmadds, "fmadds %%f4, %%f1,%%f2,%%f3");
+INSN(fmadds_, "fmadds. %%f4, %%f1,%%f2,%%f3");
+
+INSN(fmr, "fmr %%f4, %%f1");
+INSN(fmr_, "fmr. %%f4, %%f1");
+
+INSN(fmsub, "fmsub %%f4, %%f1,%%f2,%%f3");
+INSN(fmsub_, "fmsub. %%f4, %%f1,%%f2,%%f3");
+
+INSN(fmsubs, "fmsubs %%f4, %%f1,%%f2,%%f3");
+INSN(fmsubs_, "fmsubs. %%f4, %%f1,%%f2,%%f3");
+
+INSN(fmul, "fmul %%f4, %%f1,%%f2");
+INSN(fmul_, "fmul. %%f4, %%f1,%%f2");
+
+INSN(fmuls, "fmuls %%f4, %%f1,%%f2");
+INSN(fmuls_, "fmuls. %%f4, %%f1,%%f2");
+
+INSN(fneg, "fneg %%f4, %%f1");
+INSN(fneg_, "fneg. %%f4, %%f1");
+
+INSN(fnmadd, "fnmadd %%f4, %%f1,%%f2,%%f3");
+INSN(fnmadd_, "fnmadd. %%f4, %%f1,%%f2,%%f3");
+
+INSN(fnmadds, "fnmadds %%f4, %%f1,%%f2,%%f3");
+INSN(fnmadds_, "fnmadds. %%f4, %%f1,%%f2,%%f3");
+
+INSN(fnmsub, "fnmsub %%f4, %%f1,%%f2,%%f3");
+INSN(fnmsub_, "fnmsub. %%f4, %%f1,%%f2,%%f3");
+
+INSN(fnmsubs, "fnmsubs %%f4, %%f1,%%f2,%%f3");
+INSN(fnmsubs_, "fnmsubs. %%f4, %%f1,%%f2,%%f3");
+
+INSN(fre, "fre %%f4, %%f1");
+INSN(fre_, "fre. %%f4, %%f1");
+
+INSN(fres, "fres %%f4, %%f1");
+INSN(fres_, "fres. %%f4, %%f1");
+
+INSN(frsqrte, "frsqrte %%f4, %%f1");
+INSN(frsqrte_, "frsqrte. %%f4, %%f1");
+
+//INSN(frsqrtes, "frsqrtes %%f4, %%f1");
+//INSN(frsqrtes_, "frsqrtes. %%f4, %%f1");
+
+INSN(frsp, "frsp %%f4, %%f1");
+INSN(frsp_, "frsp. %%f4, %%f1");
+
+INSN(fsel, "fsel %%f4, %%f1,%%f2,%%f3");
+INSN(fsel_, "fsel. %%f4, %%f1,%%f2,%%f3");
+
+INSN(fsqrt, "fsqrt %%f4, %%f1");
+INSN(fsqrt_, "fsqrt. %%f4, %%f1");
+
+INSN(fsqrts, "fsqrts %%f4, %%f1");
+INSN(fsqrts_, "fsqrts. %%f4, %%f1");
+
+INSN(fsub, "fsub %%f4, %%f1,%%f2");
+INSN(fsub_, "fsub. %%f4, %%f1,%%f2");
+
+INSN(fsubs, "fsubs %%f4, %%f1,%%f2");
+INSN(fsubs_, "fsubs. %%f4, %%f1,%%f2");
+
+
+
+void do_1_unary ( char* name,=20
+ Result(*f)(double,double,double),
+ double a1,
+ ULong hideMask )
+{
+ Result r;
+ printf("%8s: %016llx (%e)\n", name, double_as_ULong(a1), a1);
+ set_NEAREST();
+ r =3D f(a1, 0.0,0.0);
+ printf(" near "); showResult(r,hideMask); printf("\n");
+ set_ZERO();
+ r =3D f(a1, 0.0,0.0);
+ printf(" zero "); showResult(r,hideMask); printf("\n");
+ set_PosINF();
+ r =3D f(a1, 0.0,0.0);
+ printf(" +inf "); showResult(r,hideMask); printf("\n");
+ set_NegINF();
+ r =3D f(a1, 0.0,0.0);
+ printf(" -inf "); showResult(r,hideMask); printf("\n");=20
+}
+
+void do_1_binary ( char* name,=20
+ Result(*f)(double,double,double),
+ double a1, double a2,=20
+ ULong hideMask )
+{
+ Result r;
+ printf("%8s: %016llx %016llx\n", name, double_as_ULong(a1),
+ double_as_ULong(a2));
+ set_NEAREST();
+ r =3D f(a1,a2, 0.0);
+ printf(" near "); showResult(r,hideMask); printf("\n");
+ set_ZERO();
+ r =3D f(a1,a2, 0.0);
+ printf(" zero "); showResult(r,hideMask); printf("\n");
+ set_PosINF();
+ r =3D f(a1,a2, 0.0);
+ printf(" +inf "); showResult(r,hideMask); printf("\n");
+ set_NegINF();
+ r =3D f(a1,a2, 0.0);
+ printf(" -inf "); showResult(r,hideMask); printf("\n");=20
+}
+
+void do_1_ternary ( char* name,=20
+ Result(*f)(double,double,double),
+ double a1, double a2, double a3,
+ ULong hideMask )
+{
+ Result r;
+ printf("%8s: %016llx %016llx %016llx\n",=20
+ name, double_as_ULong(a1),
+ double_as_ULong(a2), double_as_ULong(a3));
+ set_NEAREST();
+ r =3D f(a1,a2,a3);
+ printf(" near "); showResult(r,hideMask); printf("\n");
+ set_ZERO();
+ r =3D f(a1,a2,a3);
+ printf(" zero "); showResult(r,hideMask); printf("\n");
+ set_PosINF();
+ r =3D f(a1,a2,a3);
+ printf(" +inf "); showResult(r,hideMask); printf("\n");
+ set_NegINF();
+ r =3D f(a1,a2,a3);
+ printf(" -inf "); showResult(r,hideMask); printf("\n");=20
+}
+
+void do_N_unary ( char* name,
+ Result(*f)(double,double,double),
+ double* args,
+ int nargs,
+ ULong hideMask )
+{
+ int i;
+ for (i =3D 0; i < nargs; i++) {
+ do_1_unary( name, f, args[i], hideMask );
+ }
+}
+
+void do_N_binary ( char* name,
+ Result(*f)(double,double,double),
+ double* args,
+ int nargs,
+ ULong hideMask )
+{
+ int i, j;
+ for (i =3D 0; i < nargs; i++) {
+ for (j =3D 0; j < nargs; j++) {
+ do_1_binary( name, f, args[i], args[j], hideMask );
+ }
+ }
+}
+
+void do_N_ternary ( char* name,
+ Result(*f)(double,double,double),
+ double* args,
+ int nargs,
+ ULong hideMask )
+{
+ int i, j, k;
+ for (i =3D 0; i < nargs; i++) {
+ for (j =3D 0; j < nargs; j++) {
+ for (k =3D 0; k < nargs; k++) {
+ do_1_ternary( name, f, args[i], args[j], args[k], hideMask )=
;
+ }
+ }
+ }
+}
+
+int main ( void )
+{
+ const ULong SHOW_ALL =3D 0;
+
+ int nargs =3D 21;
+ int nMacArgs =3D 11;
+
+ double* args =3D malloc(nargs * sizeof(double));
+ double* macArgs =3D malloc(nMacArgs * sizeof(double));
+
+ args[0] =3D 0.0;
+ args[1] =3D 1.0 / 0.0; // inf
+ args[2] =3D -args[1]; // -inf
+ args[3] =3D args[2]/args[2]; // nan
+ args[4] =3D -args[3]; // -nan
+ args[5] =3D -5e100;
+ args[6] =3D -5e20;
+ args[7] =3D -501.0;
+ args[8] =3D -6.0;
+ args[9] =3D -1.0;
+ args[10] =3D -2e-20;
+ args[11] =3D -2e-200;
+ args[12] =3D 2e-200;
+ args[13] =3D 2e-20;
+ args[14] =3D 1.0;
+ args[15] =3D 6.0;
+ args[16] =3D 501.0;
+ args[17] =3D 5e20;
+ args[18] =3D 5e100;
+ args[19] =3D 1.23e+5;
+ args[20] =3D 1.23e+14;
+
+#if 0
+ macArgs[0] =3D 0.0;
+ macArgs[1] =3D -5e100;
+ macArgs[2] =3D -5e20;
+ macArgs[3] =3D -501.0;
+ macArgs[4] =3D -6.0;
+ macArgs[5] =3D -1.0;
+ macArgs[6] =3D -2e-20;
+ macArgs[7] =3D -2e-200;
+ macArgs[8] =3D 2e-200;
+ macArgs[9] =3D 2e-20;
+ macArgs[10] =3D 1.0;
+ macArgs[11] =3D 6.0;
+ macArgs[12] =3D 501.0;
+ macArgs[13] =3D 5e20;
+ macArgs[14] =3D 5e100;
+ macArgs[15] =3D 1.23e+5;
+ macArgs[16] =3D 1.23e+14;
+
+ //macArgs[17] =3D args[3]; // nan
+ //macArgs[18] =3D -args[3]; // -nan
+#endif
+
+ macArgs[0] =3D 0.0;
+ macArgs[1] =3D 1.0;
+ macArgs[2] =3D 1.0 + (1.0/7.0);
+ macArgs[3] =3D 6.01;
+ macArgs[4] =3D 501.0;
+ macArgs[5] =3D 31415927.0;
+ macArgs[6] =3D - 1.0;
+ macArgs[7] =3D - (1.0 + (1.0/7.0));
+ macArgs[8] =3D - 6.01;
+ macArgs[9] =3D - 501.0;
+ macArgs[10] =3D - 31415927.0;
+
+
+ do_N_unary("fmr", insn_fmr, args, nargs, SHOW_ALL);
+ do_N_unary("fmr_", insn_fmr_, args, nargs, SHOW_ALL);
+
+ do_N_unary("fneg", insn_fneg, args, nargs, SHOW_ALL);
+ do_N_unary("fneg_", insn_fneg_, args, nargs, SHOW_ALL);
+
+ do_N_unary("fabs", insn_fabs, args, nargs, SHOW_ALL);
+ do_N_unary("fabs_", insn_fabs_, args, nargs, SHOW_ALL);
+
+ do_N_unary("fnabs", insn_fnabs, args, nargs, SHOW_ALL);
+ do_N_unary("fnabs_", insn_fnabs_, args, nargs, SHOW_ALL);
+
+
+ do_N_binary("fadd", insn_fadd, args, nargs, SHOW_ALL);
+ do_N_binary("fadd_", insn_fadd_, args, nargs, SHOW_ALL);
+
+ do_N_binary("fadds", insn_fadds, args, nargs, SHOW_ALL);
+ do_N_binary("fadds_", insn_fadds_, args, nargs, SHOW_ALL);
+
+ do_N_binary("fdiv", insn_fdiv, args, nargs, SHOW_ALL);
+ do_N_binary("fdiv_", insn_fdiv_, args, nargs, SHOW_ALL);
+
+ do_N_binary("fdivs", insn_fdivs, args, nargs, SHOW_ALL);
+ do_N_binary("fdivs_", insn_fdivs_, args, nargs, SHOW_ALL);
+
+ do_N_binary("fmul", insn_fmul, args, nargs, SHOW_ALL);
+ do_N_binary("fmul_", insn_fmul_, args, nargs, SHOW_ALL);
+
+ do_N_binary("fmuls", insn_fmuls, args, nargs, SHOW_ALL);
+ do_N_binary("fmuls_", insn_fmuls_, args, nargs, SHOW_ALL);
+
+ do_N_binary("fsub", insn_fsub, args, nargs, SHOW_ALL);
+ do_N_binary("fsub_", insn_fsub_, args, nargs, SHOW_ALL);
+
+ do_N_binary("fsubs", insn_fsubs, args, nargs, SHOW_ALL);
+ do_N_binary("fsubs_", insn_fsubs_, args, nargs, SHOW_ALL);
+
+ //do_N_unary(fcfid, SHOW_ALL);
+ //do_N_unary(fcfid_, SHOW_ALL);
+
+ //do_N_unary(fctid, SHOW_ALL);
+ //do_N_unary(fctid_, SHOW_ALL);
+
+ //do_N_unary(fctidz, SHOW_ALL);
+ //do_N_unary(fctidz_, SHOW_ALL);
+
+ do_N_unary("fctiw", insn_fctiw, args, nargs, 0xFFFFFFFF00000000ULL);
+ do_N_unary("fctiw_", insn_fctiw_, args, nargs, 0xFFFFFFFF00000000ULL);
+
+ do_N_unary("fctiwz", insn_fctiwz, args, nargs, 0xFFFFFFFF00000000ULL=
);
+ do_N_unary("fctiwz_", insn_fctiwz_, args, nargs, 0xFFFFFFFF00000000ULL=
);
+
+#if 0
+ do_N_ternary("fmadd", insn_fmadd, macArgs, nMacArgs, SHOW_ALL);
+ do_N_ternary("fmadd_", insn_fmadd_, macArgs, nMacArgs, SHOW_ALL);
+
+ do_N_ternary("fmadds", insn_fmadds, macArgs, nMacArgs, SHOW_ALL);
+ do_N_ternary("fmadds_", insn_fmadds_, macArgs, nMacArgs, SHOW_ALL);
+
+ do_N_ternary("fmsub", insn_fmsub, macArgs, nMacArgs, SHOW_ALL);
+ do_N_ternary("fmsub_", insn_fmsub_, macArgs, nMacArgs, SHOW_ALL);
+
+ do_N_ternary("fmsubs", insn_fmsubs, macArgs, nMacArgs, SHOW_ALL);
+ do_N_ternary("fmsubs_", insn_fmsubs_, macArgs, nMacArgs, SHOW_ALL);
+
+ do_N_ternary("fnmadd", insn_fnmadd, macArgs, nMacArgs, SHOW_ALL);
+ do_N_ternary("fnmadd_", insn_fnmadd_, macArgs, nMacArgs, SHOW_ALL);
+
+ do_N_ternary("fnmadds", insn_fnmadds, macArgs, nMacArgs, SHOW_ALL);
+ do_N_ternary("fnmadds_", insn_fnmadds_, macArgs, nMacArgs, SHOW_ALL);
+
+ do_N_ternary("fnmsub", insn_fnmsub, macArgs, nMacArgs, SHOW_ALL);
+ do_N_ternary("fnmsub_", insn_fnmsub_, macArgs, nMacArgs, SHOW_ALL);
+
+ do_N_ternary("fnmsubs", insn_fnmsubs, macArgs, nMacArgs, SHOW_ALL);
+ do_N_ternary("fnmsubs_", insn_fnmsubs_, macArgs, nMacArgs, SHOW_ALL);
+#endif
+
+ //do_N_unary(fre, SHOW_ALL);
+ //do_N_unary(fre_, SHOW_ALL);
+
+ do_N_unary("fres", insn_fres, args, nargs, 0x000001FFFFFFFFFFULL);
+ do_N_unary("fres_", insn_fres_, args, nargs, 0x000001FFFFFFFFFFULL);
+
+ do_N_unary("frsqrte", insn_frsqrte, args, nargs, SHOW_ALL);
+ do_N_unary("frsqrte_", insn_frsqrte_, args, nargs, SHOW_ALL);
+
+ // do_N_unary("frsqrtes", insn_frsqrtes, args, nargs, SHOW_ALL);
+ // do_N_unary("frsqrtes_", insn_frsqrtes_, args, nargs, SHOW_ALL);
+
+ do_N_unary("frsp", insn_frsp, args, nargs, SHOW_ALL);
+ do_N_unary("frsp_", insn_frsp_, args, nargs, SHOW_ALL);
+
+ do_N_ternary("fsel", insn_fsel, args, nargs, SHOW_ALL);
+ do_N_ternary("fsel_", insn_fsel_, args, nargs, SHOW_ALL);
+
+ //do_N_unary(fsqrt, SHOW_ALL);
+ //do_N_unary(fsqrt_, SHOW_ALL);
+
+ //do_N_unary(fsqrts, SHOW_ALL);
+ //do_N_unary(fsqrts_, SHOW_ALL);
+
+ return 0;
+}
|
|
From: <js...@ac...> - 2006-02-06 03:59:37
|
Nightly build on phoenix ( SuSE 10.0 ) started at 2006-02-06 03:30:01 GMT Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 223 tests, 7 stderr failures, 0 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/x86/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: <sv...@va...> - 2006-02-06 03:58:37
|
Author: sewardj
Date: 2006-02-06 03:58:31 +0000 (Mon, 06 Feb 2006)
New Revision: 1568
Log:
Comment-only changes
Modified:
trunk/priv/host-ppc/isel.c
Modified: trunk/priv/host-ppc/isel.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/priv/host-ppc/isel.c 2006-02-05 16:06:26 UTC (rev 1567)
+++ trunk/priv/host-ppc/isel.c 2006-02-06 03:58:31 UTC (rev 1568)
@@ -115,17 +115,84 @@
/*---------------------------------------------------------*/
/*
Vex-generated code expects to run with the FPU set as follows: all
- exceptions masked, round-to-nearest.
- This corresponds to a FPU control word value of 0x0.
- =20
- %fpscr should have this value on entry to Vex-generated code,
- and those values should be unchanged at exit.
- =20
- Warning: For simplicity, set_FPU_rounding_* assumes this is 0x0
- - if this is changed, update those functions.
+ exceptions masked. The rounding mode is set appropriately before
+ each floating point insn emitted (or left unchanged if known to be
+ correct already). There are a few fp insns (fmr,fneg,fabs,fnabs),
+ which are unaffected by the rm and so the rounding mode is not set
+ prior to them. =20
+
+ At least on MPC7447A (Mac Mini), frsqrte is also not affected by
+ rounding mode. At some point the ppc docs get sufficiently vague
+ that the only way to find out is to write test programs.
*/
+/* Notes on the FP instruction set, 6 Feb 06.
=20
+What exns -> CR1 ? Sets FPRF ? Observes RM ?
+-------------------------------------------------------------
=20
+fmr[.] if . n n
+fneg[.] if . n n
+fabs[.] if . n n
+fnabs[.] if . n n
+
+fadd[.] if . y y
+fadds[.] if . y y
+fcfid[.] (i64->dbl) if . y y
+fcmpo (cmp, result n n n
+fcmpu to crfD) n n n
+fctid[.] (dbl->i64) if . ->undef y
+fctidz[.] (dbl->i64) if . ->undef rounds-to-zero
+fctiw[.] (dbl->i32) if . ->undef y
+fctiwz[.] (dbl->i32) if . ->undef rounds-to-zero
+fdiv[.] if . y y
+fdivs[.] if . y y
+fmadd[.] if . y y
+fmadds[.] if . y y
+fmsub[.] if . y y
+fmsubs[.] if . y y
+fmul[.] if . y y
+fmuls[.] if . y y
+
+(note: for fnm*, rounding happens before final negation)
+fnmadd[.] if . y y
+fnmadds[.] if . y y
+fnmsub[.] if . y y
+fnmsubs[.] if . y y
+
+fre[.] if . y y
+fres[.] if . y y
+
+frsqrte[.] if . y apparently not
+
+fsqrt[.] if . y y
+fsqrts[.] if . y y
+fsub[.] if . y y
+fsubs[.] if . y y
+
+
+fpscr: bits 30-31 (ibm) is RM
+ 24-29 (ibm) are exnmasks/non-IEEE bit, all zero
+ 15-19 (ibm) is FPRF: class, <, =3D, >, UNord
+
+ppc fe(guest) makes fpscr read as all zeros except RM (and maybe FPRF
+in future)=20
+
+mcrfs - move fpscr field to CR field
+mtfsfi[.] - 4 bit imm moved to fpscr field
+mtfsf[.] - move frS[low 1/2] to fpscr but using 8-bit field mask
+mtfsb1[.] - set given fpscr bit
+mtfsb0[.] - clear given fpscr bit
+mffs[.] - move all fpscr to frD[low 1/2]
+
+For [.] presumably cr1 is set with exn summary bits, as per=20
+main FP insns
+
+A single precision store truncates/denormalises the in-register value,
+but does not round it. This is so that flds followed by fsts is
+always the identity.
+*/
+
+
/*---------------------------------------------------------*/
/*--- misc helpers ---*/
/*---------------------------------------------------------*/
@@ -3037,7 +3104,7 @@
addInstr(env, PPCInstr_Alu(Palu_AND, r_tmp,
r_cond, PPCRH_Imm(False,0xFF)));
addInstr(env, PPCInstr_FpUnary( Pfp_MOV, fr_dst, frX ));
- addInstr(env, PPCInstr_Cmp(False/*unsined*/, True/*32bit cmp*/,
+ addInstr(env, PPCInstr_Cmp(False/*unsigned*/, True/*32bit cmp*/=
,
7/*cr*/, r_tmp, PPCRH_Imm(False,0)))=
;
addInstr(env, PPCInstr_FpCMov( cc, fr_dst, fr0 ));
return fr_dst;
|
|
From: <js...@ac...> - 2006-02-06 03:57:39
|
Nightly build on g5 ( YDL 4.0, ppc970 ) started at 2006-02-06 04:40:00 CET Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 194 tests, 6 stderr failures, 1 stdout failure ================= memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) |
|
From: Tom H. <to...@co...> - 2006-02-06 03:44:21
|
Nightly build on dunsmere ( athlon, Fedora Core 4 ) started at 2006-02-06 03:30:06 GMT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 225 tests, 8 stderr failures, 1 stdout failure ================= memcheck/tests/leak-tree (stderr) memcheck/tests/mempool (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/sse1_memory (stdout) none/tests/x86/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2006-02-06 03:30:51
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2006-02-06 03:15:02 GMT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 224 tests, 21 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/mempool (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/sse1_memory (stdout) memcheck/tests/xml1 (stderr) none/tests/x86/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2006-02-06 03:25:06
|
Nightly build on dellow ( x86_64, Fedora Core 4 ) started at 2006-02-06 03:10:12 GMT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 244 tests, 6 stderr failures, 1 stdout failure ================= memcheck/tests/pointer-trace (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/sse1_memory (stdout) none/tests/amd64/faultstatus (stderr) none/tests/x86/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2006-02-06 03:21:04
|
Nightly build on aston ( x86_64, Fedora Core 3 ) started at 2006-02-06 03:05:12 GMT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 244 tests, 6 stderr failures, 1 stdout failure ================= memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/sse1_memory (stdout) none/tests/amd64/faultstatus (stderr) none/tests/x86/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2006-02-06 03:14:59
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2006-02-06 03:00:04 GMT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 244 tests, 7 stderr failures, 1 stdout failure ================= memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/sse1_memory (stdout) none/tests/amd64/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) none/tests/x86/faultstatus (stderr) none/tests/x86/int (stderr) |