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
(13) |
2
(33) |
3
(25) |
4
(22) |
5
(22) |
6
(21) |
7
(19) |
|
8
(29) |
9
(34) |
10
(29) |
11
(37) |
12
(36) |
13
(28) |
14
(25) |
|
15
(28) |
16
(23) |
17
(36) |
18
(21) |
19
(12) |
20
(14) |
21
(10) |
|
22
(7) |
23
(15) |
24
(41) |
25
(15) |
26
(9) |
27
(7) |
28
(6) |
|
29
(16) |
30
(24) |
31
(22) |
|
|
|
|
|
From: <sv...@va...> - 2005-05-12 19:22:01
|
Author: sewardj
Date: 2005-05-12 20:21:55 +0100 (Thu, 12 May 2005)
New Revision: 1194
Modified:
trunk/priv/guest-amd64/toIR.c
Log:
Reinstate a bunch more x87 instructions.
Modified: trunk/priv/guest-amd64/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-amd64/toIR.c 2005-05-12 17:55:01 UTC (rev 1193)
+++ trunk/priv/guest-amd64/toIR.c 2005-05-12 19:21:55 UTC (rev 1194)
@@ -4828,41 +4828,41 @@
put_ST(0, IRExpr_Const(IRConst_F64i(0x3ff0000000000000ULL=
)));
break;
=20
-//.. case 0xE9: /* FLDL2T */
-//.. DIP("fldl2t\n");
-//.. fp_push();
-//.. /* put_ST(0, IRExpr_Const(IRConst_F64(3.321928094887=
36234781))); */
-//.. put_ST(0, IRExpr_Const(IRConst_F64i(0x400a934f0979a3=
71ULL)));
-//.. break;
-//..=20
-//.. case 0xEA: /* FLDL2E */
-//.. DIP("fldl2e\n");
-//.. fp_push();
-//.. /* put_ST(0, IRExpr_Const(IRConst_F64(1.442695040888=
96340739))); */
-//.. put_ST(0, IRExpr_Const(IRConst_F64i(0x3ff71547652b82=
feULL)));
-//.. break;
-//..=20
-//.. case 0xEB: /* FLDPI */
-//.. DIP("fldpi\n");
-//.. fp_push();
-//.. /* put_ST(0, IRExpr_Const(IRConst_F64(3.141592653589=
79323851))); */
-//.. put_ST(0, IRExpr_Const(IRConst_F64i(0x400921fb54442d=
18ULL)));
-//.. break;
-//..=20
-//.. case 0xEC: /* FLDLG2 */
-//.. DIP("fldlg2\n");
-//.. fp_push();
-//.. /* put_ST(0, IRExpr_Const(IRConst_F64(0.301029995663=
981143))); */
-//.. put_ST(0, IRExpr_Const(IRConst_F64i(0x3fd34413509f79=
ffULL)));
-//.. break;
-//..=20
-//.. case 0xED: /* FLDLN2 */
-//.. DIP("fldln2\n");
-//.. fp_push();
-//.. /* put_ST(0, IRExpr_Const(IRConst_F64(0.693147180559=
94530942))); */
-//.. put_ST(0, IRExpr_Const(IRConst_F64i(0x3fe62e42fefa39=
efULL)));
-//.. break;
+ case 0xE9: /* FLDL2T */
+ DIP("fldl2t\n");
+ fp_push();
+ /* put_ST(0, IRExpr_Const(IRConst_F64(3.32192809488736234=
781))); */
+ put_ST(0, IRExpr_Const(IRConst_F64i(0x400a934f0979a371ULL=
)));
+ break;
=20
+ case 0xEA: /* FLDL2E */
+ DIP("fldl2e\n");
+ fp_push();
+ /* put_ST(0, IRExpr_Const(IRConst_F64(1.44269504088896340=
739))); */
+ put_ST(0, IRExpr_Const(IRConst_F64i(0x3ff71547652b82feULL=
)));
+ break;
+
+ case 0xEB: /* FLDPI */
+ DIP("fldpi\n");
+ fp_push();
+ /* put_ST(0, IRExpr_Const(IRConst_F64(3.14159265358979323=
851))); */
+ put_ST(0, IRExpr_Const(IRConst_F64i(0x400921fb54442d18ULL=
)));
+ break;
+
+ case 0xEC: /* FLDLG2 */
+ DIP("fldlg2\n");
+ fp_push();
+ /* put_ST(0, IRExpr_Const(IRConst_F64(0.30102999566398114=
3))); */
+ put_ST(0, IRExpr_Const(IRConst_F64i(0x3fd34413509f79ffULL=
)));
+ break;
+
+ case 0xED: /* FLDLN2 */
+ DIP("fldln2\n");
+ fp_push();
+ /* put_ST(0, IRExpr_Const(IRConst_F64(0.69314718055994530=
942))); */
+ put_ST(0, IRExpr_Const(IRConst_F64i(0x3fe62e42fefa39efULL=
)));
+ break;
+
case 0xEE: /* FLDZ */
DIP("fldz\n");
fp_push();
@@ -4910,12 +4910,12 @@
//.. put_C3210( binop(Iop_PRem1C3210F64, mkexpr(a1), mkex=
pr(a2)) );
//.. break;
//.. }
-//..=20
-//.. case 0xF7: /* FINCSTP */
-//.. DIP("fprem\n");
-//.. put_ftop( binop(Iop_Add32, get_ftop(), mkU32(1)) );
-//.. break;
-//..=20
+
+ case 0xF7: /* FINCSTP */
+ DIP("fincstp\n");
+ put_ftop( binop(Iop_Add32, get_ftop(), mkU32(1)) );
+ break;
+
//.. case 0xF8: { /* FPREM -- not IEEE compliant */
//.. IRTemp a1 =3D newTemp(Ity_F64);
//.. IRTemp a2 =3D newTemp(Ity_F64);
@@ -4991,57 +4991,57 @@
=20
/* bits 5,4,3 are an opcode extension, and the modRM also
specifies an address. */
- //IROp fop;
- //IRTemp addr =3D disAMode( &len, pfx, delta, dis_buf, 0 );
+ IROp fop;
+ IRTemp addr =3D disAMode( &len, pfx, delta, dis_buf, 0 );
delta +=3D len;
switch (gregLO3ofRM(modrm)) {
=20
-//.. case 0: /* FIADD m32int */ /* ST(0) +=3D m32int */
-//.. DIP("fiaddl %s\n", dis_buf);
-//.. fop =3D Iop_AddF64;
-//.. goto do_fop_m32;
-//..=20
-//.. case 1: /* FIMUL m32int */ /* ST(0) *=3D m32int */
-//.. DIP("fimull %s\n", dis_buf);
-//.. fop =3D Iop_MulF64;
-//.. goto do_fop_m32;
-//..=20
-//.. case 4: /* FISUB m32int */ /* ST(0) -=3D m32int */
-//.. DIP("fisubl %s\n", dis_buf);
-//.. fop =3D Iop_SubF64;
-//.. goto do_fop_m32;
-//..=20
-//.. case 5: /* FISUBR m32int */ /* ST(0) =3D m32int - ST(0)=
*/
-//.. DIP("fisubrl %s\n", dis_buf);
-//.. fop =3D Iop_SubF64;
-//.. goto do_foprev_m32;
-//..=20
-//.. case 6: /* FIDIV m32int */ /* ST(0) /=3D m32int */
-//.. DIP("fisubl %s\n", dis_buf);
-//.. fop =3D Iop_DivF64;
-//.. goto do_fop_m32;
-//..=20
-//.. case 7: /* FIDIVR m32int */ /* ST(0) =3D m32int / ST(0)=
*/
-//.. DIP("fidivrl %s\n", dis_buf);
-//.. fop =3D Iop_DivF64;
-//.. goto do_foprev_m32;
-//..=20
-//.. do_fop_m32:
-//.. put_ST_UNCHECKED(0,=20
-//.. binop(fop,=20
-//.. get_ST(0),
-//.. unop(Iop_I32toF64,
-//.. loadLE(Ity_I32, mkexpr(addr)))));
-//.. break;
-//..=20
-//.. do_foprev_m32:
-//.. put_ST_UNCHECKED(0,=20
-//.. binop(fop,=20
-//.. unop(Iop_I32toF64,
-//.. loadLE(Ity_I32, mkexpr(addr))),
-//.. get_ST(0)));
-//.. break;
+ case 0: /* FIADD m32int */ /* ST(0) +=3D m32int */
+ DIP("fiaddl %s\n", dis_buf);
+ fop =3D Iop_AddF64;
+ goto do_fop_m32;
=20
+ case 1: /* FIMUL m32int */ /* ST(0) *=3D m32int */
+ DIP("fimull %s\n", dis_buf);
+ fop =3D Iop_MulF64;
+ goto do_fop_m32;
+
+ case 4: /* FISUB m32int */ /* ST(0) -=3D m32int */
+ DIP("fisubl %s\n", dis_buf);
+ fop =3D Iop_SubF64;
+ goto do_fop_m32;
+
+ case 5: /* FISUBR m32int */ /* ST(0) =3D m32int - ST(0) */
+ DIP("fisubrl %s\n", dis_buf);
+ fop =3D Iop_SubF64;
+ goto do_foprev_m32;
+
+ case 6: /* FIDIV m32int */ /* ST(0) /=3D m32int */
+ DIP("fisubl %s\n", dis_buf);
+ fop =3D Iop_DivF64;
+ goto do_fop_m32;
+
+ case 7: /* FIDIVR m32int */ /* ST(0) =3D m32int / ST(0) */
+ DIP("fidivrl %s\n", dis_buf);
+ fop =3D Iop_DivF64;
+ goto do_foprev_m32;
+
+ do_fop_m32:
+ put_ST_UNCHECKED(0,=20
+ binop(fop,=20
+ get_ST(0),
+ unop(Iop_I32toF64,
+ loadLE(Ity_I32, mkexpr(addr)))));
+ break;
+
+ do_foprev_m32:
+ put_ST_UNCHECKED(0,=20
+ binop(fop,=20
+ unop(Iop_I32toF64,
+ loadLE(Ity_I32, mkexpr(addr))),
+ get_ST(0)));
+ break;
+
default:
vex_printf("unhandled opc_aux =3D 0x%2x\n", gregLO3ofRM(m=
odrm));
vex_printf("first_opcode =3D=3D 0xDA\n");
@@ -5133,11 +5133,11 @@
loadLE(Ity_I32, mkexpr(addr))));
break;
=20
-//.. case 2: /* FIST m32 */
-//.. DIP("fistl %s\n", dis_buf);
-//.. storeLE( mkexpr(addr),=20
-//.. binop(Iop_F64toI32, get_roundingmode(), get=
_ST(0)) );
-//.. break;
+ case 2: /* FIST m32 */
+ DIP("fistl %s\n", dis_buf);
+ storeLE( mkexpr(addr),=20
+ binop(Iop_F64toI32, get_roundingmode(), get_ST(0=
)) );
+ break;
=20
case 3: /* FISTP m32 */
DIP("fistpl %s\n", dis_buf);
@@ -5556,6 +5556,12 @@
delta++;
switch (modrm) {
=20
+ case 0xC0 ... 0xC7: /* FFREE %st(?) */
+ r_dst =3D (UInt)modrm - 0xC0;
+ DIP("ffree %%st(%u)\n", r_dst);
+ put_ST_TAG ( r_dst, mkU8(0) );
+ break;
+
//.. case 0xD0 ... 0xD7: /* FST %st(0),%st(?) */
//.. r_dst =3D (UInt)modrm - 0xD0;
//.. DIP("fst %%st(0),%%st(%d)\n", r_dst);
@@ -5614,67 +5620,68 @@
=20
if (modrm < 0xC0) {
=20
-//.. /* bits 5,4,3 are an opcode extension, and the modRM also
-//.. specifies an address. */
-//.. IRTemp addr =3D disAMode( &len, pfx, delta, dis_buf, 0 );
-//.. delta +=3D len;
-//..=20
-//.. switch (gregLO3ofRM(modrm)) {
-//..=20
-//.. case 0: /* FIADD m16int */ /* ST(0) +=3D m16int */
-//.. DIP("fiaddw %s\n", dis_buf);
-//.. fop =3D Iop_AddF64;
-//.. goto do_fop_m16;
-//..=20
-//.. case 1: /* FIMUL m16int */ /* ST(0) *=3D m16int */
-//.. DIP("fimulw %s\n", dis_buf);
-//.. fop =3D Iop_MulF64;
-//.. goto do_fop_m16;
-//..=20
-//.. case 4: /* FISUB m16int */ /* ST(0) -=3D m16int */
-//.. DIP("fisubw %s\n", dis_buf);
-//.. fop =3D Iop_SubF64;
-//.. goto do_fop_m16;
-//..=20
-//.. case 5: /* FISUBR m16int */ /* ST(0) =3D m16int - ST(0)=
*/
-//.. DIP("fisubrw %s\n", dis_buf);
-//.. fop =3D Iop_SubF64;
-//.. goto do_foprev_m16;
-//..=20
-//.. case 6: /* FIDIV m16int */ /* ST(0) /=3D m16int */
-//.. DIP("fisubw %s\n", dis_buf);
-//.. fop =3D Iop_DivF64;
-//.. goto do_fop_m16;
-//..=20
-//.. case 7: /* FIDIVR m16int */ /* ST(0) =3D m16int / ST(0)=
*/
-//.. DIP("fidivrw %s\n", dis_buf);
-//.. fop =3D Iop_DivF64;
-//.. goto do_foprev_m16;
-//..=20
-//.. do_fop_m16:
-//.. put_ST_UNCHECKED(0,=20
-//.. binop(fop,=20
-//.. get_ST(0),
-//.. unop(Iop_I32toF64,
-//.. unop(Iop_16Sto32,=20
-//.. loadLE(Ity_I16, mkexpr(addr))))))=
;
-//.. break;
-//..=20
-//.. do_foprev_m16:
-//.. put_ST_UNCHECKED(0,=20
-//.. binop(fop,=20
-//.. unop(Iop_I32toF64,
-//.. unop(Iop_16Sto32,=20
-//.. loadLE(Ity_I16, mkexpr(addr)))),
-//.. get_ST(0)));
-//.. break;
-//..=20
-//.. default:
-//.. vex_printf("unhandled opc_aux =3D 0x%2x\n", gregLO3o=
fRM(modrm));
-//.. vex_printf("first_opcode =3D=3D 0xDE\n");
-//.. goto decode_fail;
-//.. }
+ /* bits 5,4,3 are an opcode extension, and the modRM also
+ specifies an address. */
+ IROp fop;
+ IRTemp addr =3D disAMode( &len, pfx, delta, dis_buf, 0 );
+ delta +=3D len;
=20
+ switch (gregLO3ofRM(modrm)) {
+
+ case 0: /* FIADD m16int */ /* ST(0) +=3D m16int */
+ DIP("fiaddw %s\n", dis_buf);
+ fop =3D Iop_AddF64;
+ goto do_fop_m16;
+
+ case 1: /* FIMUL m16int */ /* ST(0) *=3D m16int */
+ DIP("fimulw %s\n", dis_buf);
+ fop =3D Iop_MulF64;
+ goto do_fop_m16;
+
+ case 4: /* FISUB m16int */ /* ST(0) -=3D m16int */
+ DIP("fisubw %s\n", dis_buf);
+ fop =3D Iop_SubF64;
+ goto do_fop_m16;
+
+ case 5: /* FISUBR m16int */ /* ST(0) =3D m16int - ST(0) */
+ DIP("fisubrw %s\n", dis_buf);
+ fop =3D Iop_SubF64;
+ goto do_foprev_m16;
+
+ case 6: /* FIDIV m16int */ /* ST(0) /=3D m16int */
+ DIP("fisubw %s\n", dis_buf);
+ fop =3D Iop_DivF64;
+ goto do_fop_m16;
+
+ case 7: /* FIDIVR m16int */ /* ST(0) =3D m16int / ST(0) */
+ DIP("fidivrw %s\n", dis_buf);
+ fop =3D Iop_DivF64;
+ goto do_foprev_m16;
+
+ do_fop_m16:
+ put_ST_UNCHECKED(0,=20
+ binop(fop,=20
+ get_ST(0),
+ unop(Iop_I32toF64,
+ unop(Iop_16Sto32,=20
+ loadLE(Ity_I16, mkexpr(addr))))));
+ break;
+
+ do_foprev_m16:
+ put_ST_UNCHECKED(0,=20
+ binop(fop,=20
+ unop(Iop_I32toF64,
+ unop(Iop_16Sto32,=20
+ loadLE(Ity_I16, mkexpr(addr)))),
+ get_ST(0)));
+ break;
+
+ default:
+ vex_printf("unhandled opc_aux =3D 0x%2x\n", gregLO3ofRM(m=
odrm));
+ vex_printf("first_opcode =3D=3D 0xDE\n");
+ goto decode_fail;
+ }
+
} else {
=20
delta++;
@@ -5751,7 +5758,7 @@
//.. storeLE( mkexpr(addr),=20
//.. binop(Iop_F64toI16, get_roundingmode(), get=
_ST(0)) );
//.. break;
-//..=20
+
//.. case 3: /* FISTP m16 */
//.. DIP("fistps %s\n", dis_buf);
//.. storeLE( mkexpr(addr),=20
@@ -5767,12 +5774,12 @@
loadLE(Ity_I64, mkexpr(addr))));
break;
=20
-//.. case 7: /* FISTP m64 */
-//.. DIP("fistpll %s\n", dis_buf);
-//.. storeLE( mkexpr(addr),=20
-//.. binop(Iop_F64toI64, get_roundingmode(), get=
_ST(0)) );
-//.. fp_pop();
-//.. break;
+ case 7: /* FISTP m64 */
+ DIP("fistpll %s\n", dis_buf);
+ storeLE( mkexpr(addr),=20
+ binop(Iop_F64toI64, get_roundingmode(), get_ST(0=
)) );
+ fp_pop();
+ break;
=20
default:
vex_printf("unhandled opc_aux =3D 0x%2x\n", gregLO3ofRM(m=
odrm));
@@ -11666,10 +11673,10 @@
//.. //-- DIP("lahf\n");
//.. //-- break;
//.. //--=20
-//.. case 0x9B: /* FWAIT */
-//.. /* ignore? */
-//.. DIP("fwait\n");
-//.. break;
+ case 0x9B: /* FWAIT */
+ /* ignore? */
+ DIP("fwait\n");
+ break;
=20
case 0xD8:
case 0xD9:
|
|
From: <sv...@va...> - 2005-05-12 19:17:40
|
Author: sewardj
Date: 2005-05-12 20:17:36 +0100 (Thu, 12 May 2005)
New Revision: 3687
Added:
trunk/none/tests/amd64/insn_fpu.def
trunk/none/tests/amd64/insn_fpu.stderr.exp
trunk/none/tests/amd64/insn_fpu.stdout.exp
trunk/none/tests/amd64/insn_fpu.vgtest
Modified:
trunk/none/tests/amd64/Makefile.am
trunk/none/tests/amd64/gen_insn_test.pl
Log:
AMD x87 instruction tests.
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 2005-05-12 18:05:00 UTC (rev 3686)
+++ trunk/none/tests/amd64/Makefile.am 2005-05-12 19:17:36 UTC (rev 3687)
@@ -2,7 +2,7 @@
noinst_SCRIPTS =3D filter_cpuid filter_stderr filter_int gen_insn_test.p=
l
=20
CLEANFILES =3D $(addsuffix .c,$(INSN_TESTS))
-INSN_TESTS=3Dinsn_mmx insn_sse insn_sse2
+INSN_TESTS=3Dinsn_mmx insn_sse insn_sse2 insn_fpu
=20
EXTRA_DIST =3D $(noinst_SCRIPTS) \
$(addsuffix .stderr.exp,$(INSN_TESTS)) \
@@ -22,6 +22,8 @@
insn_sse_LDADD =3D -lm
insn_sse2_SOURCES =3D insn_sse2.def
insn_sse2_LDADD =3D -lm
+insn_fpu_SOURCES =3D insn_fpu.def
+insn_fpu_LDADD =3D -lm
=20
.def.c: $(srcdir)/gen_insn_test.pl
$(PERL) $(srcdir)/gen_insn_test.pl < $< > $@
Modified: trunk/none/tests/amd64/gen_insn_test.pl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/gen_insn_test.pl 2005-05-12 18:05:00 UTC (rev =
3686)
+++ trunk/none/tests/amd64/gen_insn_test.pl 2005-05-12 19:17:36 UTC (rev =
3687)
@@ -650,7 +650,11 @@
print qq| \{\n|;
print qq| asm\(\n|;
# print qq| \"fsave %$stateargnum\\n\"\n|;
- =20
+ print qq| \"ffree %%st(7)\\n\"\n|;
+ print qq| \"ffree %%st(6)\\n\"\n|;
+ print qq| \"ffree %%st(5)\\n\"\n|;
+ print qq| \"ffree %%st(4)\\n\"\n|;
+
my @fpargs;
=20
foreach my $arg (@presets, @args)
@@ -716,12 +720,12 @@
=20
if (defined($fpucwmask) || defined($fpucwset))
{
- print qq| \"subl \$2, %%rsp\\n\"\n|;
+ print qq| \"subq \$2, %%rsp\\n\"\n|;
print qq| \"fstcw (%%rsp)\\n\"\n|;
print qq| \"andw \$$fpucwmask, (%%rsp)\\n\"\n| if define=
d($fpucwmask);
print qq| \"orw \$$fpucwset, (%%rsp)\\n\"\n| if defined(=
$fpucwset);
print qq| \"fldcw (%%rsp)\\n\"\n|;
- print qq| \"addl \$2, %%rsp\\n\"\n|;
+ print qq| \"addq \$2, %%rsp\\n\"\n|;
}
=20
print qq| \"$insn|;
Added: trunk/none/tests/amd64/insn_fpu.def
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/insn_fpu.def 2005-05-12 18:05:00 UTC (rev 3686=
)
+++ trunk/none/tests/amd64/insn_fpu.def 2005-05-12 19:17:36 UTC (rev 3687=
)
@@ -0,0 +1,452 @@
+fabs st0.ps[1234.5678] : =3D> st0.ps[1234.5678]
+fabs st0.ps[-1234.5678] : =3D> st0.ps[1234.5678]
+fabs st0.pd[12345678.87654321] : =3D> st0.pd[12345678.87654321]
+fabs st0.pd[-12345678.87654321] : =3D> st0.pd[12345678.87654321]
+fadds st0.ps[1234.5678] : m32.ps[8765.4321] =3D> st0.ps[9999.9999]
+fadds st0.ps[-1234.5678] : m32.ps[8765.4321] =3D> st0.ps[7530.8643]
+fadds st0.ps[1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[-7530.8643]
+fadds st0.ps[-1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[-9999.9999]
+faddl st0.pd[1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[8888=
888.8888888]
+faddl st0.pd[-1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[641=
9753.3580246]
+faddl st0.pd[1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[-64=
19753.3580246]
+faddl st0.pd[-1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[-8=
888888.8888888]
+fadd st0.ps[1234.5678] st2.ps[8765.4321] =3D> st2.ps[9999.9999]
+fadd st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st2.ps[7530.8643]
+fadd st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st2.ps[-7530.8643]
+fadd st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st2.ps[-9999.9999]
+fadd st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[8888888=
.8888888]
+fadd st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[641975=
3.3580246]
+fadd st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[-64197=
53.3580246]
+fadd st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[-8888=
888.8888888]
+fadd st2.ps[1234.5678] st0.ps[8765.4321] =3D> st0.ps[9999.9999]
+fadd st2.ps[-1234.5678] st0.ps[8765.4321] =3D> st0.ps[7530.8643]
+fadd st2.ps[1234.5678] st0.ps[-8765.4321] =3D> st0.ps[-7530.8643]
+fadd st2.ps[-1234.5678] st0.ps[-8765.4321] =3D> st0.ps[-9999.9999]
+fadd st2.pd[1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[8888888=
.8888888]
+fadd st2.pd[-1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[641975=
3.3580246]
+fadd st2.pd[1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[-64197=
53.3580246]
+fadd st2.pd[-1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[-8888=
888.8888888]
+faddp st0.ps[1234.5678] st2.ps[8765.4321] =3D> st1.ps[9999.9999]
+faddp st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st1.ps[7530.8643]
+faddp st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st1.ps[-7530.8643]
+faddp st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st1.ps[-9999.9999]
+faddp st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[888888=
8.8888888]
+faddp st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[64197=
53.3580246]
+faddp st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[-6419=
753.3580246]
+faddp st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[-888=
8888.8888888]
+faddp st0.ps[1234.5678] st1.ps[8765.4321] : =3D> st0.ps[9999.9999]
+faddp st0.ps[-1234.5678] st1.ps[8765.4321] : =3D> st0.ps[7530.8643]
+faddp st0.ps[1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[-7530.8643]
+faddp st0.ps[-1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[-9999.9999]
+faddp st0.pd[1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[8888=
888.8888888]
+faddp st0.pd[-1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[641=
9753.3580246]
+faddp st0.pd[1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[-64=
19753.3580246]
+faddp st0.pd[-1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[-8=
888888.8888888]
+fiadds st0.ps[1234.5678] : m16.sw[4321] =3D> st0.ps[5555.5678]
+fiadds st0.ps[-1234.5678] : m16.sw[4321] =3D> st0.ps[3086.4322]
+fiadds st0.ps[1234.5678] : m16.sw[-4321] =3D> st0.ps[-3086.4322]
+fiadds st0.ps[-1234.5678] : m16.sw[-4321] =3D> st0.ps[-5555.5678]
+fiadds st0.pd[1234567.7654321] : m16.sw[4321] =3D> st0.pd[1238888.765432=
1]
+fiadds st0.pd[-1234567.7654321] : m16.sw[4321] =3D> st0.pd[-1230246.7654=
321]
+fiadds st0.pd[1234567.7654321] : m16.sw[-4321] =3D> st0.pd[1230246.76543=
21]
+fiadds st0.pd[-1234567.7654321] : m16.sw[-4321] =3D> st0.pd[-1238888.765=
4321]
+fiaddl st0.ps[1234.5678] : m32.sd[87654321] =3D> st0.ps[87655555.5678]
+fiaddl st0.ps[-1234.5678] : m32.sd[87654321] =3D> st0.ps[87653086.4322]
+fiaddl st0.ps[1234.5678] : m32.sd[-87654321] =3D> st0.ps[-87653086.4322]
+fiaddl st0.ps[-1234.5678] : m32.sd[-87654321] =3D> st0.ps[-87655555.5678=
]
+fiaddl st0.pd[1234567.7654321] : m32.sd[87654321] =3D> st0.pd[88888888.7=
654321]
+fiaddl st0.pd[-1234567.7654321] : m32.sd[87654321] =3D> st0.pd[86419753.=
2345679]
+fiaddl st0.pd[1234567.7654321] : m32.sd[-87654321] =3D> st0.pd[-86419753=
.2345679]
+fiaddl st0.pd[-1234567.7654321] : m32.sd[-87654321] =3D> st0.pd[-8888888=
8.7654321]
+fcomi st2.ps[1234.5678] st0.ps[1234.5679] =3D> st0.ps[1234.5678] st2.ps[=
1234.5679] eflags[0x45,0x00]
+fcomi st2.ps[1234.5678] st0.ps[1234.5676] =3D> st0.ps[1234.5678] st2.ps[=
1234.5676] eflags[0x45,0x01]
+fcomi st2.ps[1234.5678] st0.ps[1234.5678] =3D> st0.ps[1234.5678] st2.ps[=
1234.5678] eflags[0x45,0x40]
+fcomi st2.pd[1234567.7654321] st0.pd[1234567.7654322] =3D> st0.pd[123456=
7.7654322] st2.pd[1234567.7654321] eflags[0x45,0x00]
+fcomi st2.pd[1234567.7654321] st0.pd[1234567.7654320] =3D> st0.pd[123456=
7.7654320] st2.pd[1234567.7654321] eflags[0x45,0x01]
+fcomi st2.pd[1234567.7654321] st0.pd[1234567.7654321] =3D> st0.pd[123456=
7.7654321] st2.pd[1234567.7654321] eflags[0x45,0x40]
+fcomip st2.ps[1234.5678] st0.ps[1234.5679] =3D> st1.ps[1234.5679] eflags=
[0x45,0x00]
+fcomip st2.ps[1234.5678] st0.ps[1234.5676] =3D> st1.ps[1234.5676] eflags=
[0x45,0x01]
+fcomip st2.ps[1234.5678] st0.ps[1234.5678] =3D> st1.ps[1234.5678] eflags=
[0x45,0x40]
+fcomip st2.pd[1234567.7654321] st0.pd[1234567.7654322] =3D> st1.pd[12345=
67.7654321] eflags[0x45,0x00]
+fcomip st2.pd[1234567.7654321] st0.pd[1234567.7654320] =3D> st1.pd[12345=
67.7654321] eflags[0x45,0x01]
+fcomip st2.pd[1234567.7654321] st0.pd[1234567.7654321] =3D> st1.pd[12345=
67.7654321] eflags[0x45,0x40]
+fucomi st2.ps[1234.5678] st0.ps[1234.5679] =3D> st0.ps[1234.5678] st2.ps=
[1234.5679] eflags[0x45,0x00]
+fucomi st2.ps[1234.5678] st0.ps[1234.5676] =3D> st0.ps[1234.5678] st2.ps=
[1234.5676] eflags[0x45,0x01]
+fucomi st2.ps[1234.5678] st0.ps[1234.5678] =3D> st0.ps[1234.5678] st2.ps=
[1234.5678] eflags[0x45,0x40]
+fucomi st2.pd[1234567.7654321] st0.pd[1234567.7654322] =3D> st0.pd[12345=
67.7654322] st2.pd[1234567.7654321] eflags[0x45,0x00]
+fucomi st2.pd[1234567.7654321] st0.pd[1234567.7654320] =3D> st0.pd[12345=
67.7654320] st2.pd[1234567.7654321] eflags[0x45,0x01]
+fucomi st2.pd[1234567.7654321] st0.pd[1234567.7654321] =3D> st0.pd[12345=
67.7654321] st2.pd[1234567.7654321] eflags[0x45,0x40]
+fucomip st2.ps[1234.5678] st0.ps[1234.5679] =3D> st1.ps[1234.5679] eflag=
s[0x45,0x00]
+fucomip st2.ps[1234.5678] st0.ps[1234.5676] =3D> st1.ps[1234.5676] eflag=
s[0x45,0x01]
+fucomip st2.ps[1234.5678] st0.ps[1234.5678] =3D> st1.ps[1234.5678] eflag=
s[0x45,0x40]
+fucomip st2.pd[1234567.7654321] st0.pd[1234567.7654322] =3D> st1.pd[1234=
567.7654321] eflags[0x45,0x00]
+fucomip st2.pd[1234567.7654321] st0.pd[1234567.7654320] =3D> st1.pd[1234=
567.7654321] eflags[0x45,0x01]
+fucomip st2.pd[1234567.7654321] st0.pd[1234567.7654321] =3D> st1.pd[1234=
567.7654321] eflags[0x45,0x40]
+fchs st0.ps[1234.5678] : =3D> st0.ps[-1234.5678]
+fchs st0.ps[-1234.5678] : =3D> st0.ps[1234.5678]
+fchs st0.pd[12345678.87654321] : =3D> st0.pd[-12345678.87654321]
+fchs st0.pd[-12345678.87654321] : =3D> st0.pd[12345678.87654321]
+fdivs st0.ps[1234.5678] : m32.ps[8765.4321] =3D> st0.ps[0.14084505885340=
2]
+fdivs st0.ps[-1234.5678] : m32.ps[8765.4321] =3D> st0.ps[-0.140845058853=
402]
+fdivs st0.ps[1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[-0.140845058853=
402]
+fdivs st0.ps[-1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[0.140845058853=
402]
+fdivl st0.pd[1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[0.16=
129030197711]
+fdivl st0.pd[-1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[-0.=
16129030197711]
+fdivl st0.pd[1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[-0.=
16129030197711]
+fdivl st0.pd[-1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[0.=
16129030197711]
+fdiv st0.ps[1234.5678] st2.ps[8765.4321] =3D> st2.ps[0.140845058853402]
+fdiv st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st2.ps[-0.140845058853402=
]
+fdiv st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st2.ps[-0.140845058853402=
]
+fdiv st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st2.ps[0.140845058853402=
]
+fdiv st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[0.16129=
030197711]
+fdiv st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[-0.161=
29030197711]
+fdiv st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[-0.161=
29030197711]
+fdiv st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[0.161=
29030197711]
+fdiv st2.ps[1234.5678] st0.ps[8765.4321] =3D> st0.ps[7.10000058320005]
+fdiv st2.ps[-1234.5678] st0.ps[8765.4321] =3D> st0.ps[-7.10000058320005]
+fdiv st2.ps[1234.5678] st0.ps[-8765.4321] =3D> st0.ps[-7.10000058320005]
+fdiv st2.ps[-1234.5678] st0.ps[-8765.4321] =3D> st0.ps[7.10000058320005]
+fdiv st2.pd[1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[6.20000=
079200001]
+fdiv st2.pd[-1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[-6.200=
00079200001]
+fdiv st2.pd[1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[-6.200=
00079200001]
+fdiv st2.pd[-1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[6.200=
00079200001]
+fdivp st0.ps[1234.5678] st2.ps[8765.4321] =3D> st1.ps[0.140845058853402]
+fdivp st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st1.ps[-0.14084505885340=
2]
+fdivp st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st1.ps[-0.14084505885340=
2]
+fdivp st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st1.ps[0.14084505885340=
2]
+fdivp st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[0.1612=
9030197711]
+fdivp st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[-0.16=
129030197711]
+fdivp st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[-0.16=
129030197711]
+fdivp st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[0.16=
129030197711]
+fdivp st0.ps[1234.5678] st1.ps[8765.4321] : =3D> st0.ps[0.14084505885340=
2]
+fdivp st0.ps[-1234.5678] st1.ps[8765.4321] : =3D> st0.ps[-0.140845058853=
402]
+fdivp st0.ps[1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[-0.140845058853=
402]
+fdivp st0.ps[-1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[0.140845058853=
402]
+fdivp st0.pd[1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[0.16=
129030197711]
+fdivp st0.pd[-1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[-0.=
16129030197711]
+fdivp st0.pd[1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[-0.=
16129030197711]
+fdivp st0.pd[-1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[0.=
16129030197711]
+fidivs st0.ps[1234.5678] : m16.sw[4321] =3D> st0.ps[0.285713445961583]
+fidivs st0.ps[-1234.5678] : m16.sw[4321] =3D> st0.ps[-0.285713445961583]
+fidivs st0.ps[1234.5678] : m16.sw[-4321] =3D> st0.ps[-0.285713445961583]
+fidivs st0.ps[-1234.5678] : m16.sw[-4321] =3D> st0.ps[0.285713445961583]
+fidivs st0.pd[1234567.7654321] : m16.sw[4321] =3D> st0.pd[285.7134379616=
06]
+fidivs st0.pd[-1234567.7654321] : m16.sw[4321] =3D> st0.pd[-285.71343796=
1606]
+fidivs st0.pd[1234567.7654321] : m16.sw[-4321] =3D> st0.pd[-285.71343796=
1606]
+fidivs st0.pd[-1234567.7654321] : m16.sw[-4321] =3D> st0.pd[285.71343796=
1606]
+fidivl st0.ps[1234.5678] : m32.sd[87654321] =3D> st0.ps[0.00001408450588=
53402]
+fidivl st0.ps[-1234.5678] : m32.sd[87654321] =3D> st0.ps[-0.000014084505=
8853402]
+fidivl st0.ps[1234.5678] : m32.sd[-87654321] =3D> st0.ps[-0.000014084505=
8853402]
+fidivl st0.ps[-1234.5678] : m32.sd[-87654321] =3D> st0.ps[0.000014084505=
8853402]
+fidivl st0.pd[1234567.7654321] : m32.sd[654321] =3D> st0.pd[1.8867922096=
8317]
+fidivl st0.pd[-1234567.7654321] : m32.sd[654321] =3D> st0.pd[-1.88679220=
968317]
+fidivl st0.pd[1234567.7654321] : m32.sd[-654321] =3D> st0.pd[-1.88679220=
968317]
+fidivl st0.pd[-1234567.7654321] : m32.sd[-654321] =3D> st0.pd[1.88679220=
968317]
+fdivrs st0.ps[1234.5678] : m32.ps[8765.4321] =3D> st0.ps[7.1000005832000=
5]
+fdivrs st0.ps[-1234.5678] : m32.ps[8765.4321] =3D> st0.ps[-7.10000058320=
005]
+fdivrs st0.ps[1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[-7.10000058320=
005]
+fdivrs st0.ps[-1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[7.10000058320=
005]
+fdivrl st0.pd[1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[6.2=
0000079200001]
+fdivrl st0.pd[-1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[-6=
.20000079200001]
+fdivrl st0.pd[1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[-6=
.20000079200001]
+fdivrl st0.pd[-1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[6=
.20000079200001]
+fdivr st0.ps[1234.5678] st2.ps[8765.4321] =3D> st2.ps[7.10000058320005]
+fdivr st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st2.ps[-7.10000058320005=
]
+fdivr st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st2.ps[-7.10000058320005=
]
+fdivr st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st2.ps[7.10000058320005=
]
+fdivr st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[6.2000=
0079200001]
+fdivr st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[-6.20=
000079200001]
+fdivr st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[-6.20=
000079200001]
+fdivr st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[6.20=
000079200001]
+fdivr st2.ps[1234.5678] st0.ps[8765.4321] =3D> st0.ps[0.140845058853402]
+fdivr st2.ps[-1234.5678] st0.ps[8765.4321] =3D> st0.ps[-0.14084505885340=
2]
+fdivr st2.ps[1234.5678] st0.ps[-8765.4321] =3D> st0.ps[-0.14084505885340=
2]
+fdivr st2.ps[-1234.5678] st0.ps[-8765.4321] =3D> st0.ps[0.14084505885340=
2]
+fdivr st2.pd[1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[0.1612=
9030197711]
+fdivr st2.pd[-1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[-0.16=
129030197711]
+fdivr st2.pd[1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[-0.16=
129030197711]
+fdivr st2.pd[-1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[0.16=
129030197711]
+fdivrp st0.ps[1234.5678] st2.ps[8765.4321] =3D> st1.ps[7.10000058320005]
+fdivrp st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st1.ps[-7.1000005832000=
5]
+fdivrp st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st1.ps[-7.1000005832000=
5]
+fdivrp st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st1.ps[7.1000005832000=
5]
+fdivrp st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[6.200=
00079200001]
+fdivrp st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[-6.2=
0000079200001]
+fdivrp st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[-6.2=
0000079200001]
+fdivrp st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[6.2=
0000079200001]
+fdivrp st0.ps[1234.5678] st1.ps[8765.4321] : =3D> st0.ps[7.1000005832000=
5]
+fdivrp st0.ps[-1234.5678] st1.ps[8765.4321] : =3D> st0.ps[-7.10000058320=
005]
+fdivrp st0.ps[1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[-7.10000058320=
005]
+fdivrp st0.ps[-1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[7.10000058320=
005]
+fdivrp st0.pd[1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[6.2=
0000079200001]
+fdivrp st0.pd[-1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[-6=
.20000079200001]
+fdivrp st0.pd[1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[-6=
.20000079200001]
+fdivrp st0.pd[-1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[6=
.20000079200001]
+fidivrs st0.ps[1234.5678] : m16.sw[4321] =3D> st0.ps[3.50001028700084]
+fidivrs st0.ps[-1234.5678] : m16.sw[4321] =3D> st0.ps[-3.50001028700084]
+fidivrs st0.ps[1234.5678] : m16.sw[-4321] =3D> st0.ps[-3.50001028700084]
+fidivrs st0.ps[-1234.5678] : m16.sw[-4321] =3D> st0.ps[3.50001028700084]
+fidivrs st0.pd[1234567.7654321] : m16.sw[4321] =3D> st0.pd[0.00350001038=
500114]
+fidivrs st0.pd[-1234567.7654321] : m16.sw[4321] =3D> st0.pd[-0.003500010=
38500114]
+fidivrs st0.pd[1234567.7654321] : m16.sw[-4321] =3D> st0.pd[-0.003500010=
38500114]
+fidivrs st0.pd[-1234567.7654321] : m16.sw[-4321] =3D> st0.pd[0.003500010=
38500114]
+fidivrl st0.ps[1234.5678] : m32.sd[87654321] =3D> st0.ps[71000.005832000=
5]
+fidivrl st0.ps[-1234.5678] : m32.sd[87654321] =3D> st0.ps[-71000.0058320=
005]
+fidivrl st0.ps[1234.5678] : m32.sd[-87654321] =3D> st0.ps[-71000.0058320=
005]
+fidivrl st0.ps[-1234.5678] : m32.sd[-87654321] =3D> st0.ps[71000.0058320=
005]
+fidivrl st0.pd[1234567.7654321] : m32.sd[654321] =3D> st0.pd[0.530000068=
300007]
+fidivrl st0.pd[-1234567.7654321] : m32.sd[654321] =3D> st0.pd[-0.5300000=
68300007]
+fidivrl st0.pd[1234567.7654321] : m32.sd[-654321] =3D> st0.pd[-0.5300000=
68300007]
+fidivrl st0.pd[-1234567.7654321] : m32.sd[-654321] =3D> st0.pd[0.5300000=
68300007]
+filds m16.sw[12345] =3D> st0.ps[12345.0]
+filds m16.sw[-12345] =3D> st0.ps[-12345.0]
+filds m16.sw[12345] =3D> st0.pd[12345.0]
+filds m16.sw[-12345] =3D> st0.pd[-12345.0]
+fildl m32.sd[12345678] =3D> st0.ps[12345678.0]
+fildl m32.sd[-12345678] =3D> st0.ps[-12345678.0]
+fildl m32.sd[12345678] =3D> st0.pd[12345678.0]
+fildl m32.sd[-12345678] =3D> st0.pd[-12345678.0]
+fildq m64.sq[123456787654321] =3D> st0.ps[123456787654321.0]
+fildq m64.sq[-123456787654321] =3D> st0.ps[-123456787654321.0]
+fildq m64.sq[123456787654321] =3D> st0.pd[123456787654321.0]
+fildq m64.sq[-123456787654321] =3D> st0.pd[-123456787654321.0]
+#fists fpucw[0xc00,0x000] st0.ps[1234.5678] : m16.sw[0] =3D> 0.sw[1235] =
st0.ps[1234.5678]
+#fists fpucw[0xc00,0x000] st0.ps[-1234.5678] : m16.sw[0] =3D> 0.sw[-1235=
] st0.ps[-1234.5678]
+#fists fpucw[0xc00,0x400] st0.ps[1234.5678] : m16.sw[0] =3D> 0.sw[1234] =
st0.ps[1234.5678]
+#fists fpucw[0xc00,0x400] st0.ps[-1234.5678] : m16.sw[0] =3D> 0.sw[-1235=
] st0.ps[-1234.5678]
+#fists fpucw[0xc00,0x800] st0.ps[1234.5678] : m16.sw[0] =3D> 0.sw[1235] =
st0.ps[1234.5678]
+#fists fpucw[0xc00,0x800] st0.ps[-1234.5678] : m16.sw[0] =3D> 0.sw[-1234=
] st0.ps[-1234.5678]
+#fists fpucw[0xc00,0xc00] st0.ps[1234.5678] : m16.sw[0] =3D> 0.sw[1234] =
st0.ps[1234.5678]
+#fists fpucw[0xc00,0xc00] st0.ps[-1234.5678] : m16.sw[0] =3D> 0.sw[-1234=
] st0.ps[-1234.5678]
+fistl fpucw[0xc00,0x000] st0.pd[1234567.7654321] : m32.sd[0] =3D> 0.sd[1=
234568] st0.pd[1234567.7654321]
+fistl fpucw[0xc00,0x000] st0.pd[-1234567.7654321] : m32.sd[0] =3D> 0.sd[=
-1234568] st0.pd[-1234567.7654321]
+fistl fpucw[0xc00,0x400] st0.pd[1234567.7654321] : m32.sd[0] =3D> 0.sd[1=
234567] st0.pd[1234567.7654321]
+fistl fpucw[0xc00,0x400] st0.pd[-1234567.7654321] : m32.sd[0] =3D> 0.sd[=
-1234568] st0.pd[-1234567.7654321]
+fistl fpucw[0xc00,0x800] st0.pd[1234567.7654321] : m32.sd[0] =3D> 0.sd[1=
234568] st0.pd[1234567.7654321]
+fistl fpucw[0xc00,0x800] st0.pd[-1234567.7654321] : m32.sd[0] =3D> 0.sd[=
-1234567] st0.pd[-1234567.7654321]
+fistl fpucw[0xc00,0xc00] st0.pd[1234567.7654321] : m32.sd[0] =3D> 0.sd[1=
234567] st0.pd[1234567.7654321]
+fistl fpucw[0xc00,0xc00] st0.pd[-1234567.7654321] : m32.sd[0] =3D> 0.sd[=
-1234567] st0.pd[-1234567.7654321]
+#fistps fpucw[0xc00,0x000] st0.ps[1234.5678] st1.ps[1111.1111] : m16.sw[=
0] =3D> 0.sw[1235] st0.ps[1111.1111]
+#fistps fpucw[0xc00,0x000] st0.ps[-1234.5678] st1.ps[1111.1111] : m16.sw=
[0] =3D> 0.sw[-1235] st0.ps[1111.1111]
+#fistps fpucw[0xc00,0x400] st0.ps[1234.5678] st1.ps[1111.1111] : m16.sw[=
0] =3D> 0.sw[1234] st0.ps[1111.1111]
+#fistps fpucw[0xc00,0x400] st0.ps[-1234.5678] st1.ps[1111.1111] : m16.sw=
[0] =3D> 0.sw[-1235] st0.ps[1111.1111]
+#fistps fpucw[0xc00,0x800] st0.ps[1234.5678] st1.ps[1111.1111] : m16.sw[=
0] =3D> 0.sw[1235] st0.ps[1111.1111]
+#fistps fpucw[0xc00,0x800] st0.ps[-1234.5678] st1.ps[1111.1111] : m16.sw=
[0] =3D> 0.sw[-1234] st0.ps[1111.1111]
+#fistps fpucw[0xc00,0xc00] st0.ps[1234.5678] st1.ps[1111.1111] : m16.sw[=
0] =3D> 0.sw[1234] st0.ps[1111.1111]
+#fistps fpucw[0xc00,0xc00] st0.ps[-1234.5678] st1.ps[1111.1111] : m16.sw=
[0] =3D> 0.sw[-1234] st0.ps[1111.1111]
+fistpl fpucw[0xc00,0x000] st0.pd[1234567.7654321] st1.ps[1111.1111] : m3=
2.sd[0] =3D> 0.sd[1234568] st0.ps[1111.1111]
+fistpl fpucw[0xc00,0x000] st0.pd[-1234567.7654321] st1.ps[1111.1111] : m=
32.sd[0] =3D> 0.sd[-1234568] st0.ps[1111.1111]
+fistpl fpucw[0xc00,0x400] st0.pd[1234567.7654321] st1.ps[1111.1111] : m3=
2.sd[0] =3D> 0.sd[1234567] st0.ps[1111.1111]
+fistpl fpucw[0xc00,0x400] st0.pd[-1234567.7654321] st1.ps[1111.1111] : m=
32.sd[0] =3D> 0.sd[-1234568] st0.ps[1111.1111]
+fistpl fpucw[0xc00,0x800] st0.pd[1234567.7654321] st1.ps[1111.1111] : m3=
2.sd[0] =3D> 0.sd[1234568] st0.ps[1111.1111]
+fistpl fpucw[0xc00,0x800] st0.pd[-1234567.7654321] st1.ps[1111.1111] : m=
32.sd[0] =3D> 0.sd[-1234567] st0.ps[1111.1111]
+fistpl fpucw[0xc00,0xc00] st0.pd[1234567.7654321] st1.ps[1111.1111] : m3=
2.sd[0] =3D> 0.sd[1234567] st0.ps[1111.1111]
+fistpl fpucw[0xc00,0xc00] st0.pd[-1234567.7654321] st1.ps[1111.1111] : m=
32.sd[0] =3D> 0.sd[-1234567] st0.ps[1111.1111]
+fistpq fpucw[0xc00,0x000] st0.pd[123456787654321.6] st1.ps[1111.1111] : =
m64.sq[0] =3D> 0.sq[123456787654322] st0.ps[1111.1111]
+fistpq fpucw[0xc00,0x000] st0.pd[-123456787654321.6] st1.ps[1111.1111] :=
m64.sq[0] =3D> 0.sq[-123456787654322] st0.ps[1111.1111]
+fistpq fpucw[0xc00,0x400] st0.pd[123456787654321.6] st1.ps[1111.1111] : =
m64.sq[0] =3D> 0.sq[123456787654321] st0.ps[1111.1111]
+fistpq fpucw[0xc00,0x400] st0.pd[-123456787654321.6] st1.ps[1111.1111] :=
m64.sq[0] =3D> 0.sq[-123456787654322] st0.ps[1111.1111]
+fistpq fpucw[0xc00,0x800] st0.pd[123456787654321.6] st1.ps[1111.1111] : =
m64.sq[0] =3D> 0.sq[123456787654322] st0.ps[1111.1111]
+fistpq fpucw[0xc00,0x800] st0.pd[-123456787654321.6] st1.ps[1111.1111] :=
m64.sq[0] =3D> 0.sq[-123456787654321] st0.ps[1111.1111]
+fistpq fpucw[0xc00,0xc00] st0.pd[123456787654321.6] st1.ps[1111.1111] : =
m64.sq[0] =3D> 0.sq[123456787654321] st0.ps[1111.1111]
+fistpq fpucw[0xc00,0xc00] st0.pd[-123456787654321.6] st1.ps[1111.1111] :=
m64.sq[0] =3D> 0.sq[-123456787654321] st0.ps[1111.1111]
+flds m32.ps[1234.5678] =3D> st0.ps[1234.5678]
+flds m32.ps[-1234.5678] =3D> st0.ps[-1234.5678]
+fldl m64.pd[1234567.7654321] =3D> st0.pd[1234567.7654321]
+fldl m64.pd[-1234567.7654321] =3D> st0.pd[-1234567.7654321]
+fld st2.ps[1234.5678] =3D> st0.ps[1234.5678] st3.ps[1234.5678]
+fld st2.ps[-1234.5678] =3D> st0.ps[-1234.5678] st3.ps[-1234.5678]
+fld st2.pd[1234567.7654321] =3D> st0.pd[1234567.7654321] st3.pd[1234567.=
7654321]
+fld1 =3D> st0.pd[1.0]
+fldl2t =3D> st0.pd[3.321928094887362]
+fldl2e =3D> st0.pd[1.442695040888963]
+fldpi =3D> st0.pd[3.141592653589793]
+fldlg2 =3D> st0.pd[0.3010299956639812]
+fldln2 =3D> st0.pd[0.6931471805599453]
+fldz =3D> st0.pd[0.0]
+fmuls st0.ps[1234.5678] : m32.ps[8765.4321] =3D> st0.ps[10821520.2237464=
]
+fmuls st0.ps[-1234.5678] : m32.ps[8765.4321] =3D> st0.ps[-10821520.22374=
64]
+fmuls st0.ps[1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[-10821520.22374=
64]
+fmuls st0.ps[-1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[10821520.22374=
64]
+fmull st0.pd[1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[9449=
778125285.66]
+fmull st0.pd[-1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[-94=
49778125285.66]
+fmull st0.pd[1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[-94=
49778125285.66]
+fmull st0.pd[-1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[94=
49778125285.66]
+fmul st0.ps[1234.5678] st2.ps[8765.4321] =3D> st2.ps[10821520.2237464]
+fmul st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st2.ps[-10821520.2237464]
+fmul st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st2.ps[-10821520.2237464]
+fmul st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st2.ps[10821520.2237464]
+fmul st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[9449778=
125285.66]
+fmul st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[-94497=
78125285.66]
+fmul st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[-94497=
78125285.66]
+fmul st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[94497=
78125285.66]
+fmul st2.ps[1234.5678] st0.ps[8765.4321] =3D> st0.ps[10821520.2237464]
+fmul st2.ps[-1234.5678] st0.ps[8765.4321] =3D> st0.ps[-10821520.2237464]
+fmul st2.ps[1234.5678] st0.ps[-8765.4321] =3D> st0.ps[-10821520.2237464]
+fmul st2.ps[-1234.5678] st0.ps[-8765.4321] =3D> st0.ps[10821520.2237464]
+fmul st2.pd[1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[9449778=
125285.66]
+fmul st2.pd[-1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[-94497=
78125285.66]
+fmul st2.pd[1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[-94497=
78125285.66]
+fmul st2.pd[-1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[94497=
78125285.66]
+fmulp st0.ps[1234.5678] st2.ps[8765.4321] =3D> st1.ps[10821520.2237464]
+fmulp st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st1.ps[-10821520.2237464=
]
+fmulp st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st1.ps[-10821520.2237464=
]
+fmulp st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st1.ps[10821520.2237464=
]
+fmulp st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[944977=
8125285.66]
+fmulp st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[-9449=
778125285.66]
+fmulp st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[-9449=
778125285.66]
+fmulp st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[9449=
778125285.66]
+fmulp st0.ps[1234.5678] st1.ps[8765.4321] : =3D> st0.ps[10821520.2237464=
]
+fmulp st0.ps[-1234.5678] st1.ps[8765.4321] : =3D> st0.ps[-10821520.22374=
64]
+fmulp st0.ps[1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[-10821520.22374=
64]
+fmulp st0.ps[-1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[10821520.22374=
64]
+fmulp st0.pd[1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[9449=
778125285.66]
+fmulp st0.pd[-1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[-94=
49778125285.66]
+fmulp st0.pd[1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[-94=
49778125285.66]
+fmulp st0.pd[-1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[94=
49778125285.66]
+fimuls st0.ps[1234.5678] : m16.sw[4321] =3D> st0.ps[5334567.4638]
+fimuls st0.ps[-1234.5678] : m16.sw[4321] =3D> st0.ps[-5334567.4638]
+fimuls st0.ps[1234.5678] : m16.sw[-4321] =3D> st0.ps[-5334567.4638]
+fimuls st0.ps[-1234.5678] : m16.sw[-4321] =3D> st0.ps[5334567.4638]
+fimuls st0.pd[1234567.7654321] : m16.sw[4321] =3D> st0.pd[5334567314.432=
1]
+fimuls st0.pd[-1234567.7654321] : m16.sw[4321] =3D> st0.pd[-5334567314.4=
321]
+fimuls st0.pd[1234567.7654321] : m16.sw[-4321] =3D> st0.pd[-5334567314.4=
321]
+fimuls st0.pd[-1234567.7654321] : m16.sw[-4321] =3D> st0.pd[5334567314.4=
321]
+fimull st0.ps[1234.5678] : m32.sd[87654321] =3D> st0.ps[108215202237.464=
]
+fimull st0.ps[-1234.5678] : m32.sd[87654321] =3D> st0.ps[-108215202237.4=
64]
+fimull st0.ps[1234.5678] : m32.sd[-87654321] =3D> st0.ps[-108215202237.4=
64]
+fimull st0.ps[-1234.5678] : m32.sd[-87654321] =3D> st0.ps[108215202237.4=
64]
+fimull st0.pd[1234567.7654321] : m32.sd[654321] =3D> st0.pd[807803614845=
.297]
+fimull st0.pd[-1234567.7654321] : m32.sd[654321] =3D> st0.pd[-8078036148=
45.297]
+fimull st0.pd[1234567.7654321] : m32.sd[-654321] =3D> st0.pd[-8078036148=
45.297]
+fimull st0.pd[-1234567.7654321] : m32.sd[-654321] =3D> st0.pd[8078036148=
45.297]
+frndint fpucw[0xc00,0x000] st0.ps[1234.5678] : =3D> st0.ps[1235.0]
+frndint fpucw[0xc00,0x000] st0.ps[-1234.5678] : =3D> st0.ps[-1235.0]
+frndint fpucw[0xc00,0x400] st0.ps[1234.5678] : =3D> st0.ps[1234.0]
+frndint fpucw[0xc00,0x400] st0.ps[-1234.5678] : =3D> st0.ps[-1235.0]
+frndint fpucw[0xc00,0x800] st0.ps[1234.5678] : =3D> st0.ps[1235.0]
+frndint fpucw[0xc00,0x800] st0.ps[-1234.5678] : =3D> st0.ps[-1234.0]
+frndint fpucw[0xc00,0xc00] st0.ps[1234.5678] : =3D> st0.ps[1234.0]
+frndint fpucw[0xc00,0xc00] st0.ps[-1234.5678] : =3D> st0.ps[-1234.0]
+frndint fpucw[0xc00,0x000] st0.pd[1234567.7654321] : =3D> st0.pd[1234568=
.0]
+frndint fpucw[0xc00,0x000] st0.pd[-1234567.7654321] : =3D> st0.pd[-12345=
68.0]
+frndint fpucw[0xc00,0x400] st0.pd[1234567.7654321] : =3D> st0.pd[1234567=
.0]
+frndint fpucw[0xc00,0x400] st0.pd[-1234567.7654321] : =3D> st0.pd[-12345=
68.0]
+frndint fpucw[0xc00,0x800] st0.pd[1234567.7654321] : =3D> st0.pd[1234568=
.0]
+frndint fpucw[0xc00,0x800] st0.pd[-1234567.7654321] : =3D> st0.pd[-12345=
67.0]
+frndint fpucw[0xc00,0xc00] st0.pd[1234567.7654321] : =3D> st0.pd[1234567=
.0]
+frndint fpucw[0xc00,0xc00] st0.pd[-1234567.7654321] : =3D> st0.pd[-12345=
67.0]
+fsubs st0.ps[1234.5678] : m32.ps[8765.4321] =3D> st0.ps[-7530.8643]
+fsubs st0.ps[-1234.5678] : m32.ps[8765.4321] =3D> st0.ps[-9999.9990]
+fsubs st0.ps[1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[9999.9999]
+fsubs st0.ps[-1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[7530.8643]
+fsubl st0.pd[1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[-641=
9753.3580246]
+fsubl st0.pd[-1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[-88=
88888.8888888]
+fsubl st0.pd[1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[888=
8888.8888888]
+fsubl st0.pd[-1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[64=
19753.3580246]
+fsub st0.ps[1234.5678] st2.ps[8765.4321] =3D> st2.ps[-7530.8643]
+fsub st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st2.ps[-9999.9999]
+fsub st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st2.ps[9999.9999]
+fsub st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st2.ps[7530.8643]
+fsub st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[-641975=
3.3580246]
+fsub st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[-88888=
88.8888888]
+fsub st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[888888=
8.8888888]
+fsub st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[64197=
53.3580246]
+fsub st2.ps[1234.5678] st0.ps[8765.4321] =3D> st0.ps[7530.8643]
+fsub st2.ps[-1234.5678] st0.ps[8765.4321] =3D> st0.ps[9999.9999]
+fsub st2.ps[1234.5678] st0.ps[-8765.4321] =3D> st0.ps[-9999.9999]
+fsub st2.ps[-1234.5678] st0.ps[-8765.4321] =3D> st0.ps[-7530.8643]
+fsub st2.pd[1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[6419753=
.3580246]
+fsub st2.pd[-1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[888888=
8.8888888]
+fsub st2.pd[1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[-88888=
88.8888888]
+fsub st2.pd[-1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[-6419=
753.3580246]
+fsubp st0.ps[1234.5678] st2.ps[8765.4321] =3D> st1.ps[-7530.8643]
+fsubp st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st1.ps[-9999.9999]
+fsubp st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st1.ps[9999.9999]
+fsubp st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st1.ps[7530.8643]
+fsubp st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[-64197=
53.3580246]
+fsubp st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[-8888=
888.8888888]
+fsubp st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[88888=
88.8888888]
+fsubp st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[6419=
753.3580246]
+fsubp st0.ps[1234.5678] st1.ps[8765.4321] : =3D> st0.ps[-7530.8643]
+fsubp st0.ps[-1234.5678] st1.ps[8765.4321] : =3D> st0.ps[-9999.9999]
+fsubp st0.ps[1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[9999.9999]
+fsubp st0.ps[-1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[7530.8643]
+fsubp st0.pd[1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[-641=
9753.3580246]
+fsubp st0.pd[-1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[-88=
88888.8888888]
+fsubp st0.pd[1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[888=
8888.8888888]
+fsubp st0.pd[-1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[64=
19753.3580246]
+fisubs st0.ps[1234.5678] : m16.sw[4321] =3D> st0.ps[-3086.4322]
+fisubs st0.ps[-1234.5678] : m16.sw[4321] =3D> st0.ps[-5555.5678]
+fisubs st0.ps[1234.5678] : m16.sw[-4321] =3D> st0.ps[5555.5678]
+fisubs st0.ps[-1234.5678] : m16.sw[-4321] =3D> st0.ps[3086.4322]
+fisubs st0.pd[1234567.7654321] : m16.sw[4321] =3D> st0.pd[1230246.765432=
1]
+fisubs st0.pd[-1234567.7654321] : m16.sw[4321] =3D> st0.pd[-1238888.7654=
321]
+fisubs st0.pd[1234567.7654321] : m16.sw[-4321] =3D> st0.pd[1238888.76543=
21]
+fisubs st0.pd[-1234567.7654321] : m16.sw[-4321] =3D> st0.pd[-1230246.765=
4321]
+fisubl st0.ps[1234.5678] : m32.sd[87654321] =3D> st0.ps[-87653086.4322]
+fisubl st0.ps[-1234.5678] : m32.sd[87654321] =3D> st0.ps[-87655555.5678]
+fisubl st0.ps[1234.5678] : m32.sd[-87654321] =3D> st0.ps[87655555.5678]
+fisubl st0.ps[-1234.5678] : m32.sd[-87654321] =3D> st0.ps[87653086.4322]
+fisubl st0.pd[1234567.7654321] : m32.sd[87654321] =3D> st0.pd[-86419753.=
2345679]
+fisubl st0.pd[-1234567.7654321] : m32.sd[87654321] =3D> st0.pd[-88888888=
.7654321]
+fisubl st0.pd[1234567.7654321] : m32.sd[-87654321] =3D> st0.pd[88888888.=
7654321]
+fisubl st0.pd[-1234567.7654321] : m32.sd[-87654321] =3D> st0.pd[86419753=
.2345679]
+fsubrs st0.ps[1234.5678] : m32.ps[8765.4321] =3D> st0.ps[7530.8643]
+fsubrs st0.ps[-1234.5678] : m32.ps[8765.4321] =3D> st0.ps[9999.9990]
+fsubrs st0.ps[1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[-9999.9999]
+fsubrs st0.ps[-1234.5678] : m32.ps[-8765.4321] =3D> st0.ps[-7530.8643]
+fsubrl st0.pd[1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[641=
9753.3580246]
+fsubrl st0.pd[-1234567.7654321] : m64.pd[7654321.1234567] =3D> st0.pd[88=
88888.8888888]
+fsubrl st0.pd[1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[-8=
888888.8888888]
+fsubrl st0.pd[-1234567.7654321] : m64.pd[-7654321.1234567] =3D> st0.pd[-=
6419753.3580246]
+fsubr st0.ps[1234.5678] st2.ps[8765.4321] =3D> st2.ps[7530.8643]
+fsubr st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st2.ps[9999.9999]
+fsubr st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st2.ps[-9999.9999]
+fsubr st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st2.ps[-7530.8643]
+fsubr st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[641975=
3.3580246]
+fsubr st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st2.pd[88888=
88.8888888]
+fsubr st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[-8888=
888.8888888]
+fsubr st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st2.pd[-641=
9753.3580246]
+fsubr st2.ps[1234.5678] st0.ps[8765.4321] =3D> st0.ps[-7530.8643]
+fsubr st2.ps[-1234.5678] st0.ps[8765.4321] =3D> st0.ps[-9999.9999]
+fsubr st2.ps[1234.5678] st0.ps[-8765.4321] =3D> st0.ps[9999.9999]
+fsubr st2.ps[-1234.5678] st0.ps[-8765.4321] =3D> st0.ps[7530.8643]
+fsubr st2.pd[1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[-64197=
53.3580246]
+fsubr st2.pd[-1234567.7654321] st0.pd[7654321.1234567] =3D> st0.pd[-8888=
888.8888888]
+fsubr st2.pd[1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[88888=
88.8888888]
+fsubr st2.pd[-1234567.7654321] st0.pd[-7654321.1234567] =3D> st0.pd[6419=
753.3580246]
+fsubrp st0.ps[1234.5678] st2.ps[8765.4321] =3D> st1.ps[7530.8643]
+fsubrp st0.ps[-1234.5678] st2.ps[8765.4321] =3D> st1.ps[9999.9999]
+fsubrp st0.ps[1234.5678] st2.ps[-8765.4321] =3D> st1.ps[-9999.9999]
+fsubrp st0.ps[-1234.5678] st2.ps[-8765.4321] =3D> st1.ps[-7530.8643]
+fsubrp st0.pd[1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[64197=
53.3580246]
+fsubrp st0.pd[-1234567.7654321] st2.pd[7654321.1234567] =3D> st1.pd[8888=
888.8888888]
+fsubrp st0.pd[1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[-888=
8888.8888888]
+fsubrp st0.pd[-1234567.7654321] st2.pd[-7654321.1234567] =3D> st1.pd[-64=
19753.3580246]
+fsubrp st0.ps[1234.5678] st1.ps[8765.4321] : =3D> st0.ps[7530.8643]
+fsubrp st0.ps[-1234.5678] st1.ps[8765.4321] : =3D> st0.ps[9999.9999]
+fsubrp st0.ps[1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[-9999.9999]
+fsubrp st0.ps[-1234.5678] st1.ps[-8765.4321] : =3D> st0.ps[-7530.8643]
+fsubrp st0.pd[1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[641=
9753.3580246]
+fsubrp st0.pd[-1234567.7654321] st1.pd[7654321.1234567] : =3D> st0.pd[88=
88888.8888888]
+fsubrp st0.pd[1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[-8=
888888.8888888]
+fsubrp st0.pd[-1234567.7654321] st1.pd[-7654321.1234567] : =3D> st0.pd[-=
6419753.3580246]
+fisubrs st0.ps[1234.5678] : m16.sw[4321] =3D> st0.ps[3086.4322]
+fisubrs st0.ps[-1234.5678] : m16.sw[4321] =3D> st0.ps[5555.5678]
+fisubrs st0.ps[1234.5678] : m16.sw[-4321] =3D> st0.ps[-5555.5678]
+fisubrs st0.ps[-1234.5678] : m16.sw[-4321] =3D> st0.ps[-3086.4322]
+fisubrs st0.pd[1234567.7654321] : m16.sw[4321] =3D> st0.pd[-1230246.7654=
321]
+fisubrs st0.pd[-1234567.7654321] : m16.sw[4321] =3D> st0.pd[1238888.7654=
321]
+fisubrs st0.pd[1234567.7654321] : m16.sw[-4321] =3D> st0.pd[-1238888.765=
4321]
+fisubrs st0.pd[-1234567.7654321] : m16.sw[-4321] =3D> st0.pd[1230246.765=
4321]
+fisubrl st0.ps[1234.5678] : m32.sd[87654321] =3D> st0.ps[87655555.5678]
+fisubrl st0.ps[-1234.5678] : m32.sd[87654321] =3D> st0.ps[87653086.4322]
+fisubrl st0.ps[1234.5678] : m32.sd[-87654321] =3D> st0.ps[-87653086.4322=
]
+fisubrl st0.ps[-1234.5678] : m32.sd[-87654321] =3D> st0.ps[-87655555.567=
8]
+fisubrl st0.pd[1234567.7654321] : m32.sd[87654321] =3D> st0.pd[86419753.=
2345679]
+fisubrl st0.pd[-1234567.7654321] : m32.sd[87654321] =3D> st0.pd[88888888=
.7654321]
+fisubrl st0.pd[1234567.7654321] : m32.sd[-87654321] =3D> st0.pd[-8888888=
8.7654321]
+fisubrl st0.pd[-1234567.7654321] : m32.sd[-87654321] =3D> st0.pd[-864197=
53.2345679]
+fxch st0.ps[1234.5678] : st2.ps[8765.4321] =3D> st0.ps[8765.4321] st2.ps=
[1234.5678]
+fxch st0.pd[1234567.7654321] : st2.pd[7654321.1234567] =3D> st0.pd[76543=
21.1234567] st2.pd[1234567.7654321]
Added: trunk/none/tests/amd64/insn_fpu.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/insn_fpu.stderr.exp 2005-05-12 18:05:00 UTC (r=
ev 3686)
+++ trunk/none/tests/amd64/insn_fpu.stderr.exp 2005-05-12 19:17:36 UTC (r=
ev 3687)
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/amd64/insn_fpu.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/insn_fpu.stdout.exp 2005-05-12 18:05:00 UTC (r=
ev 3686)
+++ trunk/none/tests/amd64/insn_fpu.stdout.exp 2005-05-12 19:17:36 UTC (r=
ev 3687)
@@ -0,0 +1,436 @@
+fabs_1 ... ok
+fabs_2 ... ok
+fabs_3 ... ok
+fabs_4 ... ok
+fadds_1 ... ok
+fadds_2 ... ok
+fadds_3 ... ok
+fadds_4 ... ok
+faddl_1 ... ok
+faddl_2 ... ok
+faddl_3 ... ok
+faddl_4 ... ok
+fadd_1 ... ok
+fadd_2 ... ok
+fadd_3 ... ok
+fadd_4 ... ok
+fadd_5 ... ok
+fadd_6 ... ok
+fadd_7 ... ok
+fadd_8 ... ok
+fadd_9 ... ok
+fadd_10 ... ok
+fadd_11 ... ok
+fadd_12 ... ok
+fadd_13 ... ok
+fadd_14 ... ok
+fadd_15 ... ok
+fadd_16 ... ok
+faddp_1 ... ok
+faddp_2 ... ok
+faddp_3 ... ok
+faddp_4 ... ok
+faddp_5 ... ok
+faddp_6 ... ok
+faddp_7 ... ok
+faddp_8 ... ok
+faddp_9 ... ok
+faddp_10 ... ok
+faddp_11 ... ok
+faddp_12 ... ok
+faddp_13 ... ok
+faddp_14 ... ok
+faddp_15 ... ok
+faddp_16 ... ok
+fiadds_1 ... ok
+fiadds_2 ... ok
+fiadds_3 ... ok
+fiadds_4 ... ok
+fiadds_5 ... ok
+fiadds_6 ... ok
+fiadds_7 ... ok
+fiadds_8 ... ok
+fiaddl_1 ... ok
+fiaddl_2 ... ok
+fiaddl_3 ... ok
+fiaddl_4 ... ok
+fiaddl_5 ... ok
+fiaddl_6 ... ok
+fiaddl_7 ... ok
+fiaddl_8 ... ok
+fcomi_1 ... ok
+fcomi_2 ... ok
+fcomi_3 ... ok
+fcomi_4 ... ok
+fcomi_5 ... ok
+fcomi_6 ... ok
+fcomip_1 ... ok
+fcomip_2 ... ok
+fcomip_3 ... ok
+fcomip_4 ... ok
+fcomip_5 ... ok
+fcomip_6 ... ok
+fucomi_1 ... ok
+fucomi_2 ... ok
+fucomi_3 ... ok
+fucomi_4 ... ok
+fucomi_5 ... ok
+fucomi_6 ... ok
+fucomip_1 ... ok
+fucomip_2 ... ok
+fucomip_3 ... ok
+fucomip_4 ... ok
+fucomip_5 ... ok
+fucomip_6 ... ok
+fchs_1 ... ok
+fchs_2 ... ok
+fchs_3 ... ok
+fchs_4 ... ok
+fdivs_1 ... ok
+fdivs_2 ... ok
+fdivs_3 ... ok
+fdivs_4 ... ok
+fdivl_1 ... ok
+fdivl_2 ... ok
+fdivl_3 ... ok
+fdivl_4 ... ok
+fdiv_1 ... ok
+fdiv_2 ... ok
+fdiv_3 ... ok
+fdiv_4 ... ok
+fdiv_5 ... ok
+fdiv_6 ... ok
+fdiv_7 ... ok
+fdiv_8 ... ok
+fdiv_9 ... ok
+fdiv_10 ... ok
+fdiv_11 ... ok
+fdiv_12 ... ok
+fdiv_13 ... ok
+fdiv_14 ... ok
+fdiv_15 ... ok
+fdiv_16 ... ok
+fdivp_1 ... ok
+fdivp_2 ... ok
+fdivp_3 ... ok
+fdivp_4 ... ok
+fdivp_5 ... ok
+fdivp_6 ... ok
+fdivp_7 ... ok
+fdivp_8 ... ok
+fdivp_9 ... ok
+fdivp_10 ... ok
+fdivp_11 ... ok
+fdivp_12 ... ok
+fdivp_13 ... ok
+fdivp_14 ... ok
+fdivp_15 ... ok
+fdivp_16 ... ok
+fidivs_1 ... ok
+fidivs_2 ... ok
+fidivs_3 ... ok
+fidivs_4 ... ok
+fidivs_5 ... ok
+fidivs_6 ... ok
+fidivs_7 ... ok
+fidivs_8 ... ok
+fidivl_1 ... ok
+fidivl_2 ... ok
+fidivl_3 ... ok
+fidivl_4 ... ok
+fidivl_5 ... ok
+fidivl_6 ... ok
+fidivl_7 ... ok
+fidivl_8 ... ok
+fdivrs_1 ... ok
+fdivrs_2 ... ok
+fdivrs_3 ... ok
+fdivrs_4 ... ok
+fdivrl_1 ... ok
+fdivrl_2 ... ok
+fdivrl_3 ... ok
+fdivrl_4 ... ok
+fdivr_1 ... ok
+fdivr_2 ... ok
+fdivr_3 ... ok
+fdivr_4 ... ok
+fdivr_5 ... ok
+fdivr_6 ... ok
+fdivr_7 ... ok
+fdivr_8 ... ok
+fdivr_9 ... ok
+fdivr_10 ... ok
+fdivr_11 ... ok
+fdivr_12 ... ok
+fdivr_13 ... ok
+fdivr_14 ... ok
+fdivr_15 ... ok
+fdivr_16 ... ok
+fdivrp_1 ... ok
+fdivrp_2 ... ok
+fdivrp_3 ... ok
+fdivrp_4 ... ok
+fdivrp_5 ... ok
+fdivrp_6 ... ok
+fdivrp_7 ... ok
+fdivrp_8 ... ok
+fdivrp_9 ... ok
+fdivrp_10 ... ok
+fdivrp_11 ... ok
+fdivrp_12 ... ok
+fdivrp_13 ... ok
+fdivrp_14 ... ok
+fdivrp_15 ... ok
+fdivrp_16 ... ok
+fidivrs_1 ... ok
+fidivrs_2 ... ok
+fidivrs_3 ... ok
+fidivrs_4 ... ok
+fidivrs_5 ... ok
+fidivrs_6 ... ok
+fidivrs_7 ... ok
+fidivrs_8 ... ok
+fidivrl_1 ... ok
+fidivrl_2 ... ok
+fidivrl_3 ... ok
+fidivrl_4 ... ok
+fidivrl_5 ... ok
+fidivrl_6 ... ok
+fidivrl_7 ... ok
+fidivrl_8 ... ok
+filds_1 ... ok
+filds_2 ... ok
+filds_3 ... ok
+filds_4 ... ok
+fildl_1 ... ok
+fildl_2 ... ok
+fildl_3 ... ok
+fildl_4 ... ok
+fildq_1 ... ok
+fildq_2 ... ok
+fildq_3 ... ok
+fildq_4 ... ok
+fistl_1 ... ok
+fistl_2 ... ok
+fistl_3 ... ok
+fistl_4 ... ok
+fistl_5 ... ok
+fistl_6 ... ok
+fistl_7 ... ok
+fistl_8 ... ok
+fistpl_1 ... ok
+fistpl_2 ... ok
+fistpl_3 ... ok
+fistpl_4 ... ok
+fistpl_5 ... ok
+fistpl_6 ... ok
+fistpl_7 ... ok
+fistpl_8 ... ok
+fistpq_1 ... ok
+fistpq_2 ... ok
+fistpq_3 ... ok
+fistpq_4 ... ok
+fistpq_5 ... ok
+fistpq_6 ... ok
+fistpq_7 ... ok
+fistpq_8 ... ok
+flds_1 ... ok
+flds_2 ... ok
+fldl_1 ... ok
+fldl_2 ... ok
+fld_1 ... ok
+fld_2 ... ok
+fld_3 ... ok
+fld1_1 ... ok
+fldl2t_1 ... ok
+fldl2e_1 ... ok
+fldpi_1 ... ok
+fldlg2_1 ... ok
+fldln2_1 ... ok
+fldz_1 ... ok
+fmuls_1 ... ok
+fmuls_2 ... ok
+fmuls_3 ... ok
+fmuls_4 ... ok
+fmull_1 ... ok
+fmull_2 ... ok
+fmull_3 ... ok
+fmull_4 ... ok
+fmul_1 ... ok
+fmul_2 ... ok
+fmul_3 ... ok
+fmul_4 ... ok
+fmul_5 ... ok
+fmul_6 ... ok
+fmul_7 ... ok
+fmul_8 ... ok
+fmul_9 ... ok
+fmul_10 ... ok
+fmul_11 ... ok
+fmul_12 ... ok
+fmul_13 ... ok
+fmul_14 ... ok
+fmul_15 ... ok
+fmul_16 ... ok
+fmulp_1 ... ok
+fmulp_2 ... ok
+fmulp_3 ... ok
+fmulp_4 ... ok
+fmulp_5 ... ok
+fmulp_6 ... ok
+fmulp_7 ... ok
+fmulp_8 ... ok
+fmulp_9 ... ok
+fmulp_10 ... ok
+fmulp_11 ... ok
+fmulp_12 ... ok
+fmulp_13 ... ok
+fmulp_14 ... ok
+fmulp_15 ... ok
+fmulp_16 ... ok
+fimuls_1 ... ok
+fimuls_2 ... ok
+fimuls_3 ... ok
+fimuls_4 ... ok
+fimuls_5 ... ok
+fimuls_6 ... ok
+fimuls_7 ... ok
+fimuls_8 ... ok
+fimull_1 ... ok
+fimull_2 ... ok
+fimull_3 ... ok
+fimull_4 ... ok
+fimull_5 ... ok
+fimull_6 ... ok
+fimull_7 ... ok
+fimull_8 ... ok
+frndint_1 ... ok
+frndint_2 ... ok
+frndint_3 ... ok
+frndint_4 ... ok
+frndint_5 ... ok
+frndint_6 ... ok
+frndint_7 ... ok
+frndint_8 ... ok
+frndint_9 ... ok
+frndint_10 ... ok
+frndint_11 ... ok
+frndint_12 ... ok
+frndint_13 ... ok
+frndint_14 ... ok
+frndint_15 ... ok
+frndint_16 ... ok
+fsubs_1 ... ok
+fsubs_2 ... ok
+fsubs_3 ... ok
+fsubs_4 ... ok
+fsubl_1 ... ok
+fsubl_2 ... ok
+fsubl_3 ... ok
+fsubl_4 ... ok
+fsub_1 ... ok
+fsub_2 ... ok
+fsub_3 ... ok
+fsub_4 ... ok
+fsub_5 ... ok
+fsub_6 ... ok
+fsub_7 ... ok
+fsub_8 ... ok
+fsub_9 ... ok
+fsub_10 ... ok
+fsub_11 ... ok
+fsub_12 ... ok
+fsub_13 ... ok
+fsub_14 ... ok
+fsub_15 ... ok
+fsub_16 ... ok
+fsubp_1 ... ok
+fsubp_2 ... ok
+fsubp_3 ... ok
+fsubp_4 ... ok
+fsubp_5 ... ok
+fsubp_6 ... ok
+fsubp_7 ... ok
+fsubp_8 ... ok
+fsubp_9 ... ok
+fsubp_10 ... ok
+fsubp_11 ... ok
+fsubp_12 ... ok
+fsubp_13 ... ok
+fsubp_14 ... ok
+fsubp_15 ... ok
+fsubp_16 ... ok
+fisubs_1 ... ok
+fisubs_2 ... ok
+fisubs_3 ... ok
+fisubs_4 ... ok
+fisubs_5 ... ok
+fisubs_6 ... ok
+fisubs_7 ... ok
+fisubs_8 ... ok
+fisubl_1 ... ok
+fisubl_2 ... ok
+fisubl_3 ... ok
+fisubl_4 ... ok
+fisubl_5 ... ok
+fisubl_6 ... ok
+fisubl_7 ... ok
+fisubl_8 ... ok
+fsubrs_1 ... ok
+fsubrs_2 ... ok
+fsubrs_3 ... ok
+fsubrs_4 ... ok
+fsubrl_1 ... ok
+fsubrl_2 ... ok
+fsubrl_3 ... ok
+fsubrl_4 ... ok
+fsubr_1 ... ok
+fsubr_2 ... ok
+fsubr_3 ... ok
+fsubr_4 ... ok
+fsubr_5 ... ok
+fsubr_6 ... ok
+fsubr_7 ... ok
+fsubr_8 ... ok
+fsubr_9 ... ok
+fsubr_10 ... ok
+fsubr_11 ... ok
+fsubr_12 ... ok
+fsubr_13 ... ok
+fsubr_14 ... ok
+fsubr_15 ... ok
+fsubr_16 ... ok
+fsubrp_1 ... ok
+fsubrp_2 ... ok
+fsubrp_3 ... ok
+fsubrp_4 ... ok
+fsubrp_5 ... ok
+fsubrp_6 ... ok
+fsubrp_7 ... ok
+fsubrp_8 ... ok
+fsubrp_9 ... ok
+fsubrp_10 ... ok
+fsubrp_11 ... ok
+fsubrp_12 ... ok
+fsubrp_13 ... ok
+fsubrp_14 ... ok
+fsubrp_15 ... ok
+fsubrp_16 ... ok
+fisubrs_1 ... ok
+fisubrs_2 ... ok
+fisubrs_3 ... ok
+fisubrs_4 ... ok
+fisubrs_5 ... ok
+fisubrs_6 ... ok
+fisubrs_7 ... ok
+fisubrs_8 ... ok
+fisubrl_1 ... ok
+fisubrl_2 ... ok
+fisubrl_3 ... ok
+fisubrl_4 ... ok
+fisubrl_5 ... ok
+fisubrl_6 ... ok
+fisubrl_7 ... ok
+fisubrl_8 ... ok
+fxch_1 ... ok
+fxch_2 ... ok
Added: trunk/none/tests/amd64/insn_fpu.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/insn_fpu.vgtest 2005-05-12 18:05:00 UTC (rev 3=
686)
+++ trunk/none/tests/amd64/insn_fpu.vgtest 2005-05-12 19:17:36 UTC (rev 3=
687)
@@ -0,0 +1 @@
+prog: insn_fpu
|
|
From: <sv...@va...> - 2005-05-12 18:05:02
|
Author: sewardj
Date: 2005-05-12 19:05:00 +0100 (Thu, 12 May 2005)
New Revision: 3686
Modified:
trunk/memcheck/mc_include.h
trunk/memcheck/mc_main.c
trunk/memcheck/mc_translate.c
Log:
Use the new IRStmt_AbiHints created by the amd64 front end. This
finally makes memcheck able to reliably track the definedness of the
stack on amd64.
Modified: trunk/memcheck/mc_include.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/mc_include.h 2005-05-12 18:02:50 UTC (rev 3685)
+++ trunk/memcheck/mc_include.h 2005-05-12 18:05:00 UTC (rev 3686)
@@ -70,6 +70,8 @@
extern VGA_REGPARM(1) UWord MC_(helperc_LOADV4) ( Addr );
extern VGA_REGPARM(1) ULong MC_(helperc_LOADV8) ( Addr );
=20
+extern void MC_(helperc_MAKE_STACK_UNINIT) ( Addr base, UWord len );
+
/* Functions defined in mc_translate.c */
extern IRBB* MC_(instrument) ( IRBB* bb_in, VexGuestLayout* layout,
IRType gWordTy, IRType hWordTy );
Modified: trunk/memcheck/mc_main.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/mc_main.c 2005-05-12 18:02:50 UTC (rev 3685)
+++ trunk/memcheck/mc_main.c 2005-05-12 18:05:00 UTC (rev 3686)
@@ -909,6 +909,14 @@
);
=20
=20
+void MC_(helperc_MAKE_STACK_UNINIT) ( Addr base, UWord len )
+{
+ tl_assert(sizeof(UWord) =3D=3D sizeof(SizeT));
+ // VG_(printf)("helperc_MAKE_STACK_UNINIT %p %d\n", base, len );
+ mc_make_writable(base, len);
+}
+
+
/*------------------------------------------------------------*/
/*--- Checking memory ---*/
/*------------------------------------------------------------*/
Modified: trunk/memcheck/mc_translate.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/mc_translate.c 2005-05-12 18:02:50 UTC (rev 3685)
+++ trunk/memcheck/mc_translate.c 2005-05-12 18:05:00 UTC (rev 3686)
@@ -2404,7 +2404,27 @@
=20
}
=20
+/* We have an ABI hint telling us that [base .. base+len-1] is to
+ become undefined ("writable"). Generate code to call a helper to
+ notify the A/V bit machinery of this fact.
=20
+ We call=20
+ void MC_(helperc_MAKE_STACK_UNINIT) ( Addr base, UWord len );
+*/
+static
+void do_AbiHint ( MCEnv* mce, IRExpr* base, Int len )
+{
+ IRDirty* di;
+ di =3D unsafeIRDirty_0_N(
+ 0/*regparms*/,
+ "MC_(helperc_MAKE_STACK_UNINIT)",
+ &MC_(helperc_MAKE_STACK_UNINIT),
+ mkIRExprVec_2( base, mkIRExpr_HWord( (UInt)len) )
+ );
+ stmt( mce->bb, IRStmt_Dirty(di) );
+}
+
+
/*------------------------------------------------------------*/
/*--- Memcheck main ---*/
/*------------------------------------------------------------*/
@@ -2493,6 +2513,8 @@
|| isBogusAtom(st->Ist.STle.data);
case Ist_Exit:
return isBogusAtom(st->Ist.Exit.guard);
+ case Ist_AbiHint:
+ return isBogusAtom(st->Ist.AbiHint.base);
case Ist_NoOp:
case Ist_IMark:
case Ist_MFence:
@@ -2612,6 +2634,10 @@
do_shadow_Dirty( &mce, st->Ist.Dirty.details );
break;
=20
+ case Ist_AbiHint:
+ do_AbiHint( &mce, st->Ist.AbiHint.base, st->Ist.AbiHint.len =
);
+ break;
+
default:
VG_(printf)("\n");
ppIRStmt(st);
|
|
From: <sv...@va...> - 2005-05-12 18:02:52
|
Author: sewardj
Date: 2005-05-12 19:02:50 +0100 (Thu, 12 May 2005)
New Revision: 3685
Modified:
trunk/memcheck/tests/leakotron.c
Log:
64-bit fix.
Modified: trunk/memcheck/tests/leakotron.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/leakotron.c 2005-05-12 18:02:01 UTC (rev 3684)
+++ trunk/memcheck/tests/leakotron.c 2005-05-12 18:02:50 UTC (rev 3685)
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
+#include <assert.h>
#include "../memcheck.h"
=20
/*=20
@@ -94,9 +95,13 @@
int main()
{
int i;
- int base_definite, base_dubious, base_reachable, base_suppressed;
- int definite, dubious, reachable, suppressed, total;
+ long base_definite, base_dubious, base_reachable, base_suppressed;
+ long definite, dubious, reachable, suppressed;
+ int total;
=20
+ /* we require these longs to have same size as a machine word */
+ assert(sizeof(long) =3D=3D sizeof(void*));
+
/* get a baseline in case the runtime allocated some memory */
VALGRIND_DO_LEAK_CHECK;
base_definite =3D base_dubious =3D base_reachable =3D base_suppressed =3D=
0;
@@ -139,12 +144,12 @@
=20
if (0)
printf("leaks: definite %d, dubious %d, reachable %d, suppressed %d =3D=
%d\n",
- definite, dubious, reachable, suppressed, total);
+ (int)definite, (int)dubious, (int)reachable, (int)suppressed, t=
otal);
=20
if (reachable !=3D 0)
printf("FAILED: I freed everything, "
"but there's still %d bytes reachable\n",=20
- reachable);
+ (int)reachable);
else if (total !=3D bytes)
printf("FAILED: I count %d bytes, leakcheck says %d\n",
bytes, total);
|
|
From: <sv...@va...> - 2005-05-12 18:02:03
|
Author: sewardj Date: 2005-05-12 19:02:01 +0100 (Thu, 12 May 2005) New Revision: 3684 Added: trunk/memcheck/tests/fwrite.stderr.exp2 Modified: trunk/memcheck/tests/Makefile.am Log: Another expected output file. Modified: trunk/memcheck/tests/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/Makefile.am 2005-05-12 18:01:15 UTC (rev 3683) +++ trunk/memcheck/tests/Makefile.am 2005-05-12 18:02:01 UTC (rev 3684) @@ -29,7 +29,7 @@ execve.stderr.exp execve.vgtest \ execve2.stderr.exp execve2.vgtest \ fprw.stderr.exp fprw.vgtest \ - fwrite.stderr.exp fwrite.stdout.exp fwrite.vgtest \ + fwrite.stderr.exp fwrite.stderr.exp2 fwrite.stdout.exp fwrite.vgtest \ inits.stderr.exp inits.vgtest \ inline.stderr.exp inline.stdout.exp inline.vgtest \ leak-0.vgtest leak-0.stderr.exp \ Added: trunk/memcheck/tests/fwrite.stderr.exp2 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/fwrite.stderr.exp2 2005-05-12 18:01:15 UTC (rev = 3683) +++ trunk/memcheck/tests/fwrite.stderr.exp2 2005-05-12 18:02:01 UTC (rev = 3684) @@ -0,0 +1,6 @@ +Syscall param write(buf) points to uninitialised byte(s) + at 0x........: write (in /...libc...) + by 0x........: main (fwrite.c:7) + Address 0x........ is 0 bytes inside a block of size 10 alloc'd + at 0x........: malloc (vg_replace_malloc.c:...) + by 0x........: main (fwrite.c:6) |
|
From: <sv...@va...> - 2005-05-12 18:01:16
|
Author: sewardj
Date: 2005-05-12 19:01:15 +0100 (Thu, 12 May 2005)
New Revision: 3683
Modified:
trunk/memcheck/tests/error_counts.c
Log:
64-bit fixes.
Modified: trunk/memcheck/tests/error_counts.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/error_counts.c 2005-05-12 18:00:12 UTC (rev 3682=
)
+++ trunk/memcheck/tests/error_counts.c 2005-05-12 18:01:15 UTC (rev 3683=
)
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
+#include <assert.h>
#include "../memcheck.h"
=20
int main(void)
@@ -14,6 +15,9 @@
int n_leaked =3D 0;
int n_suppressed =3D 0;
=20
+ /* we require these longs to have same size as a machine word */
+ assert(sizeof(long) =3D=3D sizeof(void*));
+
/* Error counting */
printf("errors: %d\n", VALGRIND_COUNT_ERRORS);
=20
|
|
From: <sv...@va...> - 2005-05-12 18:00:14
|
Author: sewardj
Date: 2005-05-12 19:00:12 +0100 (Thu, 12 May 2005)
New Revision: 3682
Modified:
trunk/glibc-2.3.supp
trunk/xfree-4.supp
Log:
* move libc-specific suppressions into glibc-2.3.supp
* enhance the xfree suppressions so they match 64-bit X libraries
Modified: trunk/glibc-2.3.supp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/glibc-2.3.supp 2005-05-12 17:58:57 UTC (rev 3681)
+++ trunk/glibc-2.3.supp 2005-05-12 18:00:12 UTC (rev 3682)
@@ -381,3 +381,79 @@
fun:__pthread_initialize_minimal
obj:/lib64/tls/libpthread*.so*
}
+
+
+
+##----------------------------------------------------------------------=
##
+# Hacks pertaining to the fact that our intercept mechanism can't
+# always get hold of strlen early enough, due to idiocy in the low
+# level memory manager.
+
+## HACK to do with strlen not being intercepted early enough
+{
+ strlen-not-intercepted-early-enough-HACK-1
+ Memcheck:Addr4
+ fun:strlen
+ fun:_dl_map_object_from_fd
+ fun:_dl_map_object
+}
+
+{
+ strlen-not-intercepted-early-enough-HACK-2
+ Memcheck:Addr4
+ fun:strlen
+ fun:decompose_rpath
+ fun:cache_rpath
+ fun:_dl_map_object
+}
+
+{
+ strlen-not-intercepted-early-enough-HACK-3
+ Memcheck:Cond
+ fun:strlen
+ fun:_dl_new_object
+ fun:_dl_map_object_from_fd
+ fun:_dl_map_object
+}
+
+{
+ strlen-not-intercepted-early-enough-HACK-4
+ Memcheck:Cond
+ fun:strlen
+ fun:expand_dynamic_string_token
+ fun:_dl_map_object
+}
+
+{
+ strlen-not-intercepted-early-enough-HACK-5
+ Memcheck:Cond
+ fun:strlen
+ fun:fillin_rpath
+ fun:_dl_init_paths
+}
+
+
+## HACK to do with index not being intercepted early enough
+{
+ index-not-intercepted-early-enough-HACK-1
+ Memcheck:Cond
+ fun:index
+ fun:expand_dynamic_string_token
+ fun:_dl_map_object
+}
+{
+ index-not-intercepted-early-enough-HACK-2
+ Memcheck:Cond
+ fun:index
+ fun:_dl_map_object
+ fun:map_doit
+ fun:_dl_catch_error
+}
+{
+ index-not-intercepted-early-enough-HACK-3
+ Memcheck:Cond
+ fun:index
+ fun:_dl_map_object
+ fun:dl_main
+ fun:_dl_sysdep_start
+}
Modified: trunk/xfree-4.supp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xfree-4.supp 2005-05-12 17:58:57 UTC (rev 3681)
+++ trunk/xfree-4.supp 2005-05-12 18:00:12 UTC (rev 3682)
@@ -30,89 +30,89 @@
Addrcheck,Memcheck:Param
write(buf)
fun:*libc_write
- obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libX11.so.6.2
fun:*X11TransWrite
}
=20
{
libX11.so.6.2/libX11.so.6.2/libX11.so.6.2(Cond)
Memcheck:Cond
- obj:/usr/X11R6/lib/libX11.so.6.2
- obj:/usr/X11R6/lib/libX11.so.6.2
- obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libX11.so.6.2
}
=20
{
libXt.so.6.2/libXt.so.6.2/libXt.so.6.2(Cond)
Memcheck:Cond
- obj:/usr/X11R6/lib/libXt.so.6.0
- obj:/usr/X11R6/lib/libXt.so.6.0
- obj:/usr/X11R6/lib/libXt.so.6.0
+ obj:/usr/X11R6/lib*/libXt.so.6.0
+ obj:/usr/X11R6/lib*/libXt.so.6.0
+ obj:/usr/X11R6/lib*/libXt.so.6.0
}
=20
=20
{
libXaw.so.7.0/libXaw.so.7.0/libXaw.so.7.0(Cond)
Memcheck:Cond
- obj:/usr/X11R6/lib/libXaw.so.7.0
- obj:/usr/X11R6/lib/libXaw.so.7.0
- obj:/usr/X11R6/lib/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
}
=20
{
libXmu.so.6.2/libXmu.so.6.2/libXmu.so.6.2(Cond)
Memcheck:Cond
- obj:/usr/X11R6/lib/libXmu.so.6.2
- obj:/usr/X11R6/lib/libXmu.so.6.2
- obj:/usr/X11R6/lib/libXmu.so.6.2
+ obj:/usr/X11R6/lib*/libXmu.so.6.2
+ obj:/usr/X11R6/lib*/libXmu.so.6.2
+ obj:/usr/X11R6/lib*/libXmu.so.6.2
}
=20
{
libXt.so.6.0/libXt.so.6.0/libXaw.so.7.0(Cond)
Memcheck:Cond
- obj:/usr/X11R6/lib/libXt.so.6.0
- obj:/usr/X11R6/lib/libXt.so.6.0
- obj:/usr/X11R6/lib/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libXt.so.6.0
+ obj:/usr/X11R6/lib*/libXt.so.6.0
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
}
=20
{
libXaw.so.7.0/libXaw.so.7.0/libXt.so.6.0(Value4)
Memcheck:Value4
- obj:/usr/X11R6/lib/libXaw.so.7.0
- obj:/usr/X11R6/lib/libXaw.so.7.0
- obj:/usr/X11R6/lib/libXt.so.6.0
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libXt.so.6.0
}
=20
{
libXaw.so.7.0/libXaw.so.7.0/libXt.so.6.0(Cond)
Memcheck:Cond
- obj:/usr/X11R6/lib/libXaw.so.7.0
- obj:/usr/X11R6/lib/libXaw.so.7.0
- obj:/usr/X11R6/lib/libXt.so.6.0
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libXt.so.6.0
}
=20
{
libX11.so.6.2/libX11.so.6.2/libXaw.so.7.0(Cond)
Memcheck:Cond
- obj:/usr/X11R6/lib/libX11.so.6.2
- obj:/usr/X11R6/lib/libX11.so.6.2
- obj:/usr/X11R6/lib/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
}
=20
{
libX11.so.6.2/libXaw.so.7.0/libXaw.so.7.0(Cond)
Memcheck:Cond
- obj:/usr/X11R6/lib/libX11.so.6.2
- obj:/usr/X11R6/lib/libXaw.so.7.0
- obj:/usr/X11R6/lib/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
+ obj:/usr/X11R6/lib*/libXaw.so.7.0
}
=20
{
libXpm.so.4.11/libXpm.so.4.11/libXpm.so.4.11
Memcheck:Cond
- obj:/usr/X11R6/lib/libXpm.so.4.11
- obj:/usr/X11R6/lib/libXpm.so.4.11
- obj:/usr/X11R6/lib/libXpm.so.4.11
+ obj:/usr/X11R6/lib*/libXpm.so.4.11
+ obj:/usr/X11R6/lib*/libXpm.so.4.11
+ obj:/usr/X11R6/lib*/libXpm.so.4.11
}
=20
{
@@ -141,7 +141,7 @@
write(buf)
fun:*
fun:_X11TransWrite
- obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libX11.so.6.2
}
=20
{
@@ -150,7 +150,7 @@
write(buf)
fun:write
fun:_X11TransWrite
- obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libX11.so.6.2
}
=20
{
@@ -178,73 +178,10 @@
Memcheck:Param
writev(vector[...])
fun:writev
- obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib*/libX11.so.6.2
fun:_X11TransWritev
fun:_XSend
}
=20
-##
-## HACK to do with strlen not being intercepted early enough
-{
- strlen-not-intercepted-early-enough-HACK-1
- Memcheck:Addr4
- fun:strlen
- fun:_dl_map_object_from_fd
- fun:_dl_map_object
-}
-
-{
- strlen-not-intercepted-early-enough-HACK-2
- Memcheck:Addr4
- fun:strlen
- fun:decompose_rpath
- fun:cache_rpath
- fun:_dl_map_object
-}
-
-{
- strlen-not-intercepted-early-enough-HACK-3
- Memcheck:Cond
- fun:strlen
- fun:_dl_new_object
- fun:_dl_map_object_from_fd
- fun:_dl_map_object
-}
-
-{
- strlen-not-intercepted-early-enough-HACK-4
- Memcheck:Cond
- fun:strlen
- fun:expand_dynamic_string_token
- fun:_dl_map_object
- fun:map_doit
-}
-
-## HACK to do with index not being intercepted early enough
-{
- index-not-intercepted-early-enough-HACK-1
- Memcheck:Cond
- fun:index
- fun:expand_dynamic_string_token
- fun:_dl_map_object
- fun:map_doit
-}
-{
- index-not-intercepted-early-enough-HACK-2
- Memcheck:Cond
- fun:index
- fun:_dl_map_object
- fun:map_doit
- fun:_dl_catch_error
-}
-{
- index-not-intercepted-early-enough-HACK-3
- Memcheck:Cond
- fun:index
- fun:_dl_map_object
- fun:dl_main
- fun:_dl_sysdep_start
-}
-
##----------------------------------------------------------------------=
##
=20
|
|
From: <sv...@va...> - 2005-05-12 17:59:12
|
Author: sewardj
Date: 2005-05-12 18:58:57 +0100 (Thu, 12 May 2005)
New Revision: 3681
Modified:
trunk/coregrind/vg_redir.c
Log:
Intercept yet more functions on amd64.
Modified: trunk/coregrind/vg_redir.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/coregrind/vg_redir.c 2005-05-12 17:58:28 UTC (rev 3680)
+++ trunk/coregrind/vg_redir.c 2005-05-12 17:58:57 UTC (rev 3681)
@@ -457,7 +457,12 @@
/* apparently index is the same thing as strchr */
add_redirect_sym_to_sym("soname:libc.so.6", "index",
"*vgpreload_memcheck.so*", "strchr");
+ add_redirect_sym_to_sym("soname:ld-linux-x86-64.so.2", "index",
+ "*vgpreload_memcheck.so*", "strchr");
=20
+ add_redirect_sym_to_sym("soname:libc.so.6", "strcpy",
+ "*vgpreload_memcheck.so*", "strcpy");
+
add_redirect_sym_to_sym("soname:ld-linux-x86-64.so.2", "strcmp",
"*vgpreload_memcheck.so*", "strcmp");
add_redirect_sym_to_sym("soname:libc.so.6", "strcmp",
|
|
From: <sv...@va...> - 2005-05-12 17:58:30
|
Author: sewardj
Date: 2005-05-12 18:58:28 +0100 (Thu, 12 May 2005)
New Revision: 3680
Modified:
trunk/memcheck/mac_replace_strmem.c
Log:
memmove on glibc on amd64 is over-optimised; replace it.
Modified: trunk/memcheck/mac_replace_strmem.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/mac_replace_strmem.c 2005-05-12 17:57:14 UTC (rev 3679=
)
+++ trunk/memcheck/mac_replace_strmem.c 2005-05-12 17:58:28 UTC (rev 3680=
)
@@ -362,7 +362,24 @@
return s;
}
=20
+DECL( void *memmove(void *dstV, const void *srcV, SizeT n) )
+{
+ SizeT i;
+ Char* dst =3D (Char*)dstV;
+ Char* src =3D (Char*)srcV;
+ if (dst < src) {
+ for (i =3D 0; i < n; i++)
+ dst[i] =3D src[i];
+ }
+ else=20
+ if (dst > src) {
+ for (i =3D 0; i < n; i++)
+ dst[n-i-1] =3D src[n-i-1];
+ }
+ return dst;
+}
=20
+
/* Find the first occurrence of C in S or the final NUL byte. */
=20
DECL( char* glibc232_strchrnul (const char* s, int c_in) )
|
|
From: <sv...@va...> - 2005-05-12 17:57:17
|
Author: sewardj
Date: 2005-05-12 18:57:14 +0100 (Thu, 12 May 2005)
New Revision: 3679
Modified:
trunk/cachegrind/cg_main.c
Log:
Handle (ignore) IRStmt_AbiHint.
Modified: trunk/cachegrind/cg_main.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/cachegrind/cg_main.c 2005-05-12 13:45:56 UTC (rev 3678)
+++ trunk/cachegrind/cg_main.c 2005-05-12 17:57:14 UTC (rev 3679)
@@ -397,6 +397,10 @@
case Ist_NoOp:
break;
=20
+ case Ist_AbiHint:
+ /* ABI hints aren't interesting to cachegrind. Ignore. */
+ break;
+
case Ist_IMark:
/* st->Ist.IMark.addr is a 64-bit int. ULong_to_Ptr casts this
to the host's native pointer type; if that is 32 bits then it
|
|
From: <sv...@va...> - 2005-05-12 17:55:04
|
Author: sewardj
Date: 2005-05-12 18:55:01 +0100 (Thu, 12 May 2005)
New Revision: 1193
Modified:
trunk/priv/guest-amd64/toIR.c
trunk/priv/host-amd64/isel.c
trunk/priv/ir/irdefs.c
trunk/priv/ir/iropt.c
trunk/pub/libvex_ir.h
Log:
Add the beginnings of what might be a general mechanism to pass
ABI-specific knowledge through the IR compilation pipeline. This
entails a new IR construction, AbiHint.
Currently there is only one kind of hint, and it is generated by the
amd64 front end. This tells whoever wants to know that a function
call or return has happened, and so the 128 bytes below %rsp should be
considered undefined.
Modified: trunk/priv/guest-amd64/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-amd64/toIR.c 2005-05-12 02:14:52 UTC (rev 1192)
+++ trunk/priv/guest-amd64/toIR.c 2005-05-12 17:55:01 UTC (rev 1193)
@@ -2077,7 +2077,21 @@
}
}
=20
+/* Let new_rsp be the %rsp value after a call/return. This function
+ generates an AbiHint to say that -128(%rsp) .. -1(%rsp) should now
+ be regarded as uninitialised.
+*/
+static void make_redzone_AbiHint ( IRTemp new_rsp, HChar* who )
+{
+ if (0) vex_printf("AbiHint: %s\n", who);
+ vassert(typeOfIRTemp(irbb->tyenv, new_rsp) =3D=3D Ity_I64);
+ stmt( IRStmt_AbiHint(=20
+ binop(Iop_Sub64, mkexpr(new_rsp), mkU64(128)),=20
+ 128=20
+ ));
+}
=20
+
/*------------------------------------------------------------*/
/*--- Disassembling addressing modes ---*/
/*------------------------------------------------------------*/
@@ -3758,6 +3772,7 @@
assign(t2, binop(Iop_Sub64, getIReg64(R_RSP), mkU64(8)));
putIReg64(R_RSP, mkexpr(t2));
storeLE( mkexpr(t2), mkU64(guest_rip_bbstart+delta+1));
+ make_redzone_AbiHint(t2, "call-Ev(reg)");
jmp_treg(Ijk_Call,t3);
*whatNext =3D Dis_StopHere;
showSz =3D False;
@@ -3812,6 +3827,7 @@
assign(t2, binop(Iop_Sub64, getIReg64(R_RSP), mkU64(8)));
putIReg64(R_RSP, mkexpr(t2));
storeLE( mkexpr(t2), mkU64(guest_rip_bbstart+delta+len));
+ make_redzone_AbiHint(t2, "call-Ev(mem)");
jmp_treg(Ijk_Call,t3);
*whatNext =3D Dis_StopHere;
showSz =3D False;
@@ -7266,9 +7282,12 @@
{
IRTemp t1 =3D newTemp(Ity_I64);=20
IRTemp t2 =3D newTemp(Ity_I64);
+ IRTemp t3 =3D newTemp(Ity_I64);
assign(t1, getIReg64(R_RSP));
assign(t2, loadLE(Ity_I64,mkexpr(t1)));
- putIReg64(R_RSP, binop(Iop_Add64, mkexpr(t1), mkU64(8+d64)));
+ assign(t3, binop(Iop_Add64, mkexpr(t1), mkU64(8+d64)));
+ putIReg64(R_RSP, mkexpr(t3));
+ make_redzone_AbiHint(t3, "ret");
jmp_treg(Ijk_Ret,t2);
}
=20
@@ -11490,6 +11509,7 @@
assign(t1, binop(Iop_Sub64, getIReg64(R_RSP), mkU64(8)));
putIReg64(R_RSP, mkexpr(t1));
storeLE( mkexpr(t1), mkU64(guest_rip_bbstart+delta));
+ make_redzone_AbiHint(t1, "call-d32");
if (resteerOK && resteerOkFn((Addr64)d64)) {
/* follow into the call target. */
whatNext =3D Dis_Resteer;
Modified: trunk/priv/host-amd64/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-amd64/isel.c 2005-05-12 02:14:52 UTC (rev 1192)
+++ trunk/priv/host-amd64/isel.c 2005-05-12 17:55:01 UTC (rev 1193)
@@ -3696,6 +3696,12 @@
case Ist_IMark:
return;
=20
+ /* --------- ABI HINT --------- */
+ /* These have no meaning (denotation in the IR) and so we ignore
+ them ... if any actually made it this far. */
+ case Ist_AbiHint:
+ return;
+
/* --------- NO-OP --------- */
case Ist_NoOp:
return;
Modified: trunk/priv/ir/irdefs.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/ir/irdefs.c 2005-05-12 02:14:52 UTC (rev 1192)
+++ trunk/priv/ir/irdefs.c 2005-05-12 17:55:01 UTC (rev 1193)
@@ -613,6 +613,11 @@
vex_printf( "------ IMark(0x%llx, %d) ------",=20
s->Ist.IMark.addr, s->Ist.IMark.len);
break;
+ case Ist_AbiHint:
+ vex_printf("=3D=3D=3D=3D=3D=3D AbiHint(");
+ ppIRExpr(s->Ist.AbiHint.base);
+ vex_printf(", %d) =3D=3D=3D=3D=3D=3D", s->Ist.AbiHint.len);
+ break;
case Ist_Put:
vex_printf( "PUT(%d) =3D ", s->Ist.Put.offset);
ppIRExpr(s->Ist.Put.data);
@@ -948,6 +953,13 @@
s->Ist.IMark.len =3D len;
return s;
}
+IRStmt* IRStmt_AbiHint ( IRExpr* base, Int len ) {
+ IRStmt* s =3D LibVEX_Alloc(sizeof(IRStmt));
+ s->tag =3D Ist_AbiHint;
+ s->Ist.AbiHint.base =3D base;
+ s->Ist.AbiHint.len =3D len;
+ return s;
+}
IRStmt* IRStmt_Put ( Int off, IRExpr* data ) {
IRStmt* s =3D LibVEX_Alloc(sizeof(IRStmt));
s->tag =3D Ist_Put;
@@ -1153,6 +1165,9 @@
switch (s->tag) {
case Ist_NoOp:
return IRStmt_NoOp();
+ case Ist_AbiHint:
+ return IRStmt_AbiHint(dopyIRExpr(s->Ist.AbiHint.base),
+ s->Ist.AbiHint.len);
case Ist_IMark:
return IRStmt_IMark(s->Ist.IMark.addr, s->Ist.IMark.len);
case Ist_Put:=20
@@ -1648,6 +1663,8 @@
IRDirty* di;
=20
switch (st->tag) {
+ case Ist_AbiHint:
+ return isIRAtom(st->Ist.AbiHint.base);
case Ist_Put:
return isIRAtom(st->Ist.Put.data);
case Ist_PutI:
@@ -1835,6 +1852,9 @@
switch (stmt->tag) {
case Ist_IMark:
break;
+ case Ist_AbiHint:
+ useBeforeDef_Expr(bb,stmt,stmt->Ist.AbiHint.base,def_counts);
+ break;
case Ist_Put:
useBeforeDef_Expr(bb,stmt,stmt->Ist.Put.data,def_counts);
break;
@@ -1982,6 +2002,11 @@
if (stmt->Ist.IMark.len < 0 || stmt->Ist.IMark.len > 20)
sanityCheckFail(bb,stmt,"IRStmt.IMark.len: implausible");
break;
+ case Ist_AbiHint:
+ if (typeOfIRExpr(tyenv, stmt->Ist.AbiHint.base) !=3D gWordTy)
+ sanityCheckFail(bb,stmt,"IRStmt.AbiHint.base: "
+ "not :: guest word type");
+ break;
case Ist_Put:
tcExpr( bb, stmt, stmt->Ist.Put.data, gWordTy );
if (typeOfIRExpr(tyenv,stmt->Ist.Put.data) =3D=3D Ity_I1)
Modified: trunk/priv/ir/iropt.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/ir/iropt.c 2005-05-12 02:14:52 UTC (rev 1192)
+++ trunk/priv/ir/iropt.c 2005-05-12 17:55:01 UTC (rev 1193)
@@ -414,6 +414,10 @@
case Ist_IMark:
addStmtToIRBB(bb, st);
break;
+ case Ist_AbiHint:
+ e1 =3D flatten_Expr(bb, st->Ist.AbiHint.base);
+ addStmtToIRBB(bb, IRStmt_AbiHint(e1, st->Ist.AbiHint.len));
+ break;
case Ist_Exit:
e1 =3D flatten_Expr(bb, st->Ist.Exit.guard);
addStmtToIRBB(bb, IRStmt_Exit(e1, st->Ist.Exit.jk,
@@ -671,7 +675,10 @@
crude solution is just to flush everything; we could easily
enough do a lot better if needed. */
/* Probably also overly-conservative, but also dump everything
- if we hit a memory fence. */
+ if we hit a memory fence. Ditto AbiHints.*/
+ case Ist_AbiHint:
+ vassert(isIRAtom(st->Ist.AbiHint.base));
+ /* fall through */
case Ist_MFence:
case Ist_Dirty:
for (j =3D 0; j < env->used; j++)
@@ -1507,6 +1514,12 @@
# endif
=20
switch (st->tag) {
+ case Ist_AbiHint:
+ vassert(isIRAtom(st->Ist.AbiHint.base));
+ return IRStmt_AbiHint(
+ fold_Expr(subst_Expr(env, st->Ist.AbiHint.base)),
+ st->Ist.AbiHint.len
+ );
case Ist_Put:
vassert(isIRAtom(st->Ist.Put.data));
return IRStmt_Put(
@@ -1732,6 +1745,9 @@
Int i;
IRDirty* d;
switch (st->tag) {
+ case Ist_AbiHint:
+ addUses_Expr(set, st->Ist.AbiHint.base);
+ return;
case Ist_PutI:
addUses_Expr(set, st->Ist.PutI.ix);
addUses_Expr(set, st->Ist.PutI.data);
@@ -2573,7 +2589,8 @@
return False;
=20
case Ist_MFence:
- /* just be paranoid ... this should be rare. */
+ case Ist_AbiHint:
+ /* just be paranoid ... these should be rare. */
return True;
=20
case Ist_Dirty:
@@ -2804,6 +2821,9 @@
case Ist_NoOp:
case Ist_IMark:
break;
+ case Ist_AbiHint:
+ deltaIRExpr(st->Ist.AbiHint.base, delta);
+ break;
case Ist_Put:
deltaIRExpr(st->Ist.Put.data, delta);
break;
@@ -3166,6 +3186,9 @@
Int i;
IRDirty* d;
switch (st->tag) {
+ case Ist_AbiHint:
+ occCount_Expr(env, st->Ist.AbiHint.base);
+ return;
case Ist_Tmp:=20
occCount_Expr(env, st->Ist.Tmp.data);=20
return;=20
@@ -3293,6 +3316,11 @@
IRDirty* d;
IRDirty* d2;
switch (st->tag) {
+ case Ist_AbiHint:
+ return IRStmt_AbiHint(
+ tbSubst_Expr(env, st->Ist.AbiHint.base),
+ st->Ist.AbiHint.len
+ );
case Ist_STle:
return IRStmt_STle(
tbSubst_Expr(env, st->Ist.STle.addr),
@@ -3580,6 +3608,8 @@
computation prior to it is forced to complete before
proceeding with the fence. */
|| st->tag =3D=3D Ist_MFence
+ /* also be (probably overly) paranoid re AbiHints */
+ || st->tag =3D=3D Ist_AbiHint
);
/*
if (ti->invalidateMe)
@@ -3691,6 +3721,9 @@
for (i =3D 0; i < bb->stmts_used; i++) {
st =3D bb->stmts[i];
switch (st->tag) {
+ case Ist_AbiHint:
+ vassert(isIRAtom(st->Ist.AbiHint.base));
+ break;
case Ist_PutI:=20
return True;
case Ist_Tmp: =20
Modified: trunk/pub/libvex_ir.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/pub/libvex_ir.h 2005-05-12 02:14:52 UTC (rev 1192)
+++ trunk/pub/libvex_ir.h 2005-05-12 17:55:01 UTC (rev 1193)
@@ -896,19 +896,32 @@
=20
/* ------------------ Statements ------------------ */
=20
-/* The possible kinds of statements are as follows: */
+/* The possible kinds of statements are as follows. Those marked
+ OPTIONAL are hints of one kind or another, and as such do not
+ denote any change in the guest state or of IR temporaries. They
+ can therefore be omitted without changing the meaning denoted by
+ the IR.=20
+
+ At the moment, the only AbiHint is one which indicates that a given
+ chunk of address space has become undefined. This is used on
+ amd64-linux to pass stack-redzoning hints to whoever wants to see
+ them.
+*/
typedef=20
enum {
- Ist_NoOp, /* no-op (usually resulting from IR optimisation) */
- Ist_IMark, /* instruction mark: describe addr/len of guest insn
- whose IR follows */
- Ist_Put, /* write guest state, fixed offset */
- Ist_PutI, /* write guest state, run-time offset */
- Ist_Tmp, /* assign value to temporary */
- Ist_STle, /* little-endian write to memory */
- Ist_Dirty, /* call complex ("dirty") helper function */
- Ist_MFence, /* memory fence */
- Ist_Exit /* conditional exit from BB */
+ Ist_NoOp, /* OPTIONAL: no-op (usually resulting from IR
+ optimisation) */
+ Ist_IMark, /* OPTIONAL: instruction mark: describe addr/len of
+ guest insn whose IR follows. */
+ Ist_AbiHint, /* OPTIONAL: tell me something about this
+ platform's ABI */
+ Ist_Put, /* write guest state, fixed offset */
+ Ist_PutI, /* write guest state, run-time offset */
+ Ist_Tmp, /* assign value to temporary */
+ Ist_STle, /* little-endian write to memory */
+ Ist_Dirty, /* call complex ("dirty") helper function */
+ Ist_MFence, /* memory fence */
+ Ist_Exit /* conditional exit from BB */
}=20
IRStmtTag;
=20
@@ -923,6 +936,11 @@
Int len;
} IMark;
struct {
+ /* [base .. base+len-1] has become uninitialised */
+ IRExpr* base;
+ Int len;
+ } AbiHint;
+ struct {
Int offset;
IRExpr* data;
} Put;
@@ -954,16 +972,17 @@
}
IRStmt;
=20
-extern IRStmt* IRStmt_NoOp ( void );
-extern IRStmt* IRStmt_IMark ( Addr64 addr, Int len );
-extern IRStmt* IRStmt_Put ( Int off, IRExpr* data );
-extern IRStmt* IRStmt_PutI ( IRArray* descr, IRExpr* ix, Int bias,=20
- IRExpr* data );
-extern IRStmt* IRStmt_Tmp ( IRTemp tmp, IRExpr* data );
-extern IRStmt* IRStmt_STle ( IRExpr* addr, IRExpr* data );
-extern IRStmt* IRStmt_Dirty ( IRDirty* details );
-extern IRStmt* IRStmt_MFence ( void );
-extern IRStmt* IRStmt_Exit ( IRExpr* guard, IRJumpKind jk, IRConst* ds=
t );
+extern IRStmt* IRStmt_NoOp ( void );
+extern IRStmt* IRStmt_IMark ( Addr64 addr, Int len );
+extern IRStmt* IRStmt_AbiHint ( IRExpr* base, Int len );
+extern IRStmt* IRStmt_Put ( Int off, IRExpr* data );
+extern IRStmt* IRStmt_PutI ( IRArray* descr, IRExpr* ix, Int bias,=20
+ IRExpr* data );
+extern IRStmt* IRStmt_Tmp ( IRTemp tmp, IRExpr* data );
+extern IRStmt* IRStmt_STle ( IRExpr* addr, IRExpr* data );
+extern IRStmt* IRStmt_Dirty ( IRDirty* details );
+extern IRStmt* IRStmt_MFence ( void );
+extern IRStmt* IRStmt_Exit ( IRExpr* guard, IRJumpKind jk, IRConst* d=
st );
=20
extern IRStmt* dopyIRStmt ( IRStmt* );
=20
|
|
From: <sv...@va...> - 2005-05-12 13:46:26
|
Author: njn
Date: 2005-05-12 14:46:24 +0100 (Thu, 12 May 2005)
New Revision: 117
Modified:
trunk/docs/FAQ/faq.unexpected.html
Log:
Update FAQ about GLIBCXX_FORCE_NEW name-change.
Modified: trunk/docs/FAQ/faq.unexpected.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/docs/FAQ/faq.unexpected.html 2005-05-10 13:04:23 UTC (rev 116)
+++ trunk/docs/FAQ/faq.unexpected.html 2005-05-12 13:46:24 UTC (rev 117)
@@ -129,9 +129,11 @@
<li><p>With gcc 2.91, 2.95, 3.0 and 3.1, compile all source
using the STL with <tt class=3D"literal">-D__USE_MALLOC</tt>. Beware=
!
This is removed from gcc starting with version 3.3.</p></li>
-<li><p>With 3.2.2 and later, you should export the environment
+<li><p>With gcc 3.2.2 and later, you should export the environment
variable <tt class=3D"literal">GLIBCPP_FORCE_NEW</tt> before running
your program.</p></li>
+<li><p>With gcc 3.4 and later, that variable has changed name to
+ <tt class=3D"literal">GLIBCXX_FORCE_NEW</tt>.</p></li>
</ul></div>
<p>There are other ways to disable memory pooling: using the
<tt class=3D"literal">malloc_alloc</tt> template with your objects (no=
t
|
|
From: <sv...@va...> - 2005-05-12 13:46:02
|
Author: njn
Date: 2005-05-12 14:45:56 +0100 (Thu, 12 May 2005)
New Revision: 3678
Modified:
trunk/FAQ.txt
trunk/docs/xml/FAQ.xml
Log:
Update FAQ about GLIBCXX_FORCE_NEW name-change.
Modified: trunk/FAQ.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/FAQ.txt 2005-05-12 13:15:38 UTC (rev 3677)
+++ trunk/FAQ.txt 2005-05-12 13:45:56 UTC (rev 3678)
@@ -169,9 +169,12 @@
with -D__USE_MALLOC. Beware! This is removed from gcc starting with
version 3.3.
=20
-- With 3.2.2 and later, you should export the environment variable
+- With gcc 3.2.2 and later, you should export the environment variable
GLIBCPP_FORCE_NEW before running your program.
=20
+- With gcc 3.4 and later, that variable has changed name to
+ GLIBCXX_FORCE_NEW.
+
There are other ways to disable memory pooling: using the malloc_alloc
template with your objects (not portable, but should work for gcc) or
even writing your own memory allocators. But all this goes beyond the
Modified: trunk/docs/xml/FAQ.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/docs/xml/FAQ.xml 2005-05-12 13:15:38 UTC (rev 3677)
+++ trunk/docs/xml/FAQ.xml 2005-05-12 13:45:56 UTC (rev 3678)
@@ -234,10 +234,14 @@
This is removed from gcc starting with version 3.3.</para>
</listitem>
<listitem>
- <para>With 3.2.2 and later, you should export the environment
+ <para>With gcc 3.2.2 and later, you should export the environment
variable <literal>GLIBCPP_FORCE_NEW</literal> before running
your program.</para>
</listitem>
+ <listitem>
+ <para>With gcc 3.4 and later, that variable has changed name to
+ <literal>GLIBCXX_FORCE_NEW</literal>.</para>
+ </listitem>
</itemizedlist>
=20
<para>There are other ways to disable memory pooling: using the
|
|
From: Nicholas N. <nj...@cs...> - 2005-05-12 13:17:03
|
On Thu, 12 May 2005, Julian Seward wrote: > ... is giving build failures on both platforms. > > It's because dispatch-*.S wants to know VG_TRC_INVARIANT_FAILED > et al, but these are now in pub_core_dispatch.h, which it can't > include because that's a for-C include file. Hence link failure: > > m_dispatch/libdispatch.a(dispatch-amd64.o)(.text+0xbd):dispatch-amd64.S:161: > undefined reference to `VG_TRC_INVARIANT_FAILED' > m_dispatch/libdispatch.a(dispatch-amd64.o)(.text+0xe6):dispatch-amd64.S:190: > undefined reference to `VG_TRC_INNER_COUNTERZERO' > m_dispatch/libdispatch.a(dispatch-amd64.o)(.text+0x105):dispatch-amd64.S:202: > undefined reference to `VG_TRC_INNER_FASTMISS' > m_dispatch/libdispatch.a(dispatch-amd64.o)(.text+0x113):dispatch-amd64.S:208: > undefined reference to `VG_TRC_INNER_COUNTERZERO' > > I can kludge around it to keep working. One possibility is to > park those constants -- and those acquired from libvex_trc_values.h > -- into a pub_core_dispatch_asm.h, and include that in the .S files > and also in pub_core_dispatch.h. I haven't done that tho, since > it's a bit inelegant and you might know of a cleaner solution > (although I can't think of one). Ah, sorry. It should be fixed now. I added the _asm.h file as you suggested; I don't know a cleaner approach and it's how we've been handling the problem all along. N |
|
From: <sv...@va...> - 2005-05-12 13:15:43
|
Author: njn
Date: 2005-05-12 14:15:38 +0100 (Thu, 12 May 2005)
New Revision: 3677
Added:
trunk/coregrind/pub_core_dispatch_asm.h
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/m_dispatch/dispatch-amd64.S
trunk/coregrind/m_dispatch/dispatch-arm.S
trunk/coregrind/m_dispatch/dispatch-x86.S
trunk/coregrind/pub_core_dispatch.h
Log:
Unbreak build by moving creating pub_core_dispatch_asm.h for holding
asm-only constants.
Modified: trunk/coregrind/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/coregrind/Makefile.am 2005-05-12 09:04:06 UTC (rev 3676)
+++ trunk/coregrind/Makefile.am 2005-05-12 13:15:38 UTC (rev 3677)
@@ -42,6 +42,7 @@
pub_core_debuglog.h \
pub_core_demangle.h \
pub_core_dispatch.h \
+ pub_core_dispatch_asm.h \
pub_core_errormgr.h \
pub_core_execontext.h \
pub_core_mallocfree.h \
Modified: trunk/coregrind/m_dispatch/dispatch-amd64.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-amd64.S 2005-05-12 09:04:06 UTC (=
rev 3676)
+++ trunk/coregrind/m_dispatch/dispatch-amd64.S 2005-05-12 13:15:38 UTC (=
rev 3677)
@@ -30,6 +30,7 @@
*/
=20
#include "core_asm.h"
+#include "pub_core_dispatch_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_amd64_RIP */
=20
=20
Modified: trunk/coregrind/m_dispatch/dispatch-arm.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-arm.S 2005-05-12 09:04:06 UTC (re=
v 3676)
+++ trunk/coregrind/m_dispatch/dispatch-arm.S 2005-05-12 13:15:38 UTC (re=
v 3677)
@@ -30,6 +30,7 @@
*/
=20
#include "core_asm.h"
+#include "pub_core_dispatch_asm.h"
=20
.globl VG_(run_innerloop)
VG_(run_innerloop):
Modified: trunk/coregrind/m_dispatch/dispatch-x86.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-x86.S 2005-05-12 09:04:06 UTC (re=
v 3676)
+++ trunk/coregrind/m_dispatch/dispatch-x86.S 2005-05-12 13:15:38 UTC (re=
v 3677)
@@ -30,6 +30,7 @@
*/
=20
#include "core_asm.h"
+#include "pub_core_dispatch_asm.h"
#include "libvex_guest_offsets.h" /* for OFFSET_x86_EIP */
=20
=20
Modified: trunk/coregrind/pub_core_dispatch.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/pub_core_dispatch.h 2005-05-12 09:04:06 UTC (rev 3676=
)
+++ trunk/coregrind/pub_core_dispatch.h 2005-05-12 13:15:38 UTC (rev 3677=
)
@@ -39,6 +39,8 @@
// if the current thread has used up its scheduling quantum.
//--------------------------------------------------------------------
=20
+#include "pub_core_dispatch_asm.h"
+
/* This subroutine is called from the C world. It is passed
a pointer to the VEX guest state (arch.vex). It must run code
from the instruction pointer in the guest state, and exit when
@@ -54,22 +56,6 @@
*/
extern UWord VG_(run_innerloop) ( void* guest_state );
=20
-/* Magic values that the guest state might be set to when returning to t=
he
- dispatcher. The only other legitimate value is to point to the
- start of the thread's VEX guest state. These also are return values =
from
- from VG_(run_innerloop) to the scheduler.
-*/
-/* Defines values for JMP_EMWARN, JMP_SYSCALL, JMP_CLIENTREQ and
- JMP_YIELD */
-#include "libvex_trc_values.h"
-
-/* And some more of our own. These must not have the same values as
- those from libvex_trc_values.h. */
-#define VG_TRC_INNER_FASTMISS 37 /* TRC only; means fast-cache miss.=
*/
-#define VG_TRC_INNER_COUNTERZERO 41 /* TRC only; means bb ctr =3D=3D 0 =
*/
-#define VG_TRC_FAULT_SIGNAL 43 /* TRC only; got sigsegv/sigbus */
-#define VG_TRC_INVARIANT_FAILED 47 /* TRC only; invariant violation */
-
#endif // __PUB_CORE_DISPATCH_H
=20
/*--------------------------------------------------------------------*/
Added: trunk/coregrind/pub_core_dispatch_asm.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/pub_core_dispatch_asm.h 2005-05-12 09:04:06 UTC (rev =
3676)
+++ trunk/coregrind/pub_core_dispatch_asm.h 2005-05-12 13:15:38 UTC (rev =
3677)
@@ -0,0 +1,54 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Asm-only dispatcher stuff. pub_core_dispatch_asm.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ 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., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_DISPATCH_ASM_H
+#define __PUB_CORE_DISPATCH_ASM_H
+
+/* Magic values that the guest state might be set to when returning to t=
he
+ dispatcher. The only other legitimate value is to point to the
+ start of the thread's VEX guest state. These also are return values =
from
+ from VG_(run_innerloop) to the scheduler.
+*/
+/* Defines values for JMP_EMWARN, JMP_SYSCALL, JMP_CLIENTREQ and
+ JMP_YIELD */
+#include "libvex_trc_values.h"
+
+/* And some more of our own. These must not have the same values as
+ those from libvex_trc_values.h. */
+#define VG_TRC_INNER_FASTMISS 37 /* TRC only; means fast-cache miss.=
*/
+#define VG_TRC_INNER_COUNTERZERO 41 /* TRC only; means bb ctr =3D=3D 0 =
*/
+#define VG_TRC_FAULT_SIGNAL 43 /* TRC only; got sigsegv/sigbus */
+#define VG_TRC_INVARIANT_FAILED 47 /* TRC only; invariant violation */
+
+#endif // __PUB_CORE_DISPATCH_ASM_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2005-05-12 09:04:08
|
Author: sewardj
Date: 2005-05-12 10:04:06 +0100 (Thu, 12 May 2005)
New Revision: 3676
Modified:
trunk/memcheck/mac_leakcheck.c
Log:
When constructing a LeakErr, the (Char*) .string field is abused to
carry an Int. This is confusing but works on 32-bit platforms; on
64-bit ones, gcc complains about the cast. This commit adds another
kludge to keep gcc quiet. Really this should be fixed properly. The
casting-abuse is 'undone' in case LeakErr in MAC_(pp_Shared_Error).
This should really be fixed properly. If this .string isn't always
a string, perhaps it should be renamed 'auxword' and turned into a
UWord which is guaranteed castable to/from pointer on any platform.
=20
Modified: trunk/memcheck/mac_leakcheck.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/mac_leakcheck.c 2005-05-12 08:27:04 UTC (rev 3675)
+++ trunk/memcheck/mac_leakcheck.c 2005-05-12 09:04:06 UTC (rev 3676)
@@ -494,7 +494,10 @@
Unreached =3D=3D p_min->loss_mode || Interior =3D=3D p_min->los=
s_mode );
is_suppressed =3D=20
VG_(unique_error) ( tid, LeakErr, (UInt)i+1,
- (Char*)n_lossrecords, (void*) p_min,
+ /* HACK ALERT */
+ ULong_to_Ptr((ULong)(UInt)n_lossrecords),=20
+ /* end HACK ALERT */
+ (void*) p_min,
p_min->allocated_at, print_record,
/*allow_GDB_attach*/False, /*count_error*/F=
alse );
=20
|
|
From: Julian S. <js...@ac...> - 2005-05-12 08:42:55
|
... is giving build failures on both platforms. It's because dispatch-*.S wants to know VG_TRC_INVARIANT_FAILED et al, but these are now in pub_core_dispatch.h, which it can't include because that's a for-C include file. Hence link failure: m_dispatch/libdispatch.a(dispatch-amd64.o)(.text+0xbd):dispatch-amd64.S:161: undefined reference to `VG_TRC_INVARIANT_FAILED' m_dispatch/libdispatch.a(dispatch-amd64.o)(.text+0xe6):dispatch-amd64.S:190: undefined reference to `VG_TRC_INNER_COUNTERZERO' m_dispatch/libdispatch.a(dispatch-amd64.o)(.text+0x105):dispatch-amd64.S:202: undefined reference to `VG_TRC_INNER_FASTMISS' m_dispatch/libdispatch.a(dispatch-amd64.o)(.text+0x113):dispatch-amd64.S:208: undefined reference to `VG_TRC_INNER_COUNTERZERO' I can kludge around it to keep working. One possibility is to park those constants -- and those acquired from libvex_trc_values.h -- into a pub_core_dispatch_asm.h, and include that in the .S files and also in pub_core_dispatch.h. I haven't done that tho, since it's a bit inelegant and you might know of a cleaner solution (although I can't think of one). J |
|
From: <sv...@va...> - 2005-05-12 08:27:07
|
Author: sewardj Date: 2005-05-12 09:27:04 +0100 (Thu, 12 May 2005) New Revision: 3675 Modified: trunk/coregrind/pub_core_dispatch.h Log: Fix PURPOSE comment. Modified: trunk/coregrind/pub_core_dispatch.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/pub_core_dispatch.h 2005-05-12 08:26:36 UTC (rev 3674= ) +++ trunk/coregrind/pub_core_dispatch.h 2005-05-12 08:27:04 UTC (rev 3675= ) @@ -32,11 +32,11 @@ #define __PUB_CORE_DISPATCH_H =20 //-------------------------------------------------------------------- -// PURPOSE: This module deals with management of the entire process -// address space. Almost everything depends upon it, including dynamic -// memory management. Hence this module is almost completely -// standalone; the only module it uses is m_debuglog. DO NOT CHANGE -// THIS. +// PURPOSE: This module contains the inner loop of the execution +// mechanism, which is: find next basic block, execute it, repeat until +// the next bb isn't found in the fast-cache; or if the current bb +// exited with a request for some special action before continuing; or +// if the current thread has used up its scheduling quantum. //-------------------------------------------------------------------- =20 /* This subroutine is called from the C world. It is passed |
|
From: <sv...@va...> - 2005-05-12 08:26:42
|
Author: sewardj
Date: 2005-05-12 09:26:36 +0100 (Thu, 12 May 2005)
New Revision: 3674
Modified:
trunk/coregrind/core.h
Log:
Fix compilation warnings on amd64 caused by I_die_here.
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/core.h 2005-05-12 05:26:13 UTC (rev 3673)
+++ trunk/coregrind/core.h 2005-05-12 08:26:36 UTC (rev 3674)
@@ -582,7 +582,8 @@
// Useful for making failing stubs, when certain things haven't yet been
// implemented.
#define I_die_here \
- VG_(assert_fail) ("Unimplemented functionality", \
+ VG_(assert_fail) (/*isCore*//*BOGUS*/True, \
+ "Unimplemented functionality", \
__FILE__, __LINE__, __PRETTY_FUNCTION__, \
"valgrind", VG_BUGS_TO, "")
=20
|
|
From: <sv...@va...> - 2005-05-12 05:26:19
|
Author: njn
Date: 2005-05-12 06:26:13 +0100 (Thu, 12 May 2005)
New Revision: 3673
Modified:
trunk/coregrind/core_asm.h
trunk/coregrind/pub_core_dispatch.h
Log:
Move some macros into a more private place.
Modified: trunk/coregrind/core_asm.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/core_asm.h 2005-05-12 05:13:04 UTC (rev 3672)
+++ trunk/coregrind/core_asm.h 2005-05-12 05:26:13 UTC (rev 3673)
@@ -38,25 +38,6 @@
assembly ones. */
=20
=20
-/* Magic values that the guest state might be set to when returning to t=
he
- dispatcher. The only other legitimate value is to point to the
- start of the thread's VEX guest state. These also are return values =
from
- from VG_(run_innerloop) to the scheduler.
-*/
-/* Defines values for JMP_EMWARN, JMP_SYSCALL, JMP_CLIENTREQ and
- JMP_YIELD */
-#include "libvex_trc_values.h"
-
-/* And some more of our own. These must not have the same values as
- those from libvex_trc_values.h. */
-#define VG_TRC_INNER_FASTMISS 37 /* TRC only; means fast-cache miss.=
*/
-#define VG_TRC_INNER_COUNTERZERO 41 /* TRC only; means bb ctr =3D=3D 0 =
*/
-#define VG_TRC_FAULT_SIGNAL 43 /* TRC only; got sigsegv/sigbus */
-#define VG_TRC_INVARIANT_FAILED 47 /* TRC only; invariant violation */
-
-
-#define VG_MAX_TRC 128 /* Highest possible TRC value */
-
/* Constants for the fast translation lookup cache. */
#define VG_TT_FAST_BITS 16
#define VG_TT_FAST_SIZE (1 << VG_TT_FAST_BITS)
Modified: trunk/coregrind/pub_core_dispatch.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/pub_core_dispatch.h 2005-05-12 05:13:04 UTC (rev 3672=
)
+++ trunk/coregrind/pub_core_dispatch.h 2005-05-12 05:26:13 UTC (rev 3673=
)
@@ -54,6 +54,22 @@
*/
extern UWord VG_(run_innerloop) ( void* guest_state );
=20
+/* Magic values that the guest state might be set to when returning to t=
he
+ dispatcher. The only other legitimate value is to point to the
+ start of the thread's VEX guest state. These also are return values =
from
+ from VG_(run_innerloop) to the scheduler.
+*/
+/* Defines values for JMP_EMWARN, JMP_SYSCALL, JMP_CLIENTREQ and
+ JMP_YIELD */
+#include "libvex_trc_values.h"
+
+/* And some more of our own. These must not have the same values as
+ those from libvex_trc_values.h. */
+#define VG_TRC_INNER_FASTMISS 37 /* TRC only; means fast-cache miss.=
*/
+#define VG_TRC_INNER_COUNTERZERO 41 /* TRC only; means bb ctr =3D=3D 0 =
*/
+#define VG_TRC_FAULT_SIGNAL 43 /* TRC only; got sigsegv/sigbus */
+#define VG_TRC_INVARIANT_FAILED 47 /* TRC only; invariant violation */
+
#endif // __PUB_CORE_DISPATCH_H
=20
/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2005-05-12 05:13:07
|
Author: njn
Date: 2005-05-12 06:13:04 +0100 (Thu, 12 May 2005)
New Revision: 3672
Added:
trunk/coregrind/m_dispatch/
trunk/coregrind/m_dispatch/Makefile.am
trunk/coregrind/m_dispatch/dispatch-amd64.S
trunk/coregrind/m_dispatch/dispatch-arm.S
trunk/coregrind/m_dispatch/dispatch-x86.S
trunk/coregrind/pub_core_dispatch.h
Removed:
trunk/coregrind/amd64/dispatch.S
trunk/coregrind/arm/dispatch.S
trunk/coregrind/x86/dispatch.S
Modified:
trunk/configure.in
trunk/coregrind/Makefile.am
trunk/coregrind/amd64/Makefile.am
trunk/coregrind/arm/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/vg_scheduler.c
trunk/coregrind/x86/Makefile.am
Log:
Modularised the dispatchers in m_dispatch.
Modified: trunk/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/configure.in 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/configure.in 2005-05-12 05:13:04 UTC (rev 3672)
@@ -393,8 +393,9 @@
include/x86-linux/Makefile=20
auxprogs/Makefile
coregrind/Makefile=20
+ coregrind/m_aspacemgr/Makefile=20
coregrind/m_demangle/Makefile=20
- coregrind/m_aspacemgr/Makefile=20
+ coregrind/m_dispatch/Makefile=20
coregrind/m_replacemalloc/Makefile=20
coregrind/m_sigframe/Makefile=20
coregrind/m_syscalls/Makefile=20
Modified: trunk/coregrind/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/coregrind/Makefile.am 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/coregrind/Makefile.am 2005-05-12 05:13:04 UTC (rev 3672)
@@ -2,8 +2,9 @@
include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
=20
MODULES =3D \
+ m_aspacemgr \
m_demangle \
- m_aspacemgr \
+ m_dispatch \
m_replacemalloc \
m_sigframe \
m_syscalls
@@ -40,6 +41,7 @@
pub_core_aspacemgr.h \
pub_core_debuglog.h \
pub_core_demangle.h \
+ pub_core_dispatch.h \
pub_core_errormgr.h \
pub_core_execontext.h \
pub_core_mallocfree.h \
@@ -96,6 +98,7 @@
=20
## libplatform.a must be before libarch.a and libos.a, it seems.
stage2_extra=3D \
+ m_dispatch/libdispatch.a \
m_demangle/libdemangle.a \
m_aspacemgr/libaspacemgr.a \
m_sigframe/libsigframe.a \
Modified: trunk/coregrind/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/coregrind/amd64/Makefile.am 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/coregrind/amd64/Makefile.am 2005-05-12 05:13:04 UTC (rev 3672)
@@ -19,7 +19,6 @@
libarch_a_SOURCES =3D \
cpuid.S \
helpers.S \
- dispatch.S \
jmp_with_stack.c \
state.c
=20
Deleted: trunk/coregrind/amd64/dispatch.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/amd64/dispatch.S 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/coregrind/amd64/dispatch.S 2005-05-12 05:13:04 UTC (rev 3672)
@@ -1,217 +0,0 @@
-
-##--------------------------------------------------------------------##
-##--- The core dispatch loop, for jumping to a code address. ---##
-##--- amd64/dispatch.S ---##
-##--------------------------------------------------------------------##
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Julian Seward=20
- js...@ac...
-
- 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., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#include "core_asm.h"
-#include "libvex_guest_offsets.h" /* for OFFSET_amd64_RIP */
-
-
-/*------------------------------------------------------------*/
-/*--- The dispatch loop. ---*/
-/*------------------------------------------------------------*/
-
-/* signature: UWord VG_(run_innerloop) ( void* guest_state ) */
-
-.globl VG_(run_innerloop)
-VG_(run_innerloop):
- /* %rdi holds guest_state */
-=09
- /* ----- entry point to VG_(run_innerloop) ----- */
- pushq %rbx
- pushq %rcx
- pushq %rdx
- pushq %rsi
- pushq %rbp
- pushq %r8
- pushq %r9
- pushq %r10
- pushq %r11
- pushq %r12
- pushq %r13
- pushq %r14
- pushq %r15
- pushq %rdi
-
- movq VG_(dispatch_ctr)@GOTPCREL(%rip), %rsi
- pushq (%rsi)
-
- /* 8(%rsp) holds cached copy of guest_state */
- /* 0(%rsp) holds cached copy of VG_(dispatch_ctr) */
-
- /* Set up the guest state pointer */
- movq %rdi, %rbp
-=09
- /* fetch %RIP into %rax */
- movq OFFSET_amd64_RIP(%rbp), %rax
-
- /* set host FPU control word to the default mode expected=20
- by VEX-generated code. See comments in libvex.h for
- more info. */
- finit
- pushq $0x027F
- fldcw (%rsp)
- addq $8, %rsp
-=09
- /* set host SSE control word to the default mode expected=20
- by VEX-generated code. */
- pushq $0x1F80
- ldmxcsr (%rsp)
- addq $8, %rsp
-
- /* set dir flag to known value */
- cld
-
- /* fall into main loop */
-
- /* Here, %rax is the only live (real) register. The entire
- simulated state is saved in the ThreadState. */
-
-dispatch_boring:
- /* save the jump address in the guest state */
- movq %rax, OFFSET_amd64_RIP(%rbp)
-
- /* Are we out of timeslice? If yes, defer to scheduler. */
- subl $1, 0(%rsp)
- jz counter_is_zero
-
- /* try a fast lookup in the translation cache */
- movq %rax, %rbx
- andq $VG_TT_FAST_MASK, %rbx
- movq VG_(tt_fast)@GOTPCREL(%rip), %rcx
- movq (%rcx,%rbx,8), %rcx
- cmpq %rax, (%rcx)
- jnz fast_lookup_failed
- /* increment bb profile counter */
- movq VG_(tt_fastN)@GOTPCREL(%rip), %rdx
- movq (%rdx,%rbx,8), %rdx
- incl (%rdx)
-
- /* Found a match. Call tce[1], which is 8 bytes along, since
- each tce element is a 64-bit int. */
- addq $8, %rcx
- call *%rcx
-
- /*=20
- %rax holds destination (original) address.
- %rbp indicates further details of the control transfer
- requested to the address in %rax.
-=09
- If rbp is unchanged (=3D=3D * 8(%rsp)), just jump next to %rax.
-
- Otherwise fall out, back to the scheduler, and let it
- figure out what to do next.
- */
-
- cmpq 8(%rsp), %rbp
- jz dispatch_boring
-
- jmp dispatch_exceptional
-
-
-
-/* All exits from the dispatcher go through here. %rax holds
- the return value.=20
-*/
-run_innerloop_exit:=20
- /* We're leaving. Check that nobody messed with
- %mxcsr or %fpucw. We can't mess with %rax here as it
- holds the tentative return value, but any other is OK. */
- pushq $0
- fstcw (%rsp)
- cmpl $0x027F, (%rsp)
- popq %r11 /* get rid of the word without trashing %eflags */
- jnz invariant_violation
- pushq $0
- stmxcsr (%rsp)
- andl $0xFFFFFFC0, (%rsp) /* mask out status flags */
- cmpl $0x1F80, (%rsp)
- popq %r11
- jnz invariant_violation
- /* otherwise we're OK */
- jmp run_innerloop_exit_REALLY
-
-invariant_violation:
- movq $VG_TRC_INVARIANT_FAILED, %rax
- jmp run_innerloop_exit_REALLY
-
-run_innerloop_exit_REALLY:
- movq VG_(dispatch_ctr)@GOTPCREL(%rip), %rsi
- popq (%rsi)
- popq %rdi
- popq %r15
- popq %r14
- popq %r13
- popq %r12
- popq %r11
- popq %r10
- popq %r9
- popq %r8
- popq %rbp
- popq %rsi
- popq %rdx
- popq %rcx
- popq %rbx
- ret=09
-
-=09
-=09
-/* Other ways of getting out of the inner loop. Placed out-of-line to
- make it look cleaner.=20
-*/
-dispatch_exceptional:
- /* this is jumped to only, not fallen-through from above */
- cmpq $VG_TRC_INNER_COUNTERZERO, %rbp
- jz counter_is_zero
-
- /* save %rax in %RIP and defer to sched */
- movq 8(%rsp), %rdi
- movq %rax, OFFSET_amd64_RIP(%rdi)
- movq %rbp, %rax
- jmp run_innerloop_exit
-
-fast_lookup_failed:
- /* %RIP is up to date here since dispatch_boring dominates */
- addl $1, 0(%rsp)
- movq $VG_TRC_INNER_FASTMISS, %rax
- jmp run_innerloop_exit
-
-counter_is_zero:
- /* %RIP is up to date here since dispatch_boring dominates */
- addl $1, 0(%rsp)
- movq $VG_TRC_INNER_COUNTERZERO, %rax
- jmp run_innerloop_exit
-
-
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
-##--------------------------------------------------------------------##
-##--- end ---##
-##--------------------------------------------------------------------##
Modified: trunk/coregrind/arm/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/coregrind/arm/Makefile.am 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/coregrind/arm/Makefile.am 2005-05-12 05:13:04 UTC (rev 3672)
@@ -17,7 +17,6 @@
CLEANFILES =3D stage2.lds
=20
libarch_a_SOURCES =3D \
- dispatch.S \
state.c
=20
if USE_PIE
Deleted: trunk/coregrind/arm/dispatch.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/arm/dispatch.S 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/coregrind/arm/dispatch.S 2005-05-12 05:13:04 UTC (rev 3672)
@@ -1,41 +0,0 @@
-
-##--------------------------------------------------------------------##
-##--- The core dispatch loop, for jumping to a code address. ---##
-##--- arm/dispatch.S ---##
-##--------------------------------------------------------------------##
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Julian Seward=20
- js...@ac...
-
- 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., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#include "core_asm.h"
-
-.globl VG_(run_innerloop)
-VG_(run_innerloop):
- # this needs some improvement...
- swi
-
-##--------------------------------------------------------------------##
-##--- end ---##
-##--------------------------------------------------------------------##
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/core.h 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/coregrind/core.h 2005-05-12 05:13:04 UTC (rev 3672)
@@ -661,9 +661,6 @@
=20
extern Addr VG_(reverse_search_one_symtab) ( const SegInfo* si, const Ch=
ar* name );
=20
-/* Set up some default redirects */
-extern void VG_(setup_code_redirect_table) ( void );
-
extern Bool VG_(resolve_redir_allsegs)(CodeRedirect *redir);
=20
extern Bool VG_(use_CFI_info) ( /*MOD*/Addr* ipP,
@@ -676,9 +673,13 @@
/* ---------------------------------------------------------------------
Exports of vg_redir.c
------------------------------------------------------------------ */
+
/* Redirection machinery */
extern Addr VG_(code_redirect) ( Addr orig );
=20
+/* Set up some default redirects */
+extern void VG_(setup_code_redirect_table) ( void );
+
extern void VG_(add_redirect_sym_to_addr)(const Char *from_lib,
const Char *from_sym,
Addr to_addr);
@@ -824,25 +825,6 @@
extern void VG_(sigreturn)(void);
=20
/* ---------------------------------------------------------------------
- Exports of vg_dispatch.S
- ------------------------------------------------------------------ */
-
-/* This subroutine is called from the C world. It is passed
- a pointer to the VEX guest state (arch.vex). It must run code
- from the instruction pointer in the guest state, and exit when
- VG_(dispatch_ctr) reaches zero, or we need to defer to the scheduler.
- The return value must indicate why it returned back to the scheduler.
- It can also be exited if the executing code throws a non-resumable
- signal, for example SIGSEGV, in which case control longjmp()s back pa=
st
- here.
-
- This code simply handles the common case fast -- when the translation
- address is found in the translation cache. For anything else, the
- scheduler does the work.
-*/
-extern UWord VG_(run_innerloop) ( void* guest_state );
-
-/* ---------------------------------------------------------------------
Exports of vg_helpers.S
------------------------------------------------------------------ */
=20
Added: trunk/coregrind/m_dispatch/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/coregrind/m_dispatch/Makefile.am 2005-05-12 04:37:27 UTC (rev 3=
671)
+++ trunk/coregrind/m_dispatch/Makefile.am 2005-05-12 05:13:04 UTC (rev 3=
672)
@@ -0,0 +1,17 @@
+include $(top_srcdir)/Makefile.all.am
+include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
+
+AM_CFLAGS =3D $(WERROR) -Wmissing-prototypes -Winline -Wall -Wshadow -O =
-g
+
+noinst_LIBRARIES =3D libdispatch.a
+
+## XXX: this won't work with "make dist" -- only one dispatch-XXX.S file
+## will be put in the tarball. Problem exists in various other Makefile=
s.
+libdispatch_a_SOURCES =3D \
+ dispatch-@VG_ARCH@.S
+
+if USE_PIE
+libdispatch_a_CFLAGS =3D $(AM_CFLAGS) -fpie
+else
+libdispatch_a_CFLAGS =3D $(AM_CFLAGS)
+endif
Copied: trunk/coregrind/m_dispatch/dispatch-amd64.S (from rev 3670, trunk=
/coregrind/amd64/dispatch.S)
Copied: trunk/coregrind/m_dispatch/dispatch-arm.S (from rev 3670, trunk/c=
oregrind/arm/dispatch.S)
Copied: trunk/coregrind/m_dispatch/dispatch-x86.S (from rev 3670, trunk/c=
oregrind/x86/dispatch.S)
Added: trunk/coregrind/pub_core_dispatch.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/pub_core_dispatch.h 2005-05-12 04:37:27 UTC (rev 3671=
)
+++ trunk/coregrind/pub_core_dispatch.h 2005-05-12 05:13:04 UTC (rev 3672=
)
@@ -0,0 +1,61 @@
+
+/*--------------------------------------------------------------------*/
+/*--- The dispatcher. pub_core_dispatch.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ 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., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_DISPATCH_H
+#define __PUB_CORE_DISPATCH_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module deals with management of the entire process
+// address space. Almost everything depends upon it, including dynamic
+// memory management. Hence this module is almost completely
+// standalone; the only module it uses is m_debuglog. DO NOT CHANGE
+// THIS.
+//--------------------------------------------------------------------
+
+/* This subroutine is called from the C world. It is passed
+ a pointer to the VEX guest state (arch.vex). It must run code
+ from the instruction pointer in the guest state, and exit when
+ VG_(dispatch_ctr) reaches zero, or we need to defer to the scheduler.
+ The return value must indicate why it returned back to the scheduler.
+ It can also be exited if the executing code throws a non-resumable
+ signal, for example SIGSEGV, in which case control longjmp()s back pa=
st
+ here.
+
+ This code simply handles the common case fast -- when the translation
+ address is found in the translation cache. For anything else, the
+ scheduler does the work.
+*/
+extern UWord VG_(run_innerloop) ( void* guest_state );
+
+#endif // __PUB_CORE_DISPATCH_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_scheduler.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/coregrind/vg_scheduler.c 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/coregrind/vg_scheduler.c 2005-05-12 05:13:04 UTC (rev 3672)
@@ -60,6 +60,7 @@
VG_USERREQ__DISCARD_TRANSLATIONS, and other=
s */
#include "core.h"
=20
+#include "pub_core_dispatch.h"
#include "pub_core_errormgr.h"
#include "pub_core_replacemalloc.h"
#include "pub_core_stacktrace.h"
Modified: trunk/coregrind/x86/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/coregrind/x86/Makefile.am 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/coregrind/x86/Makefile.am 2005-05-12 05:13:04 UTC (rev 3672)
@@ -19,7 +19,6 @@
libarch_a_SOURCES =3D \
cpuid.S \
helpers.S \
- dispatch.S \
jmp_with_stack.c \
state.c
=20
Deleted: trunk/coregrind/x86/dispatch.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/x86/dispatch.S 2005-05-12 04:37:27 UTC (rev 3671)
+++ trunk/coregrind/x86/dispatch.S 2005-05-12 05:13:04 UTC (rev 3672)
@@ -1,193 +0,0 @@
-
-##--------------------------------------------------------------------##
-##--- The core dispatch loop, for jumping to a code address. ---##
-##--- x86/dispatch.S ---##
-##--------------------------------------------------------------------##
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Julian Seward=20
- js...@ac...
-
- 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., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#include "core_asm.h"
-#include "libvex_guest_offsets.h" /* for OFFSET_x86_EIP */
-
-
-/*------------------------------------------------------------*/
-/*--- The dispatch loop. ---*/
-/*------------------------------------------------------------*/
-
-/* signature: UWord VG_(run_innerloop) ( void* guest_state ) */
-
-.globl VG_(run_innerloop)
-VG_(run_innerloop):
- /* 4(%esp) holds guest_state */
-=09
- /* ----- entry point to VG_(run_innerloop) ----- */
- pushl %ebx
- pushl %ecx
- pushl %edx
- pushl %esi
- pushl %edi
- pushl %ebp
-=09
- /* 28(%esp) holds guest_state */
-
- /* Set up the guest state pointer */
- movl 28(%esp), %ebp
-=09
- /* fetch %EIP into %eax */
- movl OFFSET_x86_EIP(%ebp), %eax
-
- /* set host FPU control word to the default mode expected=20
- by VEX-generated code. See comments in libvex.h for
- more info. */
- finit
- pushl $0x027F
- fldcw (%esp)
- addl $4, %esp
-=09
- /* set host SSE control word to the default mode expected=20
- by VEX-generated code. */
- pushl $0x1F80
- ldmxcsr (%esp)
- addl $4, %esp
-
- /* set dir flag to known value */
- cld
-=09
- /* fall into main loop */
-
- /* Here, %eax is the only live (real) register. The entire
- simulated state is saved in the ThreadState. */
-
-dispatch_boring:
- /* save the jump address in the guest state */
- movl %eax, OFFSET_x86_EIP(%ebp)
-
- /* Are we out of timeslice? If yes, defer to scheduler. */
- subl $1, VG_(dispatch_ctr)
- jz counter_is_zero
-
- /* try a fast lookup in the translation cache */
- movl %eax, %ebx
- andl $VG_TT_FAST_MASK, %ebx
- movl VG_(tt_fast)(,%ebx,4), %ecx
- cmpl %eax, (%ecx)
- jnz fast_lookup_failed
- /* increment bb profile counter */
- movl VG_(tt_fastN)(,%ebx,4), %edx
- incl (%edx)
-
- /* Found a match. Call tce[1], which is 8 bytes along, since
- each tce element is a 64-bit int. */
- addl $8, %ecx
- call *%ecx
-=09
- /*=20
- %eax holds destination (original) address.
- %ebp indicates further details of the control transfer
- requested to the address in %eax.
-=09
- If ebp is unchanged (=3D=3D * 28(%esp)), just jump next to %eax.
-
- Otherwise fall out, back to the scheduler, and let it
- figure out what to do next.
- */
-
- cmpl 28(%esp), %ebp
- jz dispatch_boring
-
- jmp dispatch_exceptional
-
-=09
-
-/* All exits from the dispatcher go through here. %eax holds
- the return value.=20
-*/
-run_innerloop_exit:=20
- /* We're leaving. Check that nobody messed with
- %mxcsr or %fpucw. We can't mess with %eax here as it
- holds the tentative return value, but any other is OK. */
- pushl $0
- fstcw (%esp)
- cmpl $0x027F, (%esp)
- popl %esi /* get rid of the word without trashing %eflags */
- jnz invariant_violation
- pushl $0
- stmxcsr (%esp)
- andl $0xFFFFFFC0, (%esp) /* mask out status flags */
- cmpl $0x1F80, (%esp)
- popl %esi
- jnz invariant_violation
- /* otherwise we're OK */
- jmp run_innerloop_exit_REALLY
-
-invariant_violation:
- movl $VG_TRC_INVARIANT_FAILED, %eax
- jmp run_innerloop_exit_REALLY
-
-run_innerloop_exit_REALLY:
- popl %ebp
- popl %edi
- popl %esi
- popl %edx
- popl %ecx
- popl %ebx
- ret=09
-
-
-
-/* Other ways of getting out of the inner loop. Placed out-of-line to
- make it look cleaner.=20
-*/
-dispatch_exceptional:
- /* this is jumped to only, not fallen-through from above */
- cmpl $VG_TRC_INNER_COUNTERZERO, %ebp
- jz counter_is_zero
-
- /* save %eax in %EIP and defer to sched */
- movl 28(%esp), %edi
- movl %eax, OFFSET_x86_EIP(%edi)
- movl %ebp, %eax
- jmp run_innerloop_exit
-
-fast_lookup_failed:
- /* %EIP is up to date here since dispatch_boring dominates */
- addl $1, VG_(dispatch_ctr)
- movl $VG_TRC_INNER_FASTMISS, %eax
- jmp run_innerloop_exit
-
-counter_is_zero:
- /* %EIP is up to date here since dispatch_boring dominates */
- addl $1, VG_(dispatch_ctr)
- movl $VG_TRC_INNER_COUNTERZERO, %eax
- jmp run_innerloop_exit
-
-=09
-/* Let the linker know we don't need an executable stack */
-.section .note.GNU-stack,"",@progbits
-
-##--------------------------------------------------------------------##
-##--- end ---##
-##--------------------------------------------------------------------##
|
|
From: <sv...@va...> - 2005-05-12 04:37:31
|
Author: njn Date: 2005-05-12 05:37:27 +0100 (Thu, 12 May 2005) New Revision: 3671 Added: trunk/coregrind/m_skiplist.c trunk/coregrind/pub_core_skiplist.h trunk/include/pub_tool_skiplist.h Removed: trunk/coregrind/vg_skiplist.c Modified: trunk/coregrind/Makefile.am trunk/coregrind/vg_redir.c trunk/include/Makefile.am trunk/include/tool.h Log: Modularised vg_skiplist.c as m_skiplist.c. Modified: trunk/coregrind/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/coregrind/Makefile.am 2005-05-12 03:51:15 UTC (rev 3670) +++ trunk/coregrind/Makefile.am 2005-05-12 04:37:27 UTC (rev 3671) @@ -45,6 +45,7 @@ pub_core_mallocfree.h \ pub_core_replacemalloc.h\ pub_core_sigframe.h \ + pub_core_skiplist.h \ pub_core_stacktrace.h \ pub_core_syscalls.h \ pub_core_tooliface.h \ @@ -71,6 +72,7 @@ m_errormgr.c \ m_execontext.c \ m_mallocfree.c \ + m_skiplist.c \ m_stacktrace.c \ m_tooliface.c \ ume.c \ @@ -88,7 +90,6 @@ vg_redir.c \ vg_dwarf.c \ vg_stabs.c \ - vg_skiplist.c \ vg_symtypes.c \ vg_translate.c \ vg_transtab.c Copied: trunk/coregrind/m_skiplist.c (from rev 3670, trunk/coregrind/vg_s= kiplist.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/coregrind/vg_skiplist.c 2005-05-12 03:51:15 UTC (rev 3670) +++ trunk/coregrind/m_skiplist.c 2005-05-12 04:37:27 UTC (rev 3671) @@ -0,0 +1,509 @@ + +/*--------------------------------------------------------------------*/ +/*--- A skiplist implementation. m_skiplist.c ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2002-2005 Jeremy Fitzhardinge + je...@go... + + 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., 59 Temple Place, Suite 330, Boston, MA + 02111-1307, USA. + + The GNU General Public License is contained in the file COPYING. +*/ + +/*=20 + This file implements a generic skip-list type. + + Skip-lists are described in William Pugh, Skip Lists: A + Probabilistic Alternative to Balanced Trees, CACM, 33(6):668-676, + June 1990.=20 + http://www.cs.unc.edu/~baruah/Teaching/2002f/HandOuts/skiplist-CACM.p= df + + Skip-lists are a randomized linked-list, where a node in the list + has at least one "next" pointer, but may have more. When + traversing the list, the "higher" next pointers allow you to skip + multiple list entries, allowing you to find the right place + quickly. =20 + + On average, 1/2 the entries have one next pointer, 1/4 have 2, 1/8 + have 3, etc. This means that the skiplist has the same search + complexity as a balanced binary tree, but there is no need to + rebalance or do any other structural changes. The randomness also + means that it is invulnerable to pathalogical workloads. + + Because the each node can be a different size, this implementation + puts the SkipNode structure at the end of the allocation, with the + node data starting at the beginning. + + low address ->+---------------+ ^ + | list data | | + key offset->: key : structure size + | | | + +---------------+ V + | struct | + | SkipNode | + +- - - - - - - -+ + | next pointers | + : : + + + When you declare the list with VG_SKIPLIST_INIT, you specify the + structure for each list node, structure member you want to use as a + key, and the function for comparing keys. + + Each node must be allocated with SkipNode_Alloc, which allocates + enough space for the client data, the SkipNode structure, and the + next pointers for this node. + + The helper functions data_of_node and node_of_data do the correct + pointer arithmetic to sort all this out. The SkipNode also has a + magic number which is checked after each operation to make sure + that we're really operating on a SkipNode. + + The first node of the list, the head node, is special. It contains + the maximum number of next pointers (SK_MAXHEIGHT). It has no data + associated with it, and it always compares less-than to all other + nodes. Because it has no data attached to it, it is always an + error to try and use data_of_node on it. To detect this problem, + it has a different magic number from all other SkipNodes so that it + won't be accidentally used. + */ + +#include "core.h" +#include "pub_core_skiplist.h" + +#include <stdlib.h> + +#define SKIPLIST_DEBUG 0 + +#define SK_MAXHEIGHT 20 /* 2^20 elements */ +#define SKIPLIST_MAGIC 0x5b1ff872 +#define SKIPLIST_HEAD_MAGIC (~SKIPLIST_MAGIC) + + +#if SKIPLIST_DEBUG +#define inline +#endif /* SKIPLIST_DEBUG */ + +struct _SkipNode { + UInt magic; + UShort level; /* level is the max level (level =3D=3D 0 means 1 next= pointer) */ + SkipNode *next[0]; +}; + + +/*=20 + Compute the height of a new node. 1/2 will be 1, 1/4 2, 1/8 3, + etc. + */ +static inline Int get_height(void) +{ + UInt ret =3D 0; + + while((ret < SK_MAXHEIGHT - 1) && (random() & 1)) + ret++; + + return ret; +} + +/*=20 + Given a pointer to the node's data, return a pointer to the key. + */ +static inline void *key_of_data(const SkipList *l, void *d) +{ + return (void *)((Char *)d + l->keyoff); +} + +/*=20 + Given a pointer to the node's data, return the pointer to the SkipNod= e + structure. If the node has a bad magic number, it will die with an + assertion failure. + */ +static inline SkipNode *node_of_data(const SkipList *l, const void *d) +{ + SkipNode *n =3D (SkipNode *)((Char *)d + l->size); + + if (SKIPLIST_DEBUG && n->magic !=3D SKIPLIST_MAGIC) + VG_(printf)("bad magic on node %p =3D %x (not %x)\n", + n, n->magic, SKIPLIST_MAGIC); + + vg_assert(n->magic =3D=3D SKIPLIST_MAGIC); + + return n;=20 +} + +/*=20 + Given a SkipNode structure, return the pointer to the node's data. + */ +static inline void *data_of_node(const SkipList *l, const SkipNode *n) +{ + if (SKIPLIST_DEBUG && n->magic !=3D SKIPLIST_MAGIC) + VG_(printf)("bad magic on node %p =3D %x (not %x)\n", + n, n->magic, SKIPLIST_MAGIC); + + vg_assert(n->magic =3D=3D SKIPLIST_MAGIC); + return (void *)((Char *)n - l->size); +} + +/*=20 + Given a SkipNode structure, return the pointer to the node's key. + */ +static inline void *key_of_node(const SkipList *l, const SkipNode *n) +{ + return key_of_data(l, data_of_node(l, n)); +} + +static inline void validate_skiplist(const SkipList *l, const Char *wher= e) +{ +#if SKIPLIST_DEBUG + const SkipNode *prev[SK_MAXHEIGHT]; + Int i; + const SkipNode *n, *next; + =20 + VG_(printf)("---------------- %s ----------------\n", where); + + if (l->head =3D=3D NULL) + return; + + for(i =3D 0; i <=3D l->head->level; i++) { + VG_(printf)("l->head->next[%d]=3D%p\n", + i, l->head->next[i]); + prev[i] =3D l->head->next[i]; + } + + for(n =3D l->head->next[0]; n !=3D NULL; n =3D next) { + next =3D n->next[0]; + + VG_(printf)("n=3D%p next=3D%p, n->level=3D%d k=3D%s\n", + n, next, n->level, (*l->strkey)(key_of_node(l, n))); + for(i =3D 0; i <=3D n->level; i++) { + VG_(printf)(" n->next[%d] =3D %p\n", + i, n->next[i]); + VG_(printf)(" prev[%d] =3D %p\n", + i, prev[i]); + } + =20 + vg_assert(l->head->level >=3D n->level); + + for(i =3D 0; i <=3D n->level; i++) + vg_assert(prev[i] =3D=3D n); + + for(i =3D 0; i <=3D n->level; i++) + prev[i] =3D n->next[i]; + + vg_assert(next =3D=3D NULL || (l->cmp)(key_of_node(l, n), key_of_n= ode(l, next)) < 0); + } +#endif /* SKIPLIST_DEBUG */ +} + +void *VG_(SkipNode_Alloc)(const SkipList *l) +{ + UInt size; + Int h; + SkipNode *n; + Char *ret; + + h =3D get_height(); + + size =3D l->size; + size +=3D sizeof(SkipNode) + (h+1)*sizeof(SkipNode *); + + if (l->arena =3D=3D -1) + *(Short *)&l->arena =3D VG_AR_TOOL; + + ret =3D VG_(arena_malloc)(l->arena, size); + + if (ret =3D=3D NULL) + return NULL; + + n =3D (SkipNode *)(ret + l->size); + n->level =3D h; + n->magic =3D SKIPLIST_MAGIC; + + VG_(memset)(n->next, 0, sizeof(n->next[0]) * (h+1)); + + return ret; +} + +void VG_(SkipNode_Free)(const SkipList *l, void *p) +{ + if (SKIPLIST_DEBUG) { + SkipNode *n =3D node_of_data(l, p); + + VG_(printf)("SkipNode_Free: freeing %p (node %p)\n", + p, n); + n->magic =3D 0x55ffaabb; + } + VG_(arena_free)(l->arena, p); +} + +void *VG_(SkipNode_First)(const SkipList *l) +{ + SkipNode *n =3D l->head ? l->head->next[0] : NULL; + + if (n =3D=3D NULL) + return NULL; + else + return data_of_node(l, n); +} + +void *VG_(SkipNode_Next)(const SkipList *l, void *data) +{ + SkipNode *n =3D node_of_data(l, data); + =20 + n =3D n->next[0]; + + if (n =3D=3D NULL) + return NULL; + + return data_of_node(l, n); +} + + + +static Int cmp(const SkipList *l, SkipNode *n, void *k2) +{ + void *k1 =3D key_of_node(l, n); + + if (k1 =3D=3D k2) + return 0; + + if (l->head =3D=3D n) + return -1; + + return (l->cmp)(k1, k2); +} + +/* Search the list for k; it either returns the k if it exists, or the + one before if not. */ +static SkipNode *SkipList__Find(const SkipList *l, void *k, SkipNode **p= revs) +{ + SkipNode *n; + Int lvl; + + if (SKIPLIST_DEBUG) + VG_(printf)("SkipList__Find: finding %s\n", (*l->strkey)(k)); + + validate_skiplist(l, "SkipList__Find"); + + if (l->head =3D=3D NULL) + return NULL; + + for(lvl =3D l->head->level, n =3D l->head; lvl >=3D 0; lvl--) { + while(n->next[lvl] !=3D NULL && cmp(l, n->next[lvl], k) < 0) { + if (SKIPLIST_DEBUG) + VG_(printf)("SkipList__Find: n=3D%p n->next[%d]=3D%p\n", + n, lvl, n->next[lvl]); + n =3D n->next[lvl]; + } + if (prevs) + prevs[lvl] =3D n; + } + + /* XXX Is there a cleaner way of getting this?=20 + =20 + If we get an exact match, return it. + If we get the head, return NULL. + Otherwise return the one before where the hit would be. + */ + if (n->next[0] !=3D NULL && cmp(l, n->next[0], k) =3D=3D 0) + n =3D n->next[0]; + if (n =3D=3D l->head) + n =3D NULL; + + if (SKIPLIST_DEBUG) { + + VG_(printf)("SkipList__Find returning node %p\n", n); + + if (n =3D=3D NULL) { + SkipNode *nn; + + for(nn =3D l->head->next[0]; nn !=3D NULL; nn =3D nn->next[0]) + vg_assert(cmp(l, nn, k) !=3D 0); + } else + vg_assert(cmp(l, n, k) <=3D 0); + } + + return n; +} + +/* Return list element which is <=3D k, or NULL if there is none. */ +void *VG_(SkipList_Find_Before)(const SkipList *l, void *k) +{ + SkipNode *n =3D SkipList__Find(l, k, NULL); + + if (n !=3D NULL) + return data_of_node(l, n); + return NULL; +} + +/* Return the list element which =3D=3D k, or NULL if none */ +void *VG_(SkipList_Find_Exact)(const SkipList *l, void *k) +{ + SkipNode *n =3D SkipList__Find(l, k, NULL); + + if (n !=3D NULL && (l->cmp)(key_of_node(l, n), k) =3D=3D 0) + return data_of_node(l, n); + return NULL; +} + +/* Return the list element which is >=3D k, or NULL if none */ +void *VG_(SkipList_Find_After)(const SkipList *l, void *k) +{ + SkipNode *n =3D SkipList__Find(l, k, NULL); + + if (n !=3D NULL && (l->cmp)(key_of_node(l, n), k) < 0) + n =3D n->next[0]; + + if (n !=3D NULL) + return data_of_node(l, n); + + return NULL; +} + +void VG_(SkipList_Insert)(SkipList *l, void *data) +{ + SkipNode *update[SK_MAXHEIGHT]; + SkipNode *n, *nn; + void *k =3D key_of_data(l, data); + Int i; + + if (SKIPLIST_DEBUG) + VG_(printf)("inserting node %p, key %s, height %d\n", + data, (*l->strkey)(key_of_data(l, data)), node_of_data(l, data)->lev= el); + + validate_skiplist(l, "SkipList_Insert before"); + + if (l->head =3D=3D NULL) { + Int size =3D sizeof(SkipNode) + sizeof(SkipNode *) * SK_MAXHEIGHT; + + if (l->arena =3D=3D -1) + *(Short *)&l->arena =3D VG_AR_TOOL; + =20 + l->head =3D VG_(arena_malloc)(l->arena, size); + VG_(memset)(l->head, 0, size); + + l->head->magic =3D SKIPLIST_HEAD_MAGIC; + l->head->level =3D 0; + } + + n =3D node_of_data(l, data); + + /* update size of head's next vector to fit this new node */ + vg_assert(l->head !=3D NULL); + if (l->head->level < n->level) { + for(i =3D l->head->level+1; i <=3D n->level; i++) + l->head->next[i] =3D NULL; + l->head->level =3D n->level; + } + + /* Look for the node, but we're mostly interested in setting + "update", which is the set of previous nodes with next pointers + we need to fix up. */ + nn =3D SkipList__Find(l, k, update); + =20 + /* check the new entry is unique */ + vg_assert(nn =3D=3D NULL || (l->cmp)(key_of_node(l, nn), k) !=3D 0); + + /* update the previous node's next pointers */ + for(i =3D 0; i <=3D n->level; i++) { + n->next[i] =3D update[i]->next[i]; + update[i]->next[i] =3D n; + } + + validate_skiplist(l, "SkipList_Insert after"); +} + +void *VG_(SkipList_Remove)(SkipList *l, void *k) +{ + SkipNode *update[SK_MAXHEIGHT]; + SkipNode *n; + Int i; + =20 + validate_skiplist(l, "SkipList_Remove before"); + + n =3D SkipList__Find(l, k, update); + if (n =3D=3D NULL) + return NULL; + + vg_assert((l->cmp)(k, key_of_node(l, n)) =3D=3D 0); + + for(i =3D 0; i <=3D n->level; i++) { + update[i]->next[i] =3D n->next[i]; + n->next[i] =3D NULL; + } + + validate_skiplist(l, "SkipList_Remove after"); + + return data_of_node(l, n); +} + + +/* -------------------------------------------------- + Comparison functions + -------------------------------------------------- */ +Int VG_(cmp_Int)(const void *v1, const void *v2) +{ + Int a =3D *(const Int *)v1; + Int b =3D *(const Int *)v2; + + if (a < b) + return -1; + if (a =3D=3D b) + return 0; + return 1; +} + +Int VG_(cmp_UInt)(const void *v1, const void *v2) +{ + UInt a =3D *(const UInt *)v1; + UInt b =3D *(const UInt *)v2; + + if (a < b) + return -1; + if (a =3D=3D b) + return 0; + return 1; +} + +Int VG_(cmp_Addr)(const void *v1, const void *v2) +{ + Addr a =3D *(const Addr *)v1; + Addr b =3D *(const Addr *)v2; + + if (a < b) + return -1; + if (a =3D=3D b) + return 0; + return 1; +} + +Int VG_(cmp_string)(const void *v1, const void *v2) +{ + const Char *a =3D *(const Char **)v1; + const Char *b =3D *(const Char **)v2; + + return VG_(strcmp)(a, b); +} + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ + Added: trunk/coregrind/pub_core_skiplist.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/pub_core_skiplist.h 2005-05-12 03:51:15 UTC (rev 3670= ) +++ trunk/coregrind/pub_core_skiplist.h 2005-05-12 04:37:27 UTC (rev 3671= ) @@ -0,0 +1,47 @@ + +/*--------------------------------------------------------------------*/ +/*--- A skip-list implemenation. pub_core_skiplist.h ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2000-2005 Julian Seward + js...@ac... + + 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., 59 Temple Place, Suite 330, Boston, MA + 02111-1307, USA. + + The GNU General Public License is contained in the file COPYING. +*/ + +#ifndef __PUB_CORE_SKIPLIST_H +#define __PUB_CORE_SKIPLIST_H + +//-------------------------------------------------------------------- +// PURPOSE: A generic data structure with amortised log(n) operations. +//-------------------------------------------------------------------- + +#include "pub_tool_skiplist.h" + +// No core-only exports; everything in this module is visible to both +// the core and tools. + +#endif // __PUB_CORE_SKIPLIST_H + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ Modified: trunk/coregrind/vg_redir.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/coregrind/vg_redir.c 2005-05-12 03:51:15 UTC (rev 3670) +++ trunk/coregrind/vg_redir.c 2005-05-12 04:37:27 UTC (rev 3671) @@ -33,6 +33,7 @@ #include "vg_symtab2.h" =20 #include "pub_core_aspacemgr.h" +#include "pub_core_skiplist.h" =20 /*------------------------------------------------------------*/ /*--- General purpose redirection. ---*/ Deleted: trunk/coregrind/vg_skiplist.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/coregrind/vg_skiplist.c 2005-05-12 03:51:15 UTC (rev 3670) +++ trunk/coregrind/vg_skiplist.c 2005-05-12 04:37:27 UTC (rev 3671) @@ -1,501 +0,0 @@ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2002-2005 Jeremy Fitzhardinge - je...@go... - - 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., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -/*=20 - This file implements a generic skip-list type. - - Skip-lists are described in William Pugh, Skip Lists: A - Probabilistic Alternative to Balanced Trees, CACM, 33(6):668-676, - June 1990.=20 - http://www.cs.unc.edu/~baruah/Teaching/2002f/HandOuts/skiplist-CACM.p= df - - Skip-lists are a randomized linked-list, where a node in the list - has at least one "next" pointer, but may have more. When - traversing the list, the "higher" next pointers allow you to skip - multiple list entries, allowing you to find the right place - quickly. =20 - - On average, 1/2 the entries have one next pointer, 1/4 have 2, 1/8 - have 3, etc. This means that the skiplist has the same search - complexity as a balanced binary tree, but there is no need to - rebalance or do any other structural changes. The randomness also - means that it is invulnerable to pathalogical workloads. - - Because the each node can be a different size, this implementation - puts the SkipNode structure at the end of the allocation, with the - node data starting at the beginning. - - low address ->+---------------+ ^ - | list data | | - key offset->: key : structure size - | | | - +---------------+ V - | struct | - | SkipNode | - +- - - - - - - -+ - | next pointers | - : : - - - When you declare the list with VG_SKIPLIST_INIT, you specify the - structure for each list node, structure member you want to use as a - key, and the function for comparing keys. - - Each node must be allocated with SkipNode_Alloc, which allocates - enough space for the client data, the SkipNode structure, and the - next pointers for this node. - - The helper functions data_of_node and node_of_data do the correct - pointer arithmetic to sort all this out. The SkipNode also has a - magic number which is checked after each operation to make sure - that we're really operating on a SkipNode. - - The first node of the list, the head node, is special. It contains - the maximum number of next pointers (SK_MAXHEIGHT). It has no data - associated with it, and it always compares less-than to all other - nodes. Because it has no data attached to it, it is always an - error to try and use data_of_node on it. To detect this problem, - it has a different magic number from all other SkipNodes so that it - won't be accidentally used. - */ - -#include "core.h" - -#include <stdlib.h> - -#define SKIPLIST_DEBUG 0 - -#define SK_MAXHEIGHT 20 /* 2^20 elements */ -#define SKIPLIST_MAGIC 0x5b1ff872 -#define SKIPLIST_HEAD_MAGIC (~SKIPLIST_MAGIC) - - -#if SKIPLIST_DEBUG -#define inline -#endif /* SKIPLIST_DEBUG */ - -struct _SkipNode { - UInt magic; - UShort level; /* level is the max level (level =3D=3D 0 means 1 next= pointer) */ - SkipNode *next[0]; -}; - - -/*=20 - Compute the height of a new node. 1/2 will be 1, 1/4 2, 1/8 3, - etc. - */ -static inline Int get_height(void) -{ - UInt ret =3D 0; - - while((ret < SK_MAXHEIGHT - 1) && (random() & 1)) - ret++; - - return ret; -} - -/*=20 - Given a pointer to the node's data, return a pointer to the key. - */ -static inline void *key_of_data(const SkipList *l, void *d) -{ - return (void *)((Char *)d + l->keyoff); -} - -/*=20 - Given a pointer to the node's data, return the pointer to the SkipNod= e - structure. If the node has a bad magic number, it will die with an - assertion failure. - */ -static inline SkipNode *node_of_data(const SkipList *l, const void *d) -{ - SkipNode *n =3D (SkipNode *)((Char *)d + l->size); - - if (SKIPLIST_DEBUG && n->magic !=3D SKIPLIST_MAGIC) - VG_(printf)("bad magic on node %p =3D %x (not %x)\n", - n, n->magic, SKIPLIST_MAGIC); - - vg_assert(n->magic =3D=3D SKIPLIST_MAGIC); - - return n;=20 -} - -/*=20 - Given a SkipNode structure, return the pointer to the node's data. - */ -static inline void *data_of_node(const SkipList *l, const SkipNode *n) -{ - if (SKIPLIST_DEBUG && n->magic !=3D SKIPLIST_MAGIC) - VG_(printf)("bad magic on node %p =3D %x (not %x)\n", - n, n->magic, SKIPLIST_MAGIC); - - vg_assert(n->magic =3D=3D SKIPLIST_MAGIC); - return (void *)((Char *)n - l->size); -} - -/*=20 - Given a SkipNode structure, return the pointer to the node's key. - */ -static inline void *key_of_node(const SkipList *l, const SkipNode *n) -{ - return key_of_data(l, data_of_node(l, n)); -} - -static inline void validate_skiplist(const SkipList *l, const Char *wher= e) -{ -#if SKIPLIST_DEBUG - const SkipNode *prev[SK_MAXHEIGHT]; - Int i; - const SkipNode *n, *next; - =20 - VG_(printf)("---------------- %s ----------------\n", where); - - if (l->head =3D=3D NULL) - return; - - for(i =3D 0; i <=3D l->head->level; i++) { - VG_(printf)("l->head->next[%d]=3D%p\n", - i, l->head->next[i]); - prev[i] =3D l->head->next[i]; - } - - for(n =3D l->head->next[0]; n !=3D NULL; n =3D next) { - next =3D n->next[0]; - - VG_(printf)("n=3D%p next=3D%p, n->level=3D%d k=3D%s\n", - n, next, n->level, (*l->strkey)(key_of_node(l, n))); - for(i =3D 0; i <=3D n->level; i++) { - VG_(printf)(" n->next[%d] =3D %p\n", - i, n->next[i]); - VG_(printf)(" prev[%d] =3D %p\n", - i, prev[i]); - } - =20 - vg_assert(l->head->level >=3D n->level); - - for(i =3D 0; i <=3D n->level; i++) - vg_assert(prev[i] =3D=3D n); - - for(i =3D 0; i <=3D n->level; i++) - prev[i] =3D n->next[i]; - - vg_assert(next =3D=3D NULL || (l->cmp)(key_of_node(l, n), key_of_n= ode(l, next)) < 0); - } -#endif /* SKIPLIST_DEBUG */ -} - -void *VG_(SkipNode_Alloc)(const SkipList *l) -{ - UInt size; - Int h; - SkipNode *n; - Char *ret; - - h =3D get_height(); - - size =3D l->size; - size +=3D sizeof(SkipNode) + (h+1)*sizeof(SkipNode *); - - if (l->arena =3D=3D -1) - *(Short *)&l->arena =3D VG_AR_TOOL; - - ret =3D VG_(arena_malloc)(l->arena, size); - - if (ret =3D=3D NULL) - return NULL; - - n =3D (SkipNode *)(ret + l->size); - n->level =3D h; - n->magic =3D SKIPLIST_MAGIC; - - VG_(memset)(n->next, 0, sizeof(n->next[0]) * (h+1)); - - return ret; -} - -void VG_(SkipNode_Free)(const SkipList *l, void *p) -{ - if (SKIPLIST_DEBUG) { - SkipNode *n =3D node_of_data(l, p); - - VG_(printf)("SkipNode_Free: freeing %p (node %p)\n", - p, n); - n->magic =3D 0x55ffaabb; - } - VG_(arena_free)(l->arena, p); -} - -void *VG_(SkipNode_First)(const SkipList *l) -{ - SkipNode *n =3D l->head ? l->head->next[0] : NULL; - - if (n =3D=3D NULL) - return NULL; - else - return data_of_node(l, n); -} - -void *VG_(SkipNode_Next)(const SkipList *l, void *data) -{ - SkipNode *n =3D node_of_data(l, data); - =20 - n =3D n->next[0]; - - if (n =3D=3D NULL) - return NULL; - - return data_of_node(l, n); -} - - - -static Int cmp(const SkipList *l, SkipNode *n, void *k2) -{ - void *k1 =3D key_of_node(l, n); - - if (k1 =3D=3D k2) - return 0; - - if (l->head =3D=3D n) - return -1; - - return (l->cmp)(k1, k2); -} - -/* Search the list for k; it either returns the k if it exists, or the - one before if not. */ -static SkipNode *SkipList__Find(const SkipList *l, void *k, SkipNode **p= revs) -{ - SkipNode *n; - Int lvl; - - if (SKIPLIST_DEBUG) - VG_(printf)("SkipList__Find: finding %s\n", (*l->strkey)(k)); - - validate_skiplist(l, "SkipList__Find"); - - if (l->head =3D=3D NULL) - return NULL; - - for(lvl =3D l->head->level, n =3D l->head; lvl >=3D 0; lvl--) { - while(n->next[lvl] !=3D NULL && cmp(l, n->next[lvl], k) < 0) { - if (SKIPLIST_DEBUG) - VG_(printf)("SkipList__Find: n=3D%p n->next[%d]=3D%p\n", - n, lvl, n->next[lvl]); - n =3D n->next[lvl]; - } - if (prevs) - prevs[lvl] =3D n; - } - - /* XXX Is there a cleaner way of getting this?=20 - =20 - If we get an exact match, return it. - If we get the head, return NULL. - Otherwise return the one before where the hit would be. - */ - if (n->next[0] !=3D NULL && cmp(l, n->next[0], k) =3D=3D 0) - n =3D n->next[0]; - if (n =3D=3D l->head) - n =3D NULL; - - if (SKIPLIST_DEBUG) { - - VG_(printf)("SkipList__Find returning node %p\n", n); - - if (n =3D=3D NULL) { - SkipNode *nn; - - for(nn =3D l->head->next[0]; nn !=3D NULL; nn =3D nn->next[0]) - vg_assert(cmp(l, nn, k) !=3D 0); - } else - vg_assert(cmp(l, n, k) <=3D 0); - } - - return n; -} - -/* Return list element which is <=3D k, or NULL if there is none. */ -void *VG_(SkipList_Find_Before)(const SkipList *l, void *k) -{ - SkipNode *n =3D SkipList__Find(l, k, NULL); - - if (n !=3D NULL) - return data_of_node(l, n); - return NULL; -} - -/* Return the list element which =3D=3D k, or NULL if none */ -void *VG_(SkipList_Find_Exact)(const SkipList *l, void *k) -{ - SkipNode *n =3D SkipList__Find(l, k, NULL); - - if (n !=3D NULL && (l->cmp)(key_of_node(l, n), k) =3D=3D 0) - return data_of_node(l, n); - return NULL; -} - -/* Return the list element which is >=3D k, or NULL if none */ -void *VG_(SkipList_Find_After)(const SkipList *l, void *k) -{ - SkipNode *n =3D SkipList__Find(l, k, NULL); - - if (n !=3D NULL && (l->cmp)(key_of_node(l, n), k) < 0) - n =3D n->next[0]; - - if (n !=3D NULL) - return data_of_node(l, n); - - return NULL; -} - -void VG_(SkipList_Insert)(SkipList *l, void *data) -{ - SkipNode *update[SK_MAXHEIGHT]; - SkipNode *n, *nn; - void *k =3D key_of_data(l, data); - Int i; - - if (SKIPLIST_DEBUG) - VG_(printf)("inserting node %p, key %s, height %d\n", - data, (*l->strkey)(key_of_data(l, data)), node_of_data(l, data)->lev= el); - - validate_skiplist(l, "SkipList_Insert before"); - - if (l->head =3D=3D NULL) { - Int size =3D sizeof(SkipNode) + sizeof(SkipNode *) * SK_MAXHEIGHT; - - if (l->arena =3D=3D -1) - *(Short *)&l->arena =3D VG_AR_TOOL; - =20 - l->head =3D VG_(arena_malloc)(l->arena, size); - VG_(memset)(l->head, 0, size); - - l->head->magic =3D SKIPLIST_HEAD_MAGIC; - l->head->level =3D 0; - } - - n =3D node_of_data(l, data); - - /* update size of head's next vector to fit this new node */ - vg_assert(l->head !=3D NULL); - if (l->head->level < n->level) { - for(i =3D l->head->level+1; i <=3D n->level; i++) - l->head->next[i] =3D NULL; - l->head->level =3D n->level; - } - - /* Look for the node, but we're mostly interested in setting - "update", which is the set of previous nodes with next pointers - we need to fix up. */ - nn =3D SkipList__Find(l, k, update); - =20 - /* check the new entry is unique */ - vg_assert(nn =3D=3D NULL || (l->cmp)(key_of_node(l, nn), k) !=3D 0); - - /* update the previous node's next pointers */ - for(i =3D 0; i <=3D n->level; i++) { - n->next[i] =3D update[i]->next[i]; - update[i]->next[i] =3D n; - } - - validate_skiplist(l, "SkipList_Insert after"); -} - -void *VG_(SkipList_Remove)(SkipList *l, void *k) -{ - SkipNode *update[SK_MAXHEIGHT]; - SkipNode *n; - Int i; - =20 - validate_skiplist(l, "SkipList_Remove before"); - - n =3D SkipList__Find(l, k, update); - if (n =3D=3D NULL) - return NULL; - - vg_assert((l->cmp)(k, key_of_node(l, n)) =3D=3D 0); - - for(i =3D 0; i <=3D n->level; i++) { - update[i]->next[i] =3D n->next[i]; - n->next[i] =3D NULL; - } - - validate_skiplist(l, "SkipList_Remove after"); - - return data_of_node(l, n); -} - - -/* -------------------------------------------------- - Comparison functions - -------------------------------------------------- */ -Int VG_(cmp_Int)(const void *v1, const void *v2) -{ - Int a =3D *(const Int *)v1; - Int b =3D *(const Int *)v2; - - if (a < b) - return -1; - if (a =3D=3D b) - return 0; - return 1; -} - -Int VG_(cmp_UInt)(const void *v1, const void *v2) -{ - UInt a =3D *(const UInt *)v1; - UInt b =3D *(const UInt *)v2; - - if (a < b) - return -1; - if (a =3D=3D b) - return 0; - return 1; -} - -Int VG_(cmp_Addr)(const void *v1, const void *v2) -{ - Addr a =3D *(const Addr *)v1; - Addr b =3D *(const Addr *)v2; - - if (a < b) - return -1; - if (a =3D=3D b) - return 0; - return 1; -} - -Int VG_(cmp_string)(const void *v1, const void *v2) -{ - const Char *a =3D *(const Char **)v1; - const Char *b =3D *(const Char **)v2; - - return VG_(strcmp)(a, b); -} - - Modified: trunk/include/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/include/Makefile.am 2005-05-12 03:51:15 UTC (rev 3670) +++ trunk/include/Makefile.am 2005-05-12 04:37:27 UTC (rev 3671) @@ -16,6 +16,7 @@ pub_tool_execontext.h \ pub_tool_mallocfree.h \ pub_tool_replacemalloc.h\ + pub_tool_skiplist.h \ pub_tool_stacktrace.h \ pub_tool_tooliface.h \ valgrind.h Added: trunk/include/pub_tool_skiplist.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/include/pub_tool_skiplist.h 2005-05-12 03:51:15 UTC (rev 3670) +++ trunk/include/pub_tool_skiplist.h 2005-05-12 04:37:27 UTC (rev 3671) @@ -0,0 +1,120 @@ + +/*--------------------------------------------------------------------*/ +/*--- SkipList: a skiplist implementaiton. pub_tool_skiplist.h ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2000-2005 Julian Seward + js...@ac... + + 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., 59 Temple Place, Suite 330, Boston, MA + 02111-1307, USA. + + The GNU General Public License is contained in the file COPYING. +*/ + +#ifndef __PUB_TOOL_SKIPLIST_H +#define __PUB_TOOL_SKIPLIST_H + +/*=20 + The idea here is that the skiplist puts its per-element data at the + end of the structure. When you initialize the skiplist, you tell + it what structure your list elements are going to be. Then you + should allocate them with VG_(SkipNode_Alloc), which will allocate + enough memory for the extra bits. + */ + +typedef struct _SkipList SkipList; +typedef struct _SkipNode SkipNode; + +typedef Int (*SkipCmp_t)(const void *key1, const void *key2); + +struct _SkipList { + const Short arena; // allocation arena + const UShort size; // structure size (excluding Skip= Node) + const UShort keyoff; // key offset + const SkipCmp_t cmp; // compare two keys + Char * (*strkey)(void *); // stringify a key (for debugging= ) + SkipNode *head; // list head +}; + +/* Use this macro to initialize your skiplist head. The arguments are p= retty self explanitory: + _type is the type of your element structure + _key is the field within that type which you want to use as the key + _cmp is the comparison function for keys - it gets two typeof(_key) p= ointers as args + _strkey is a function which can return a string of your key - it's on= ly used for debugging + _arena is the arena to use for allocation - -1 is the default + */ +#define VG_SKIPLIST_INIT(_type, _key, _cmp, _strkey, _arena) \ + { \ + .arena =3D _arena, \ + .size =3D sizeof(_type), \ + .keyoff =3D offsetof(_type, _key), \ + .cmp =3D _cmp, \ + .strkey =3D _strkey, \ + .head =3D NULL, \ + } + +/* List operations: + SkipList_Find_* search a list. The 3 variants are: + Before: returns a node which is <=3D key, or NULL if none + Exact: returns a node which is =3D=3D key, or NULL if none + After: returns a node which is >=3D key, or NULL if none + SkipList_Insert inserts a new element into the list. Duplicates are + forbidden. The element must have been created with SkipList_Alloc= ! + SkipList_Remove removes an element from the list and returns it. It + doesn't free the memory. +*/ +extern void *VG_(SkipList_Find_Before) (const SkipList *l, void *key); +extern void *VG_(SkipList_Find_Exact) (const SkipList *l, void *key); +extern void *VG_(SkipList_Find_After) (const SkipList *l, void *key); +extern void VG_(SkipList_Insert) ( SkipList *l, void *data); +extern void *VG_(SkipList_Remove) ( SkipList *l, void *key); + +/* Some useful standard comparisons */ +extern Int VG_(cmp_Addr) (const void *a, const void *b); +extern Int VG_(cmp_Int) (const void *a, const void *b); +extern Int VG_(cmp_UInt) (const void *a, const void *b); +extern Int VG_(cmp_string)(const void *a, const void *b); + +/* Node (element) operations: + SkipNode_Alloc: allocate memory for a new element on the list. Must = be + used before an element can be inserted! Returns NULL if not enoug= h + memory. + SkipNode_Free: free memory allocated above + SkipNode_First: return the first element on the list + SkipNode_Next: return the next element after "data" on the list -=20 + NULL for none + + You can iterate through a SkipList like this: + + for(x =3D VG_(SkipNode_First)(&list); // or SkipList_Find + x !=3D NULL; + x =3D VG_(SkipNode_Next)(&list, x)) { ... } +*/ +extern void *VG_(SkipNode_Alloc) (const SkipList *l); +extern void VG_(SkipNode_Free) (const SkipList *l, void *p); +extern void *VG_(SkipNode_First) (const SkipList *l); +extern void *VG_(SkipNode_Next) (const SkipList *l, void *data); + + +#endif // __PUB_TOOL_SKIPLIST_H + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ Modified: trunk/include/tool.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/include/tool.h 2005-05-12 03:51:15 UTC (rev 3670) +++ trunk/include/tool.h 2005-05-12 04:37:27 UTC (rev 3671) @@ -635,92 +635,6 @@ =20 =20 /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ -/*=3D=3D=3D A generic skiplist = =3D=3D=3D*/ -/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ - -/*=20 - The idea here is that the skiplist puts its per-element data at the - end of the structure. When you initialize the skiplist, you tell - it what structure your list elements are going to be. Then you - should allocate them with VG_(SkipNode_Alloc), which will allocate - enough memory for the extra bits. - */ - -typedef struct _SkipList SkipList; -typedef struct _SkipNode SkipNode; - -typedef Int (*SkipCmp_t)(const void *key1, const void *key2); - -struct _SkipList { - const Short arena; /* allocation arena */ - const UShort size; /* structure size (not including SkipNode) */ - const UShort keyoff; /* key offset */ - const SkipCmp_t cmp; /* compare two keys */ - Char * (*strkey)(void *); /* stringify a key (for debugging) */ - SkipNode *head; /* list head */ -}; - -/* Use this macro to initialize your skiplist head. The arguments are p= retty self explanitory: - _type is the type of your element structure - _key is the field within that type which you want to use as the key - _cmp is the comparison function for keys - it gets two typeof(_key) p= ointers as args - _strkey is a function which can return a string of your key - it's on= ly used for debugging - _arena is the arena to use for allocation - -1 is the default - */ -#define VG_SKIPLIST_INIT(_type, _key, _cmp, _strkey, _arena) \ - { \ - .arena =3D _arena, \ - .size =3D sizeof(_type), \ - .keyoff =3D offsetof(_type, _key), \ - .cmp =3D _cmp, \ - .strkey =3D _strkey, \ - .head =3D NULL, \ - } - -/* List operations: - SkipList_Find_* search a list. The 3 variants are: - Before: returns a node which is <=3D key, or NULL if none - Exact: returns a node which is =3D=3D key, or NULL if none - After: returns a node which is >=3D key, or NULL if none - SkipList_Insert inserts a new element into the list. Duplicates are - forbidden. The element must have been created with SkipList_Alloc= ! - SkipList_Remove removes an element from the list and returns it. It - doesn't free the memory. -*/ -extern void *VG_(SkipList_Find_Before) (const SkipList *l, void *key); -extern void *VG_(SkipList_Find_Exact) (const SkipList *l, void *key); -extern void *VG_(SkipList_Find_After) (const SkipList *l, void *key); -extern void VG_(SkipList_Insert) ( SkipList *l, void *data); -extern void *VG_(SkipList_Remove) ( SkipList *l, void *key); - -/* Some useful standard comparisons */ -extern Int VG_(cmp_Addr) (const void *a, const void *b); -extern Int VG_(cmp_Int) (const void *a, const void *b); -extern Int VG_(cmp_UInt) (const void *a, const void *b); -extern Int VG_(cmp_string)(const void *a, const void *b); - -/* Node (element) operations: - SkipNode_Alloc: allocate memory for a new element on the list. Must = be - used before an element can be inserted! Returns NULL if not enoug= h - memory. - SkipNode_Free: free memory allocated above - SkipNode_First: return the first element on the list - SkipNode_Next: return the next element after "data" on the list -=20 - NULL for none - - You can iterate through a SkipList like this: - - for(x =3D VG_(SkipNode_First)(&list); // or SkipList_Find - x !=3D NULL; - x =3D VG_(SkipNode_Next)(&list, x)) { ... } -*/ -extern void *VG_(SkipNode_Alloc) (const SkipList *l); -extern void VG_(SkipNode_Free) (const SkipList *l, void *p); -extern void *VG_(SkipNode_First) (const SkipList *l); -extern void *VG_(SkipNode_Next) (const SkipList *l, void *data); - - -/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /*=3D=3D=3D Functions for shadow registers = =3D=3D=3D*/ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ =20 |
|
From: <sv...@va...> - 2005-05-12 03:51:18
|
Author: njn
Date: 2005-05-12 04:51:15 +0100 (Thu, 12 May 2005)
New Revision: 3670
Modified:
trunk/coregrind/core.h
trunk/coregrind/vg_messages.c
trunk/coregrind/vg_mylibc.c
trunk/include/tool.h
Log:
Cleaned up vg_messages.c and related printf stuff. vg_messages.c is now =
a
layer above the printf stuff in vg_mylibc.c, which is layered over
m_debuglog. This makes the module interfaces neater, more consistent, an=
d
cuts 40 lines of code.
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/core.h 2005-05-12 03:47:31 UTC (rev 3669)
+++ trunk/coregrind/core.h 2005-05-12 03:51:15 UTC (rev 3670)
@@ -636,14 +636,6 @@
extern void VG_(nanosleep)(struct vki_timespec *);
=20
/* ---------------------------------------------------------------------
- Exports of vg_message.c
- ------------------------------------------------------------------ */
-
-/* Low-level -- send bytes directly to the message sink. Do not
- use. */
-extern void VG_(send_bytes_to_logging_sink) ( Char* msg, Int nbytes );
-
-/* ---------------------------------------------------------------------
Exports of vg_translate.c
------------------------------------------------------------------ */
=20
Modified: trunk/coregrind/vg_messages.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/coregrind/vg_messages.c 2005-05-12 03:47:31 UTC (rev 3669)
+++ trunk/coregrind/vg_messages.c 2005-05-12 03:51:15 UTC (rev 3670)
@@ -29,66 +29,18 @@
The GNU General Public License is contained in the file COPYING.
*/
=20
-
#include "core.h"
-#include "pub_core_debuglog.h" /* VG_(debugLog_vprintf) */
=20
#include <time.h>
#include <sys/time.h>
=20
-/* Size of a buffer used for creating messages. */
-#define M_MSGBUF 10000
-
-static char mbuf[M_MSGBUF];
-static int n_mbuf;
-
-static void add_to_buf ( HChar c, void *p )
+UInt VG_(vmessage) ( VgMsgKind kind, const Char* format, va_list vargs )
{
- if (n_mbuf >=3D (M_MSGBUF-1)) return;
- mbuf[n_mbuf++] =3D c;
- mbuf[n_mbuf] =3D 0;
-}
-
-static void add_timestamp ( Char *buf )
-{
- struct timeval tv;
- struct tm tm;
- =20
- if ( gettimeofday( &tv, NULL ) =3D=3D 0 &&
- localtime_r( &tv.tv_sec, &tm ) =3D=3D &tm ) {
- VG_(sprintf)( buf, "%04d-%02d-%02d %02d:%02d:%02d.%03d ",
- tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
- tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec / 1000 =
);
- }
- else {
- VG_(strcpy)( buf, "" );
- }
- =20
- return;
-}
-
-static int add_to_msg ( const Char *format, ... )
-{
- int count;
- va_list vargs;
- va_start(vargs,format);
- count =3D VG_(debugLog_vprintf) ( add_to_buf, NULL, format, vargs );
- va_end(vargs);
- return count;
-}
-
-static int start_msg ( VgMsgKind kind )
-{
- Char ts[32];
- Char c;
+ UInt count =3D 0;
+ Char c;
+ const Char* pfx_s;
static const Char pfx[] =3D ">>>>>>>>>>>>>>>>";
- n_mbuf =3D 0;
- mbuf[n_mbuf] =3D 0;
=20
- if (VG_(clo_time_stamp))
- add_timestamp(ts);
- else
- VG_(strcpy)(ts, "");
switch (kind) {
case Vg_UserMsg: c =3D '=3D'; break;
case Vg_DebugMsg: c =3D '-'; break;
@@ -96,39 +48,40 @@
case Vg_ClientMsg: c =3D '*'; break;
default: c =3D '?'; break;
}
+
// The pfx trick prints one or more '>' characters in front of the
// messages when running Valgrind under Valgrind, one per level of
// self-hosting.
- return add_to_msg( "%s%c%c%s%d%c%c ",=20
- &pfx[sizeof(pfx)-1-RUNNING_ON_VALGRIND],
- c,c, ts, VG_(getpid)(), c,c );
-}
+ pfx_s =3D &pfx[sizeof(pfx)-1-RUNNING_ON_VALGRIND],
=20
-static=20
-int end_msg ( void )
-{
- int count =3D 0;
- if (VG_(clo_log_fd) >=3D 0) {
- add_to_buf('\n',0);
- VG_(send_bytes_to_logging_sink) ( mbuf, VG_(strlen)(mbuf) );
- count =3D 1;
+ // Print the message
+ count =3D 0;
+ count +=3D VG_(printf) ("%s%c%c", pfx_s, c,c);
+
+ if (VG_(clo_time_stamp)) {
+ struct timeval tv;
+ struct tm tm;
+ =20
+ if ( gettimeofday( &tv, NULL ) =3D=3D 0 &&
+ localtime_r( &tv.tv_sec, &tm ) =3D=3D &tm )
+ {
+ count +=3D
+ VG_(printf)( "%04d-%02d-%02d %02d:%02d:%02d.%03d ",
+ tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec / =
1000 );
+ }
}
- return count;
-}
=20
-int VG_(vmessage) ( VgMsgKind kind, const Char* format, va_list vargs )
-{
- int count;
- count =3D start_msg ( kind );
- count +=3D VG_(debugLog_vprintf) ( add_to_buf, NULL, format, vargs );
- count +=3D end_msg();
+ count +=3D VG_(printf) ("%d%c%c ", VG_(getpid)(), c,c);
+ count +=3D VG_(vprintf)(format, vargs);
+ count +=3D VG_(printf) ("\n");
return count;
}
=20
/* Send a simple single-part message. */
-int VG_(message) ( VgMsgKind kind, const Char* format, ... )
+UInt VG_(message) ( VgMsgKind kind, const Char* format, ... )
{
- int count;
+ UInt count;
va_list vargs;
va_start(vargs,format);
count =3D VG_(vmessage) ( kind, format, vargs );
@@ -136,25 +89,6 @@
return count;
}
=20
-/* Do the low-level send of a message to the logging sink. */
-void VG_(send_bytes_to_logging_sink) ( Char* msg, Int nbytes )
-{
- Int rc;
- if (VG_(logging_to_filedes)) {
- VG_(write)( VG_(clo_log_fd), msg, nbytes );
- } else {
- rc =3D VG_(write_socket)( VG_(clo_log_fd), msg, nbytes );
- if (rc =3D=3D -1) {
- /* for example, the listener process died. Switch back to
- stderr. */
- VG_(logging_to_filedes) =3D True;
- VG_(clo_log_to) =3D VgLogTo_Fd;
- VG_(clo_log_fd) =3D 2;
- VG_(write)( VG_(clo_log_fd), msg, nbytes );
- }
- }
-}
-
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_mylibc.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/coregrind/vg_mylibc.c 2005-05-12 03:47:31 UTC (rev 3669)
+++ trunk/coregrind/vg_mylibc.c 2005-05-12 03:51:15 UTC (rev 3670)
@@ -390,41 +390,67 @@
debugging info should be sent via here. The official route is to
to use vg_message(). This interface is deprecated.
*/
+
+/* Do the low-level send of a message to the logging sink. */
+static void send_bytes_to_logging_sink ( Char* msg, Int nbytes )
+{
+ if (VG_(logging_to_filedes)) {
+ VG_(write)( VG_(clo_log_fd), msg, nbytes );
+ } else {
+ Int rc =3D VG_(write_socket)( VG_(clo_log_fd), msg, nbytes );
+ if (rc =3D=3D -1) {
+ // For example, the listener process died. Switch back to stde=
rr.
+ VG_(logging_to_filedes) =3D True;
+ VG_(clo_log_to) =3D VgLogTo_Fd;
+ VG_(clo_log_fd) =3D 2;
+ VG_(write)( VG_(clo_log_fd), msg, nbytes );
+ }
+ }
+}
+
typedef struct {
char buf[100];
int n;
} printf_buf;
=20
+// Adds a single char to the buffer. When the buffer gets sufficiently
+// full, we write its contents to the logging sink.
static void add_to_myprintf_buf ( HChar c, void *p )
{
printf_buf *myprintf_buf =3D (printf_buf *)p;
=20
if (myprintf_buf->n >=3D 100-10 /*paranoia*/ ) {
- if (VG_(clo_log_fd) >=3D 0) {
- VG_(send_bytes_to_logging_sink)(=20
- myprintf_buf->buf, VG_(strlen)(myprintf_buf->buf) );
- }
+ send_bytes_to_logging_sink( myprintf_buf->buf, myprintf_buf->n );
myprintf_buf->n =3D 0;
- myprintf_buf->buf[myprintf_buf->n] =3D 0; =20
}
myprintf_buf->buf[myprintf_buf->n++] =3D c;
- myprintf_buf->buf[myprintf_buf->n] =3D 0;
+ myprintf_buf->buf[myprintf_buf->n] =3D 0;
}
=20
+UInt VG_(vprintf) ( const char *format, va_list vargs )
+{
+ UInt ret =3D 0;
+ printf_buf myprintf_buf =3D {"",0};
+
+ if (VG_(clo_log_fd) >=3D 0) {
+ ret =3D VG_(debugLog_vprintf)=20
+ ( add_to_myprintf_buf, &myprintf_buf, format, vargs );
+
+ // Write out any chars left in the buffer.
+ if (myprintf_buf.n > 0) {
+ send_bytes_to_logging_sink( myprintf_buf.buf, myprintf_buf.n );
+ }
+ }
+ return ret;
+}
+
UInt VG_(printf) ( const char *format, ... )
{
UInt ret;
va_list vargs;
- printf_buf myprintf_buf =3D {"",0};
- va_start(vargs,format);
- =20
- ret =3D VG_(debugLog_vprintf)=20
- ( add_to_myprintf_buf, &myprintf_buf, format, vargs );
=20
- if (myprintf_buf.n > 0 && VG_(clo_log_fd) >=3D 0) {
- VG_(send_bytes_to_logging_sink)( myprintf_buf.buf, myprintf_buf.n =
);
- }
-
+ va_start(vargs, format);
+ ret =3D VG_(vprintf)(format, vargs);
va_end(vargs);
=20
return ret;
@@ -437,26 +463,33 @@
*(*vg_sprintf_ptr)++ =3D c;
}
=20
-UInt VG_(sprintf) ( Char* buf, Char *format, ... )
+UInt VG_(vsprintf) ( Char* buf, const Char *format, va_list vargs )
{
Int ret;
- va_list vargs;
Char *vg_sprintf_ptr =3D buf;
=20
- va_start(vargs,format);
-
ret =3D VG_(debugLog_vprintf)=20
( add_to_vg_sprintf_buf, &vg_sprintf_ptr, format, vargs );
- add_to_vg_sprintf_buf(0,&vg_sprintf_ptr);
+ add_to_vg_sprintf_buf('\0', &vg_sprintf_ptr);
=20
- va_end(vargs);
-
vg_assert(VG_(strlen)(buf) =3D=3D ret);
=20
return ret;
}
=20
+UInt VG_(sprintf) ( Char* buf, const Char *format, ... )
+{
+ UInt ret;
+ va_list vargs;
=20
+ va_start(vargs,format);
+ ret =3D VG_(vsprintf)(buf, format, vargs);
+ va_end(vargs);
+
+ return ret;
+}
+
+
/* ---------------------------------------------------------------------
Misc str* functions.
------------------------------------------------------------------ */
@@ -935,7 +968,7 @@
entered =3D True;
=20
va_start(vargs,format);
- VG_(debugLog_vprintf) ( add_to_vg_sprintf_buf, &bufptr, format, vargs=
);
+ VG_(vsprintf) ( bufptr, format, vargs );
add_to_vg_sprintf_buf('\0', &bufptr);
va_end(vargs);
=20
Modified: trunk/include/tool.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/include/tool.h 2005-05-12 03:47:31 UTC (rev 3669)
+++ trunk/include/tool.h 2005-05-12 03:51:15 UTC (rev 3670)
@@ -139,8 +139,8 @@
VgMsgKind;
=20
/* Send a single-part message. Appends a newline. */
-extern int VG_(message) ( VgMsgKind kind, const Char* format, ... );
-extern int VG_(vmessage) ( VgMsgKind kind, const Char* format, va_list=
vargs );
+extern UInt VG_(message) ( VgMsgKind kind, const Char* format, ... );
+extern UInt VG_(vmessage) ( VgMsgKind kind, const Char* format, va_lis=
t vargs );
=20
=20
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
@@ -262,8 +262,10 @@
* Hence no need for VG_(fprintf)().
*/
extern UInt VG_(printf) ( const char *format, ... );
+extern UInt VG_(vprintf) ( const char *format, va_list vargs );
/* too noisy ... __attribute__ ((format (printf, 1, 2))) ; */
-extern UInt VG_(sprintf) ( Char* buf, Char *format, ... );
+extern UInt VG_(sprintf) ( Char* buf, const Char* format, ... );
+extern UInt VG_(vsprintf)( Char* buf, const Char* format, va_list vargs =
);
=20
extern Int VG_(rename) ( Char* old_name, Char* new_name );
=20
|
|
From: <sv...@va...> - 2005-05-12 03:47:35
|
Author: njn
Date: 2005-05-12 04:47:31 +0100 (Thu, 12 May 2005)
New Revision: 3669
Modified:
trunk/coregrind/core.h
trunk/coregrind/vg_scheduler.c
trunk/coregrind/vg_signals.c
Log:
Replace two exported functions with one.
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/core.h 2005-05-11 23:37:18 UTC (rev 3668)
+++ trunk/coregrind/core.h 2005-05-12 03:47:31 UTC (rev 3669)
@@ -546,11 +546,8 @@
vki_sigset_t* set,
vki_sigset_t* oldset );
=20
-/* Handy utilities to block/restore all host signals. */
-extern void VG_(block_all_host_signals)=20
- ( /* OUT */ vki_sigset_t* saved_mask );
-extern void VG_(restore_all_host_signals)=20
- ( /* IN */ vki_sigset_t* saved_mask );
+extern void VG_(clear_out_queued_signals)=20
+ ( ThreadId tid, /* OUT */ vki_sigset_t* saved_mask );
=20
extern void VG_(kill_self)(Int sigNo);
=20
Modified: trunk/coregrind/vg_scheduler.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/coregrind/vg_scheduler.c 2005-05-11 23:37:18 UTC (rev 3668)
+++ trunk/coregrind/vg_scheduler.c 2005-05-12 03:47:31 UTC (rev 3669)
@@ -578,13 +578,7 @@
VG_(threads)[tid].altstack.ss_size =3D 0;
VG_(threads)[tid].altstack.ss_flags =3D VKI_SS_DISABLE;
=20
- /* clear out queued signals */
- VG_(block_all_host_signals)(&savedmask);
- if (VG_(threads)[tid].sig_queue !=3D NULL) {
- VG_(arena_free)(VG_AR_CORE, VG_(threads)[tid].sig_queue);
- VG_(threads)[tid].sig_queue =3D NULL;
- }
- VG_(restore_all_host_signals)(&savedmask);
+ VG_(clear_out_queued_signals)(tid, &savedmask);
=20
VG_(threads)[tid].sched_jmpbuf_valid =3D False;
}
Modified: trunk/coregrind/vg_signals.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/coregrind/vg_signals.c 2005-05-11 23:37:18 UTC (rev 3668)
+++ trunk/coregrind/vg_signals.c 2005-05-12 03:47:31 UTC (rev 3669)
@@ -727,7 +727,7 @@
------------------------------------------------------------------ */
=20
/* Block all host signals, dumping the old mask in *saved_mask. */
-void VG_(block_all_host_signals) ( /* OUT */ vki_sigset_t* saved_mask )
+static void block_all_host_signals ( /* OUT */ vki_sigset_t* saved_mask =
)
{
Int ret;
vki_sigset_t block_procmask;
@@ -738,13 +738,23 @@
}
=20
/* Restore the blocking mask using the supplied saved one. */
-void VG_(restore_all_host_signals) ( /* IN */ vki_sigset_t* saved_mask )
+static void restore_all_host_signals ( /* IN */ vki_sigset_t* saved_mask=
)
{
Int ret;
ret =3D VG_(sigprocmask)(VKI_SIG_SETMASK, saved_mask, NULL);
vg_assert(ret =3D=3D 0);
}
=20
+void VG_(clear_out_queued_signals)( ThreadId tid, vki_sigset_t* saved_ma=
sk )
+{
+ block_all_host_signals(saved_mask);
+ if (VG_(threads)[tid].sig_queue !=3D NULL) {
+ VG_(arena_free)(VG_AR_CORE, VG_(threads)[tid].sig_queue);
+ VG_(threads)[tid].sig_queue =3D NULL;
+ }
+ restore_all_host_signals(saved_mask);
+}
+
Bool VG_(client_signal_OK)(Int sigNo)
{
/* signal 0 is OK for kill */
@@ -1552,7 +1562,7 @@
tst =3D VG_(get_ThreadState)(tid);
=20
/* Protect the signal queue against async deliveries */
- VG_(block_all_host_signals)(&savedmask);
+ block_all_host_signals(&savedmask);
=20
if (tst->sig_queue =3D=3D NULL) {
tst->sig_queue =3D VG_(arena_malloc)(VG_AR_CORE, sizeof(*tst->sig_=
queue));
@@ -1577,7 +1587,7 @@
sq->sigs[sq->next] =3D *si;
sq->next =3D (sq->next+1) % N_QUEUED_SIGNALS;
=20
- VG_(restore_all_host_signals)(&savedmask);
+ restore_all_host_signals(&savedmask);
}
=20
/*
@@ -2018,7 +2028,7 @@
=20
//VG_(printf)("tid %d pollset=3D%08x%08x\n", tid, pollset.sig[1], pol=
lset.sig[0]);
=20
- VG_(block_all_host_signals)(&saved_mask); // protect signal queue
+ block_all_host_signals(&saved_mask); // protect signal queue
=20
/* First look for any queued pending signals */
sip =3D next_queued(tid, &pollset); /* this thread */
@@ -2047,7 +2057,7 @@
where it came from */
}
=20
- VG_(restore_all_host_signals)(&saved_mask);
+ restore_all_host_signals(&saved_mask);
}
=20
/* At startup, copy the process' real signal state to the SCSS.
@@ -2064,7 +2074,7 @@
/* Block all signals. saved_procmask remembers the previous mask,
which the first thread inherits.
*/
- VG_(block_all_host_signals)( &saved_procmask );
+ block_all_host_signals( &saved_procmask );
=20
/* Copy per-signal settings to SCSS. */
for (i =3D 1; i <=3D _VKI_NSIG; i++) {
|
|
From: <js...@ac...> - 2005-05-12 03:03:35
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-05-12 03:50:01 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_mmx: valgrind ./insn_mmx insn_mmxext: (skipping, prereq failed: ../../../tests/cputest x86-mmxext) insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 201 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/writev (stderr) corecheck/tests/fdleak_fcntl (stderr) make: *** [regtest] Error 1 |