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
(32) |
2
(22) |
3
(47) |
4
(29) |
5
(18) |
6
(16) |
|
7
(21) |
8
(29) |
9
(23) |
10
(68) |
11
(20) |
12
(17) |
13
(17) |
|
14
(27) |
15
(26) |
16
(21) |
17
(13) |
18
(19) |
19
(29) |
20
(13) |
|
21
(9) |
22
(8) |
23
(29) |
24
(56) |
25
(21) |
26
(46) |
27
(33) |
|
28
(25) |
29
(41) |
30
(35) |
31
(28) |
|
|
|
|
From: <sv...@va...> - 2005-08-23 23:54:15
|
Author: sewardj Date: 2005-08-24 00:54:11 +0100 (Wed, 24 Aug 2005) New Revision: 4483 Log: Update. Modified: trunk/docs/internals/3_0_BUGSTATUS.txt Modified: trunk/docs/internals/3_0_BUGSTATUS.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/docs/internals/3_0_BUGSTATUS.txt 2005-08-23 23:52:54 UTC (rev 4= 482) +++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-23 23:54:11 UTC (rev 4= 483) @@ -323,7 +323,7 @@ =20 110685 amd64->IR: unhandled instruction bytes: 0xE1 0x56 (loope Jb) =20 -FIXED-TRUNK: TODO +FIXED-TRUNK: 1349 FIXED-30BRANCH: TODO =20 ---------------------------------------------------------------- |
|
From: <sv...@va...> - 2005-08-23 23:52:58
|
Author: sewardj
Date: 2005-08-24 00:52:54 +0100 (Wed, 24 Aug 2005)
New Revision: 4482
Log:
Add tests for amd64 LOOP{,E,NE} insn.
Added:
trunk/none/tests/amd64/looper.c
trunk/none/tests/amd64/looper.stderr.exp
trunk/none/tests/amd64/looper.stdout.exp
trunk/none/tests/amd64/looper.vgtest
Modified:
trunk/none/tests/amd64/Makefile.am
Modified: trunk/none/tests/amd64/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/amd64/Makefile.am 2005-08-23 23:20:46 UTC (rev 4481)
+++ trunk/none/tests/amd64/Makefile.am 2005-08-23 23:52:54 UTC (rev 4482)
@@ -8,10 +8,11 @@
$(addsuffix .stderr.exp,$(INSN_TESTS)) \
$(addsuffix .stdout.exp,$(INSN_TESTS)) \
$(addsuffix .vgtest,$(INSN_TESTS)) \
+ looper.stderr.exp looper.stdout.exp looper.vgtest \
smc1.stderr.exp smc1.stdout.exp smc1.vgtest
=20
check_PROGRAMS =3D \
- $(INSN_TESTS) smc1
+ $(INSN_TESTS) looper smc1
=20
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/inc=
lude
AM_CXXFLAGS =3D $(AM_CFLAGS)
Added: trunk/none/tests/amd64/looper.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/amd64/looper.c 2005-08-23 23:20:46 UTC (rev 4481)
+++ trunk/none/tests/amd64/looper.c 2005-08-23 23:52:54 UTC (rev 4482)
@@ -0,0 +1,82 @@
+
+#include <stdio.h>
+
+long long int arg =3D 0;
+long long int res =3D 0;
+
+extern void loop_plain ( void );
+asm("\n"
+".text\n"
+".globl loop_plain\n"
+"loop_plain:\n"
+"\tpushq %rcx\n"
+"\tmovq $999, %rax\n"
+"\tmovq arg, %rcx\n"
+
+".Lmn123plain:\n"
+"\tdecq %rax\n"
+"\tdecq %rax\n"
+"\tdecq %rax\n"
+"\tloop .Lmn123plain\n"
+
+"\tmovq %rax, res\n"
+"\tpopq %rcx\n"
+"\tret\n"
+);
+
+extern void loop_ne ( void );
+asm("\n"
+".text\n"
+".globl loop_ne\n"
+"loop_ne:\n"
+"\tpushq %rcx\n"
+"\tmovq $999, %rax\n"
+"\tmovq arg, %rcx\n"
+
+".Lmn123ne:\n"
+"\tdecq %rax\n"
+"\tdecq %rax\n"
+"\tdecq %rax\n"
+"\tloopne .Lmn123ne\n"
+
+"\tmovq %rax, res\n"
+"\tpopq %rcx\n"
+"\tret\n"
+);
+
+extern void loop_e ( void );
+asm("\n"
+".text\n"
+".globl loop_e\n"
+"loop_e:\n"
+"\tpushq %rcx\n"
+"\tmovq $999, %rax\n"
+"\tmovq arg, %rcx\n"
+
+".Lmn123e:\n"
+"\tdecq %rax\n"
+"\tdecq %rax\n"
+"\tdecq %rax\n"
+/* invert the Z flag */
+"\tpushfq\n"
+"\txorq $64, 0(%rsp)\n"
+"\tpopfq\n"
+"\tloope .Lmn123e\n"
+
+"\tmovq %rax, res\n"
+"\tpopq %rcx\n"
+"\tret\n"
+);
+
+int main ( void )
+{
+ res =3D 0; arg =3D 10; loop_plain(); printf("res =3D %lld\n", res);
+
+ res =3D 0; arg =3D 10; loop_ne(); printf("res =3D %lld\n", res);
+ res =3D 0; arg =3D 500; loop_ne(); printf("res =3D %lld\n", res);
+
+ res =3D 0; arg =3D 10; loop_e(); printf("res =3D %lld\n", res);
+ res =3D 0; arg =3D 500; loop_e(); printf("res =3D %lld\n", res);
+
+ return 0;
+}
Added: trunk/none/tests/amd64/looper.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/looper.stderr.exp 2005-08-23 23:20:46 UTC (rev=
4481)
+++ trunk/none/tests/amd64/looper.stderr.exp 2005-08-23 23:52:54 UTC (rev=
4482)
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/amd64/looper.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/looper.stdout.exp 2005-08-23 23:20:46 UTC (rev=
4481)
+++ trunk/none/tests/amd64/looper.stdout.exp 2005-08-23 23:52:54 UTC (rev=
4482)
@@ -0,0 +1,5 @@
+res =3D 969
+res =3D 969
+res =3D 0
+res =3D 969
+res =3D 0
Added: trunk/none/tests/amd64/looper.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/looper.vgtest 2005-08-23 23:20:46 UTC (rev 448=
1)
+++ trunk/none/tests/amd64/looper.vgtest 2005-08-23 23:52:54 UTC (rev 448=
2)
@@ -0,0 +1 @@
+prog: looper
|
|
From: <sv...@va...> - 2005-08-23 23:44:37
|
Author: sewardj
Date: 2005-08-24 00:44:35 +0100 (Wed, 24 Aug 2005)
New Revision: 1349
Log:
Implement LOOP{,E,NE}.
Modified:
trunk/priv/guest-amd64/toIR.c
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-08-23 23:26:37 UTC (rev 1348)
+++ trunk/priv/guest-amd64/toIR.c 2005-08-23 23:44:35 UTC (rev 1349)
@@ -1302,9 +1302,19 @@
return IRExpr_Const(IRConst_V128(mask));
}
=20
+static IRExpr* mkAnd1 ( IRExpr* x, IRExpr* y )
+{
+ vassert(typeOfIRExpr(irbb->tyenv,x) =3D=3D Ity_I1);
+ vassert(typeOfIRExpr(irbb->tyenv,y) =3D=3D Ity_I1);
+ return unop(Iop_64to1,=20
+ binop(Iop_And64,=20
+ unop(Iop_1Uto64,x),=20
+ unop(Iop_1Uto64,y)));
+}
=20
+
/*------------------------------------------------------------*/
-/*--- Helpers for %eflags. ---*/
+/*--- Helpers for %rflags. ---*/
/*------------------------------------------------------------*/
=20
/* -------------- Evaluating the flags-thunk. -------------- */
@@ -11577,45 +11587,47 @@
//..=20
//.. DIP("j%sz 0x%x\n", nameIReg(sz, R_ECX), d32);
//.. break;
-//..=20
-//.. //-- case 0xE0: /* LOOPNE disp8 */
-//.. //-- case 0xE1: /* LOOPE disp8 */
- case 0xE2: /* LOOP disp8 */
- /* The docs say this uses RCX/ECX as a count depending on
- the address size override, not the operand one. Since we
- don't handle address size overrides, I guess that means
- RCX. */
- if (!haveF3(pfx) && !haveF2(pfx) && !have66(pfx) && !haveASO(pfx))=
{
- /* RCX--; if (RCX !=3D 0) goto d64; */
- d64 =3D guest_RIP_curr_instr + getSDisp8(delta) + 2; delta++;
- DIP("loop 0x%llx\n", (ULong)d64);
- putIReg64(R_RCX, binop(Iop_Sub64, getIReg64(R_RCX), mkU64(1)) )=
;
- stmt( IRStmt_Exit(=20
- binop(Iop_CmpNE64,getIReg64(R_RCX),mkU64(0)),=20
- Ijk_Boring,=20
- IRConst_U64(d64)=20
- ));
- dres.whatNext =3D Dis_StopHere;
- irbb->next =3D mkU64(guest_RIP_curr_instr + 2);
- irbb->jumpkind =3D Ijk_Boring;
- break;
+
+ case 0xE0: /* LOOPNE disp8: decrement count, jump if count !=3D 0 && =
ZF=3D=3D0 */
+ case 0xE1: /* LOOPE disp8: decrement count, jump if count !=3D 0 && =
ZF=3D=3D1 */
+ case 0xE2: /* LOOP disp8: decrement count, jump if count !=3D 0 */
+ { /* The docs say this uses rCX as a count depending on the
+ address size override, not the operand one. Since we don't
+ handle address size overrides, I guess that means RCX. */
+ IRExpr* zbit =3D NULL;
+ IRExpr* count =3D NULL;
+ IRExpr* cond =3D NULL;
+ HChar* xtra =3D NULL;
+
+ if (have66orF2orF3(pfx) || haveASO(pfx)) goto decode_failure;
+ d64 =3D guest_RIP_bbstart+delta+1 + getSDisp8(delta);
+ delta++;
+ putIReg64(R_RCX, binop(Iop_Sub64, getIReg64(R_RCX), mkU64(1)));
+
+ count =3D getIReg64(R_RCX);
+ cond =3D binop(Iop_CmpNE64, count, mkU64(0));
+ switch (opc) {
+ case 0xE2:=20
+ xtra =3D "";=20
+ break;
+ case 0xE1:=20
+ xtra =3D "e";=20
+ zbit =3D mk_amd64g_calculate_condition( AMD64CondZ );
+ cond =3D mkAnd1(cond, zbit);
+ break;
+ case 0xE0:=20
+ xtra =3D "ne";
+ zbit =3D mk_amd64g_calculate_condition( AMD64CondNZ );
+ cond =3D mkAnd1(cond, zbit);
+ break;
+ default:
+ vassert(0);
}
- goto decode_failure;
+ stmt( IRStmt_Exit(cond, Ijk_Boring, IRConst_U64(d64)) );
=20
-//.. //-- d32 =3D (eip+1) + getSDisp8(eip); eip++;
-//.. //-- t1 =3D newTemp(cb);
-//.. //-- uInstr2(cb, GET, 4, ArchReg, R_ECX, TempReg, t1);
-//.. //-- uInstr1(cb, DEC, 4, TempReg, t1);
-//.. //-- uInstr2(cb, PUT, 4, TempReg, t1, ArchReg, R_ECX);
-//.. //-- uInstr2(cb, JIFZ, 4, TempReg, t1, Literal, 0);
-//.. //-- uLiteral(cb, eip);
-//.. //-- if (opc =3D=3D 0xE0 || opc =3D=3D 0xE1) { /* LOOPE/LOO=
PNE */
-//.. //-- jcc_lit(cb, eip, (opc =3D=3D 0xE1 ? CondNZ : CondZ));
-//.. //-- }
-//.. //-- jmp_lit(cb, d32);
-//.. //-- whatNext =3D Dis_StopHere;
-//.. //-- DIP("loop 0x%x\n", d32);
-//.. //-- break;
+ DIP("loop%s 0x%llx\n", xtra, d64);
+ break;
+ }
=20
/* ------------------------ IMUL ----------------------- */
=20
|
|
From: <sv...@va...> - 2005-08-23 23:26:39
|
Author: sewardj
Date: 2005-08-24 00:26:37 +0100 (Wed, 24 Aug 2005)
New Revision: 1348
Log:
Rename a couple of inconsistently-named helper functions.
Modified:
trunk/priv/guest-amd64/gdefs.h
trunk/priv/guest-amd64/ghelpers.c
trunk/priv/guest-amd64/toIR.c
Modified: trunk/priv/guest-amd64/gdefs.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/priv/guest-amd64/gdefs.h 2005-08-23 23:17:38 UTC (rev 1347)
+++ trunk/priv/guest-amd64/gdefs.h 2005-08-23 23:26:37 UTC (rev 1348)
@@ -139,11 +139,11 @@
=20
/* --- DIRTY HELPERS --- */
=20
-extern ULong amd64g_loadF80le ( ULong/*addr*/ );
+extern ULong amd64g_dirtyhelper_loadF80le ( ULong/*addr*/ );
=20
-extern void amd64g_storeF80le ( ULong/*addr*/, ULong/*data*/ );
+extern void amd64g_dirtyhelper_storeF80le ( ULong/*addr*/, ULong/*data*=
/ );
=20
-extern void amd64g_dirtyhelper_CPUID ( VexGuestAMD64State* st );
+extern void amd64g_dirtyhelper_CPUID ( VexGuestAMD64State* st );
=20
extern ULong amd64g_dirtyhelper_RDTSC ( void );
=20
Modified: trunk/priv/guest-amd64/ghelpers.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-amd64/ghelpers.c 2005-08-23 23:17:38 UTC (rev 1347)
+++ trunk/priv/guest-amd64/ghelpers.c 2005-08-23 23:26:37 UTC (rev 1348)
@@ -1340,7 +1340,7 @@
=20
/* CALLED FROM GENERATED CODE */
/* DIRTY HELPER (reads guest memory) */
-ULong amd64g_loadF80le ( ULong addrU )
+ULong amd64g_dirtyhelper_loadF80le ( ULong addrU )
{
ULong f64;
convert_f80le_to_f64le ( (UChar*)ULong_to_Ptr(addrU), (UChar*)&f64 );
@@ -1349,7 +1349,7 @@
=20
/* CALLED FROM GENERATED CODE */
/* DIRTY HELPER (writes guest memory) */
-void amd64g_storeF80le ( ULong addrU, ULong f64 )
+void amd64g_dirtyhelper_storeF80le ( ULong addrU, ULong f64 )
{
convert_f64le_to_f80le( (UChar*)&f64, (UChar*)ULong_to_Ptr(addrU) );
}
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-08-23 23:17:38 UTC (rev 1347)
+++ trunk/priv/guest-amd64/toIR.c 2005-08-23 23:26:37 UTC (rev 1348)
@@ -4967,7 +4967,8 @@
IRDirty* d =3D unsafeIRDirty_1_N (=20
val,=20
0/*regparms*/,=20
- "amd64g_loadF80le", &amd64g_loadF80le,=20
+ "amd64g_dirtyhelper_loadF80le",=20
+ &amd64g_dirtyhelper_loadF80le,=20
args=20
);
/* declare that we're reading memory */
@@ -4994,7 +4995,8 @@
=20
IRDirty* d =3D unsafeIRDirty_0_N (=20
0/*regparms*/,=20
- "amd64g_storeF80le", &amd64g_storeF80le,
+ "amd64g_dirtyhelper_storeF80le",=20
+ &amd64g_dirtyhelper_storeF80le,
args=20
);
/* declare we're writing memory */
|
|
From: <sv...@va...> - 2005-08-23 23:20:47
|
Author: sewardj Date: 2005-08-24 00:20:46 +0100 (Wed, 24 Aug 2005) New Revision: 4481 Log: Update. Modified: trunk/docs/internals/3_0_BUGSTATUS.txt Modified: trunk/docs/internals/3_0_BUGSTATUS.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/docs/internals/3_0_BUGSTATUS.txt 2005-08-23 22:11:20 UTC (rev 4= 480) +++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-23 23:20:46 UTC (rev 4= 481) @@ -252,7 +252,7 @@ =20 Under consideration. (Also afflicts x86) =20 -FIXED-TRUNK: no +FIXED-TRUNK: 1344 (x86), 1346 (amd64). FIXED-30BRANCH: no =20 ---------------------------------------------------------------- |
|
From: <sv...@va...> - 2005-08-23 23:17:40
|
Author: sewardj
Date: 2005-08-24 00:17:38 +0100 (Wed, 24 Aug 2005)
New Revision: 1347
Log:
Whitespace-only change.
Modified:
trunk/priv/guest-x86/toIR.c
Modified: trunk/priv/guest-x86/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-x86/toIR.c 2005-08-23 23:16:51 UTC (rev 1346)
+++ trunk/priv/guest-x86/toIR.c 2005-08-23 23:17:38 UTC (rev 1347)
@@ -11979,12 +11979,12 @@
&x86g_dirtyhelper_RDTSC,=20
args=20
);
- /* execute the dirty call, dumping the result in val. */
- stmt( IRStmt_Dirty(d) );
- putIReg(4, R_EDX, unop(Iop_64HIto32, mkexpr(val)));
- putIReg(4, R_EAX, unop(Iop_64to32, mkexpr(val)));
- DIP("rdtsc\n");
- break;
+ /* execute the dirty call, dumping the result in val. */
+ stmt( IRStmt_Dirty(d) );
+ putIReg(4, R_EDX, unop(Iop_64HIto32, mkexpr(val)));
+ putIReg(4, R_EAX, unop(Iop_64to32, mkexpr(val)));
+ DIP("rdtsc\n");
+ break;
}
=20
/* =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- PUSH/POP Sreg =3D-=3D-=3D-=
=3D-=3D-=3D-=3D-=3D-=3D-=3D */
|
|
From: <sv...@va...> - 2005-08-23 23:17:01
|
Author: sewardj
Date: 2005-08-24 00:16:51 +0100 (Wed, 24 Aug 2005)
New Revision: 1346
Log:
Implement RDTSC (amd64).
Modified:
trunk/priv/guest-amd64/gdefs.h
trunk/priv/guest-amd64/ghelpers.c
trunk/priv/guest-amd64/toIR.c
Modified: trunk/priv/guest-amd64/gdefs.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/priv/guest-amd64/gdefs.h 2005-08-23 19:30:58 UTC (rev 1345)
+++ trunk/priv/guest-amd64/gdefs.h 2005-08-23 23:16:51 UTC (rev 1346)
@@ -145,6 +145,8 @@
=20
extern void amd64g_dirtyhelper_CPUID ( VexGuestAMD64State* st );
=20
+extern ULong amd64g_dirtyhelper_RDTSC ( void );
+
//extern void amd64g_dirtyhelper_CPUID_sse0 ( VexGuestAMD64State* );
//extern void amd64g_dirtyhelper_CPUID_sse1 ( VexGuestAMD64State* );
//extern void amd64g_dirtyhelper_CPUID_sse2 ( VexGuestAMD64State* );
Modified: trunk/priv/guest-amd64/ghelpers.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-amd64/ghelpers.c 2005-08-23 19:30:58 UTC (rev 1345)
+++ trunk/priv/guest-amd64/ghelpers.c 2005-08-23 23:16:51 UTC (rev 1346)
@@ -1676,6 +1676,21 @@
}
=20
=20
+/* CALLED FROM GENERATED CODE */
+/* DIRTY HELPER (non-referentially-transparent) */
+/* Horrible hack. On non-amd64 platforms, return 1. */
+ULong amd64g_dirtyhelper_RDTSC ( void )
+{
+# if defined(__x86_64__)
+ UInt eax, edx;
+ __asm__ __volatile__("rdtsc" : "=3Da" (eax), "=3Dd" (edx));
+ return (((ULong)edx) << 32) | ((ULong)eax);
+# else
+ return 1ULL;
+# endif
+}
+
+
/*---------------------------------------------------------------*/
/*--- Helpers for MMX/SSE/SSE2. ---*/
/*---------------------------------------------------------------*/
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-08-23 19:30:58 UTC (rev 1345)
+++ trunk/priv/guest-amd64/toIR.c 2005-08-23 23:16:51 UTC (rev 1346)
@@ -13084,35 +13084,24 @@
break;
=20
/* =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- RDTSC -=3D-=3D-=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D */
-
- case 0x31: /* RDTSC */
- if (haveF2orF3(pfx)) goto decode_failure;
- if (0) vex_printf("vex amd64->IR: kludged rdtsc\n");
- putIRegRAX(4, mkU32(1));
- putIRegRDX(4, mkU32(0));
-
-//.. //-- t1 =3D newTemp(cb);
-//.. //-- t2 =3D newTemp(cb);
-//.. //-- t3 =3D newTemp(cb);
-//.. //-- uInstr0(cb, CALLM_S, 0);
-//.. //-- // Nb: even though these args aren't used by RDTSC_he=
lper, need
-//.. //-- // them to be defined (for Memcheck). The TempRegs p=
ushed must
-//.. //-- // also be distinct.
-//.. //-- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t1);
-//.. //-- uLiteral(cb, 0);
-//.. //-- uInstr1(cb, PUSH, 4, TempReg, t1);
-//.. //-- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t2);
-//.. //-- uLiteral(cb, 0);
-//.. //-- uInstr1(cb, PUSH, 4, TempReg, t2);
-//.. //-- uInstr1(cb, CALLM, 0, Lit16, VGOFF_(helper_RDTSC));
-//.. //-- uFlagsRWU(cb, FlagsEmpty, FlagsEmpty, FlagsEmpty);
-//.. //-- uInstr1(cb, POP, 4, TempReg, t3);
-//.. //-- uInstr2(cb, PUT, 4, TempReg, t3, ArchReg, R_EDX);
-//.. //-- uInstr1(cb, POP, 4, TempReg, t3);
-//.. //-- uInstr2(cb, PUT, 4, TempReg, t3, ArchReg, R_EAX);
-//.. //-- uInstr0(cb, CALLM_E, 0);
+ case 0x31: { /* RDTSC */
+ IRTemp val =3D newTemp(Ity_I64);
+ IRExpr** args =3D mkIRExprVec_0();
+ IRDirty* d =3D unsafeIRDirty_1_N (=20
+ val,=20
+ 0/*regparms*/,=20
+ "amd64g_dirtyhelper_RDTSC",=20
+ &amd64g_dirtyhelper_RDTSC,=20
+ args=20
+ );
+ if (have66orF2orF3(pfx)) goto decode_failure;
+ /* execute the dirty call, dumping the result in val. */
+ stmt( IRStmt_Dirty(d) );
+ putIRegRDX(4, unop(Iop_64HIto32, mkexpr(val)));
+ putIRegRAX(4, unop(Iop_64to32, mkexpr(val)));
DIP("rdtsc\n");
break;
+ }
=20
//.. /* =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- PUSH/POP Sreg =3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D */
//..=20
|
|
From: <sv...@va...> - 2005-08-23 22:11:32
|
Author: njn
Date: 2005-08-23 23:11:20 +0100 (Tue, 23 Aug 2005)
New Revision: 4480
Log:
Make the allocator's access functions slightly stricter in their
checking of the lo/hi size fields. If we are corrupting the metadata,
this should make it more likely that we get an assertion failure rather
than an outright crash.
Modified:
trunk/coregrind/m_mallocfree.c
Modified: trunk/coregrind/m_mallocfree.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/m_mallocfree.c 2005-08-23 18:06:01 UTC (rev 4479)
+++ trunk/coregrind/m_mallocfree.c 2005-08-23 22:11:20 UTC (rev 4480)
@@ -170,48 +170,50 @@
return bszB & (~SIZE_T_0x1);
}
=20
-// Set get the lower size field of a block.
+//----------------------------------------------------------------------=
-----
+
+// Get a block's size as stored, ie with the in-use/free attribute.
static __inline__
-SizeT get_bszB_lo ( Block* b )
+SizeT get_bszB_as_is ( Block* b )
{
- return *(SizeT*)&b[0];
+ UByte* b2 =3D (UByte*)b;
+ SizeT bszB_lo =3D *(SizeT*)&b2[0];
+ SizeT bszB_hi =3D *(SizeT*)&b2[mk_plain_bszB(bszB_lo) - sizeof(SizeT)=
];
+ vg_assert2(bszB_lo =3D=3D bszB_hi,=20
+ "Heap block lo/hi size mismatch: lo =3D %llu, hi =3D %llu.\n"
+ "Probably caused by overrunning/underrunning a heap block's bounds=
\n");
+ return bszB_lo;
}
=20
-// Does this block have the in-use attribute?
+// Get a block's plain size, ie. remove the in-use/free attribute.
static __inline__
-Bool is_inuse_block ( Block* b )
+SizeT get_bszB ( Block* b )
{
- SizeT bszB =3D get_bszB_lo(b);
- vg_assert(bszB !=3D 0);
- return (0 !=3D (bszB & SIZE_T_0x1)) ? False : True;
+ return mk_plain_bszB(get_bszB_as_is(b));
}
=20
-// Get the address of the last byte in a block
+// Set the size fields of a block. bszB may have the in-use/free attrib=
ute.
static __inline__
-UByte* last_byte ( Block* b )
+void set_bszB ( Block* b, SizeT bszB )
{
UByte* b2 =3D (UByte*)b;
- return &b2[mk_plain_bszB(get_bszB_lo(b)) - 1];
+ *(SizeT*)&b2[0] =3D bszB;
+ *(SizeT*)&b2[mk_plain_bszB(bszB) - sizeof(SizeT)] =3D bszB;
}
=20
-// Get the upper size field of a block.
-static __inline__
-SizeT get_bszB_hi ( Block* b )
-{
- UByte* lb =3D last_byte(b);
- return *(SizeT*)&lb[-sizeof(SizeT) + 1];
-}
+//----------------------------------------------------------------------=
-----
=20
-// Set the size fields of a block.
+// Does this block have the in-use attribute?
static __inline__
-void set_bszB ( Block* b, SizeT bszB )
+Bool is_inuse_block ( Block* b )
{
- UByte* lb;
- *(SizeT*)&b[0] =3D bszB; // Set lo bszB; must precede last_byte(=
) call
- lb =3D last_byte(b);
- *(SizeT*)&lb[-sizeof(SizeT) + 1] =3D bszB; // Set hi bszB
+ SizeT bszB =3D get_bszB_as_is(b);
+ vg_assert(bszB !=3D 0);
+ return (0 !=3D (bszB & SIZE_T_0x1)) ? False : True;
}
=20
+//----------------------------------------------------------------------=
-----
+
// Return the lower, upper and total overhead in bytes for a block.
// These are determined purely by which arena the block lives in.
static __inline__
@@ -230,6 +232,8 @@
return overhead_szB_lo(a) + overhead_szB_hi(a);
}
=20
+//----------------------------------------------------------------------=
-----
+
// Return the minimum bszB for a block in this arena. Can have zero-len=
gth
// payloads, so it's the size of the admin bytes.
static __inline__
@@ -238,6 +242,8 @@
return overhead_szB(a);
}
=20
+//----------------------------------------------------------------------=
-----
+
// Convert payload size <--> block size (both in bytes).
static __inline__
SizeT pszB_to_bszB ( Arena* a, SizeT pszB )
@@ -251,23 +257,8 @@
return bszB - overhead_szB(a);
}
=20
-// Get a block's size as stored, ie with the in-use/free attribute.
-static __inline__
-SizeT get_bszB_as_is ( Block* b )
-{
- SizeT bszB_lo =3D get_bszB_lo(b);
- SizeT bszB_hi =3D get_bszB_hi(b);
- vg_assert(bszB_lo =3D=3D bszB_hi);
- return bszB_lo;
-}
+//----------------------------------------------------------------------=
-----
=20
-// Get a block's plain size, ie. remove the in-use/free attribute.
-static __inline__
-SizeT get_bszB ( Block* b )
-{
- return mk_plain_bszB(get_bszB_as_is(b));
-}
-
// Get a block's payload size.
static __inline__
SizeT get_pszB ( Arena* a, Block* b )
@@ -275,7 +266,9 @@
return bszB_to_pszB(a, get_bszB(b));
}
=20
-// Given the addr of a block, return the addr of its payload.
+//----------------------------------------------------------------------=
-----
+
+// Given the addr of a block, return the addr of its payload, and vice v=
ersa.
static __inline__
UByte* get_block_payload ( Arena* a, Block* b )
{
@@ -289,6 +282,7 @@
return (Block*)&payload[ -overhead_szB_lo(a) ];
}
=20
+//----------------------------------------------------------------------=
-----
=20
// Set and get the next and previous link fields of a block.
static __inline__
@@ -300,8 +294,8 @@
static __inline__
void set_next_b ( Block* b, Block* next_p )
{
- UByte* lb =3D last_byte(b);
- *(Block**)&lb[-sizeof(SizeT) - sizeof(void*) + 1] =3D next_p;
+ UByte* b2 =3D (UByte*)b;
+ *(Block**)&b2[get_bszB(b) - sizeof(SizeT) - sizeof(void*)] =3D next_p=
;
}
static __inline__
Block* get_prev_b ( Block* b )
@@ -312,10 +306,11 @@
static __inline__
Block* get_next_b ( Block* b )
{=20
- UByte* lb =3D last_byte(b);
- return *(Block**)&lb[-sizeof(SizeT) - sizeof(void*) + 1];
+ UByte* b2 =3D (UByte*)b;
+ return *(Block**)&b2[get_bszB(b) - sizeof(SizeT) - sizeof(void*)];
}
=20
+//----------------------------------------------------------------------=
-----
=20
// Get the block immediately preceding this one in the Superblock.
static __inline__
@@ -326,6 +321,8 @@
return (Block*)&b2[-bszB];
}
=20
+//----------------------------------------------------------------------=
-----
+
// Read and write the lower and upper red-zone bytes of a block.
static __inline__
void set_rz_lo_byte ( Arena* a, Block* b, UInt rz_byteno, UByte v )
@@ -336,8 +333,8 @@
static __inline__
void set_rz_hi_byte ( Arena* a, Block* b, UInt rz_byteno, UByte v )
{
- UByte* lb =3D last_byte(b);
- lb[-sizeof(SizeT) - rz_byteno] =3D v;
+ UByte* b2 =3D (UByte*)b;
+ b2[get_bszB(b) - sizeof(SizeT) - rz_byteno - 1] =3D v;
}
static __inline__
UByte get_rz_lo_byte ( Arena* a, Block* b, UInt rz_byteno )
@@ -348,8 +345,8 @@
static __inline__
UByte get_rz_hi_byte ( Arena* a, Block* b, UInt rz_byteno )
{
- UByte* lb =3D last_byte(b);
- return lb[-sizeof(SizeT) - rz_byteno];
+ UByte* b2 =3D (UByte*)b;
+ return b2[get_bszB(b) - sizeof(SizeT) - rz_byteno - 1];
}
=20
=20
@@ -633,8 +630,8 @@
{
# define BLEAT(str) VG_(printf)("blockSane: fail -- %s\n",str)
UInt i;
- if (get_bszB_lo(b) !=3D get_bszB_hi(b))
- {BLEAT("sizes");return False;}
+ // The lo and hi size fields will be checked (indirectly) by the call
+ // to get_rz_hi_byte().
if (!a->clientmem && is_inuse_block(b)) {
for (i =3D 0; i < a->rz_szB; i++) {
if (get_rz_lo_byte(a, b, i) !=3D=20
|
|
From: Julian S. <js...@ac...> - 2005-08-23 20:57:19
|
> > Implement RDTSC on x86. > > Can we have it on amd64 as well please ;-) The DB2 libraries hang > with the current hack... Definitely. Is it ok if I stop to eat first though? ;-) J |
|
From: Tom H. <to...@co...> - 2005-08-23 20:38:36
|
In message <200...@ja...>
sv...@va... wrote:
> Author: sewardj
> Date: 2005-08-23 20:24:29 +0100 (Tue, 23 Aug 2005)
> New Revision: 1344
>
> Log:
> Implement RDTSC on x86.
Can we have it on amd64 as well please ;-) The DB2 libraries hang
with the current hack...
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: <sv...@va...> - 2005-08-23 19:30:59
|
Author: sewardj
Date: 2005-08-23 20:30:58 +0100 (Tue, 23 Aug 2005)
New Revision: 1345
Log:
Rename a couple of inconsistently-named helper functions.
Modified:
trunk/priv/guest-x86/gdefs.h
trunk/priv/guest-x86/ghelpers.c
trunk/priv/guest-x86/toIR.c
Modified: trunk/priv/guest-x86/gdefs.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/priv/guest-x86/gdefs.h 2005-08-23 19:24:29 UTC (rev 1344)
+++ trunk/priv/guest-x86/gdefs.h 2005-08-23 19:30:58 UTC (rev 1345)
@@ -137,9 +137,9 @@
=20
/* --- DIRTY HELPERS --- */
=20
-extern ULong x86g_loadF80le ( UInt );
+extern ULong x86g_dirtyhelper_loadF80le ( UInt );
=20
-extern void x86g_storeF80le ( UInt, ULong );
+extern void x86g_dirtyhelper_storeF80le ( UInt, ULong );
=20
extern void x86g_dirtyhelper_CPUID_sse0 ( VexGuestX86State* );
extern void x86g_dirtyhelper_CPUID_sse1 ( VexGuestX86State* );
Modified: trunk/priv/guest-x86/ghelpers.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-x86/ghelpers.c 2005-08-23 19:24:29 UTC (rev 1344)
+++ trunk/priv/guest-x86/ghelpers.c 2005-08-23 19:30:58 UTC (rev 1345)
@@ -1228,7 +1228,7 @@
=20
/* CALLED FROM GENERATED CODE */
/* DIRTY HELPER (reads guest memory) */
-ULong x86g_loadF80le ( UInt addrU )
+ULong x86g_dirtyhelper_loadF80le ( UInt addrU )
{
ULong f64;
convert_f80le_to_f64le ( (UChar*)ULong_to_Ptr(addrU), (UChar*)&f64 );
@@ -1237,7 +1237,7 @@
=20
/* CALLED FROM GENERATED CODE */
/* DIRTY HELPER (writes guest memory) */
-void x86g_storeF80le ( UInt addrU, ULong f64 )
+void x86g_dirtyhelper_storeF80le ( UInt addrU, ULong f64 )
{
convert_f64le_to_f80le( (UChar*)&f64, (UChar*)ULong_to_Ptr(addrU) );
}
Modified: trunk/priv/guest-x86/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-x86/toIR.c 2005-08-23 19:24:29 UTC (rev 1344)
+++ trunk/priv/guest-x86/toIR.c 2005-08-23 19:30:58 UTC (rev 1345)
@@ -4152,7 +4152,8 @@
IRDirty* d =3D unsafeIRDirty_1_N (=20
val,=20
0/*regparms*/,=20
- "x86g_loadF80le", &x86g_loadF80le,=20
+ "x86g_dirtyhelper_loadF80le",=20
+ &x86g_dirtyhelper_loadF80le,=20
args=20
);
/* declare that we're reading memory */
@@ -4177,7 +4178,8 @@
=20
IRDirty* d =3D unsafeIRDirty_0_N (=20
0/*regparms*/,=20
- "x86g_storeF80le", &x86g_storeF80le,
+ "x86g_dirtyhelper_storeF80le",=20
+ &x86g_dirtyhelper_storeF80le,
args=20
);
/* declare we're writing memory */
|
|
From: <sv...@va...> - 2005-08-23 19:24:33
|
Author: sewardj
Date: 2005-08-23 20:24:29 +0100 (Tue, 23 Aug 2005)
New Revision: 1344
Log:
Implement RDTSC on x86.
Modified:
trunk/priv/guest-x86/gdefs.h
trunk/priv/guest-x86/ghelpers.c
trunk/priv/guest-x86/toIR.c
Modified: trunk/priv/guest-x86/gdefs.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/priv/guest-x86/gdefs.h 2005-08-23 17:29:27 UTC (rev 1343)
+++ trunk/priv/guest-x86/gdefs.h 2005-08-23 19:24:29 UTC (rev 1344)
@@ -151,6 +151,8 @@
extern void x86g_dirtyhelper_FSAVE ( VexGuestX86State*, HWord );
extern void x86g_dirtyhelper_FSTENV ( VexGuestX86State*, HWord );
=20
+extern ULong x86g_dirtyhelper_RDTSC ( void );
+
extern VexEmWarn
x86g_dirtyhelper_FRSTOR ( VexGuestX86State*, HWord );
=20
Modified: trunk/priv/guest-x86/ghelpers.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-x86/ghelpers.c 2005-08-23 17:29:27 UTC (rev 1343)
+++ trunk/priv/guest-x86/ghelpers.c 2005-08-23 19:24:29 UTC (rev 1344)
@@ -1694,6 +1694,21 @@
=20
=20
/* CALLED FROM GENERATED CODE */
+/* DIRTY HELPER (non-referentially-transparent) */
+/* Horrible hack. On non-x86 platforms, return 1. */
+ULong x86g_dirtyhelper_RDTSC ( void )
+{
+# if defined(__i386__)
+ ULong res;
+ __asm__ __volatile__("rdtsc" : "=3DA" (res));
+ return res;
+# else
+ return 1ULL;
+# endif
+}
+
+
+/* CALLED FROM GENERATED CODE */
/* DIRTY HELPER (modifies guest state) */
/* Claim to be a P55C (Intel Pentium/MMX) */
void x86g_dirtyhelper_CPUID_sse0 ( VexGuestX86State* st )
Modified: trunk/priv/guest-x86/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-x86/toIR.c 2005-08-23 17:29:27 UTC (rev 1343)
+++ trunk/priv/guest-x86/toIR.c 2005-08-23 19:24:29 UTC (rev 1344)
@@ -11967,35 +11967,24 @@
break;
=20
/* =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- RDTSC -=3D-=3D-=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D */
+ case 0x31: { /* RDTSC */
+ IRTemp val =3D newTemp(Ity_I64);
+ IRExpr** args =3D mkIRExprVec_0();
+ IRDirty* d =3D unsafeIRDirty_1_N (=20
+ val,=20
+ 0/*regparms*/,=20
+ "x86g_dirtyhelper_RDTSC",=20
+ &x86g_dirtyhelper_RDTSC,=20
+ args=20
+ );
+ /* execute the dirty call, dumping the result in val. */
+ stmt( IRStmt_Dirty(d) );
+ putIReg(4, R_EDX, unop(Iop_64HIto32, mkexpr(val)));
+ putIReg(4, R_EAX, unop(Iop_64to32, mkexpr(val)));
+ DIP("rdtsc\n");
+ break;
+ }
=20
- case 0x31: /* RDTSC */
- if (0) vex_printf("vex x86->IR: kludged rdtsc\n");
- putIReg(4, R_EAX, mkU32(1));
- putIReg(4, R_EDX, mkU32(0));
-
-//-- t1 =3D newTemp(cb);
-//-- t2 =3D newTemp(cb);
-//-- t3 =3D newTemp(cb);
-//-- uInstr0(cb, CALLM_S, 0);
-//-- // Nb: even though these args aren't used by RDTSC_helper,=
need
-//-- // them to be defined (for Memcheck). The TempRegs pushed=
must
-//-- // also be distinct.
-//-- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t1);
-//-- uLiteral(cb, 0);
-//-- uInstr1(cb, PUSH, 4, TempReg, t1);
-//-- uInstr2(cb, MOV, 4, Literal, 0, TempReg, t2);
-//-- uLiteral(cb, 0);
-//-- uInstr1(cb, PUSH, 4, TempReg, t2);
-//-- uInstr1(cb, CALLM, 0, Lit16, VGOFF_(helper_RDTSC));
-//-- uFlagsRWU(cb, FlagsEmpty, FlagsEmpty, FlagsEmpty);
-//-- uInstr1(cb, POP, 4, TempReg, t3);
-//-- uInstr2(cb, PUT, 4, TempReg, t3, ArchReg, R_EDX);
-//-- uInstr1(cb, POP, 4, TempReg, t3);
-//-- uInstr2(cb, PUT, 4, TempReg, t3, ArchReg, R_EAX);
-//-- uInstr0(cb, CALLM_E, 0);
- DIP("rdtsc\n");
- break;
-
/* =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- PUSH/POP Sreg =3D-=3D-=3D-=
=3D-=3D-=3D-=3D-=3D-=3D-=3D */
=20
case 0xA1: /* POP %FS */
|
|
From: <sv...@va...> - 2005-08-23 18:06:05
|
Author: sewardj
Date: 2005-08-23 19:06:01 +0100 (Tue, 23 Aug 2005)
New Revision: 4479
Log:
Add regtest for x86 LOOP{,E,NE} insns.
Added:
trunk/none/tests/x86/looper.c
trunk/none/tests/x86/looper.stderr.exp
trunk/none/tests/x86/looper.stdout.exp
trunk/none/tests/x86/looper.vgtest
Modified:
trunk/none/tests/x86/Makefile.am
Modified: trunk/none/tests/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/none/tests/x86/Makefile.am 2005-08-23 18:05:28 UTC (rev 4478)
+++ trunk/none/tests/x86/Makefile.am 2005-08-23 18:06:01 UTC (rev 4479)
@@ -16,6 +16,7 @@
$(addsuffix .stderr.exp,$(INSN_TESTS)) \
$(addsuffix .stdout.exp,$(INSN_TESTS)) \
$(addsuffix .vgtest,$(INSN_TESTS)) \
+ looper.stderr.exp looper.stdout.exp looper.vgtest \
pushpopseg.stderr.exp pushpopseg.stdout.exp pushpopseg.vgtest \
seg_override.stderr.exp seg_override.stdout.exp seg_override.vgtest \
sigcontext.stdout.exp sigcontext.stderr.exp sigcontext.vgtest \
@@ -25,7 +26,7 @@
check_PROGRAMS =3D \
badseg bt_everything bt_literal cmpxchg8b cpuid fpu_lazy_eflags \
getseg $(INSN_TESTS) \
- int pushpopseg seg_override sigcontext smc1 yield
+ looper int pushpopseg seg_override sigcontext smc1 yield
=20
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow \
-g -I$(top_srcdir)/include \
Added: trunk/none/tests/x86/looper.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/x86/looper.c 2005-08-23 18:05:28 UTC (rev 4478)
+++ trunk/none/tests/x86/looper.c 2005-08-23 18:06:01 UTC (rev 4479)
@@ -0,0 +1,82 @@
+
+#include <stdio.h>
+
+int arg =3D 0;
+int res =3D 0;
+
+extern void loop_plain ( void );
+asm("\n"
+".text\n"
+".globl loop_plain\n"
+"loop_plain:\n"
+"\tpushl %ecx\n"
+"\tmovl $999, %eax\n"
+"\tmovl arg, %ecx\n"
+
+".Lmn123plain:\n"
+"\tdecl %eax\n"
+"\tdecl %eax\n"
+"\tdecl %eax\n"
+"\tloop .Lmn123plain\n"
+
+"\tmovl %eax, res\n"
+"\tpopl %ecx\n"
+"\tret\n"
+);
+
+extern void loop_ne ( void );
+asm("\n"
+".text\n"
+".globl loop_ne\n"
+"loop_ne:\n"
+"\tpushl %ecx\n"
+"\tmovl $999, %eax\n"
+"\tmovl arg, %ecx\n"
+
+".Lmn123ne:\n"
+"\tdecl %eax\n"
+"\tdecl %eax\n"
+"\tdecl %eax\n"
+"\tloopne .Lmn123ne\n"
+
+"\tmovl %eax, res\n"
+"\tpopl %ecx\n"
+"\tret\n"
+);
+
+extern void loop_e ( void );
+asm("\n"
+".text\n"
+".globl loop_e\n"
+"loop_e:\n"
+"\tpushl %ecx\n"
+"\tmovl $999, %eax\n"
+"\tmovl arg, %ecx\n"
+
+".Lmn123e:\n"
+"\tdecl %eax\n"
+"\tdecl %eax\n"
+"\tdecl %eax\n"
+/* invert the Z flag */
+"\tpushfl\n"
+"\txorl $64, 0(%esp)\n"
+"\tpopfl\n"
+"\tloope .Lmn123e\n"
+
+"\tmovl %eax, res\n"
+"\tpopl %ecx\n"
+"\tret\n"
+);
+
+int main ( void )
+{
+ res =3D 0; arg =3D 10; loop_plain(); printf("res =3D %d\n", res);
+
+ res =3D 0; arg =3D 10; loop_ne(); printf("res =3D %d\n", res);
+ res =3D 0; arg =3D 500; loop_ne(); printf("res =3D %d\n", res);
+
+ res =3D 0; arg =3D 10; loop_e(); printf("res =3D %d\n", res);
+ res =3D 0; arg =3D 500; loop_e(); printf("res =3D %d\n", res);
+
+ return 0;
+}
Added: trunk/none/tests/x86/looper.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/x86/looper.stderr.exp 2005-08-23 18:05:28 UTC (rev 4=
478)
+++ trunk/none/tests/x86/looper.stderr.exp 2005-08-23 18:06:01 UTC (rev 4=
479)
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/x86/looper.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/x86/looper.stdout.exp 2005-08-23 18:05:28 UTC (rev 4=
478)
+++ trunk/none/tests/x86/looper.stdout.exp 2005-08-23 18:06:01 UTC (rev 4=
479)
@@ -0,0 +1,5 @@
+res =3D 969
+res =3D 969
+res =3D 0
+res =3D 969
+res =3D 0
Added: trunk/none/tests/x86/looper.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/x86/looper.vgtest 2005-08-23 18:05:28 UTC (rev 4478)
+++ trunk/none/tests/x86/looper.vgtest 2005-08-23 18:06:01 UTC (rev 4479)
@@ -0,0 +1 @@
+prog: looper
|
|
From: <sv...@va...> - 2005-08-23 18:05:31
|
Author: sewardj Date: 2005-08-23 19:05:28 +0100 (Tue, 23 Aug 2005) New Revision: 4478 Log: Update. Modified: trunk/docs/internals/3_0_BUGSTATUS.txt Modified: trunk/docs/internals/3_0_BUGSTATUS.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/docs/internals/3_0_BUGSTATUS.txt 2005-08-23 16:13:35 UTC (rev 4= 477) +++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-23 18:05:28 UTC (rev 4= 478) @@ -365,7 +365,7 @@ =20 110954 x86->IR: unhandled instruction bytes: 0xE2 0xF6 (loop Jb) =20 -FIXED-TRUNK: TODO +FIXED-TRUNK: 1343 FIXED-30BRANCH: TODO =20 ---------------------------------------------------------------- |
|
From: <sv...@va...> - 2005-08-23 17:29:34
|
Author: sewardj
Date: 2005-08-23 18:29:27 +0100 (Tue, 23 Aug 2005)
New Revision: 1343
Log:
Implement LOOP/LOOPE/LOOPNE.
Modified:
trunk/priv/guest-x86/toIR.c
Modified: trunk/priv/guest-x86/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-x86/toIR.c 2005-08-23 15:41:40 UTC (rev 1342)
+++ trunk/priv/guest-x86/toIR.c 2005-08-23 17:29:27 UTC (rev 1343)
@@ -675,7 +675,17 @@
vpanic("mkWidenOp(x86,guest)");
}
=20
+static IRExpr* mkAnd1 ( IRExpr* x, IRExpr* y )
+{
+ vassert(typeOfIRExpr(irbb->tyenv,x) =3D=3D Ity_I1);
+ vassert(typeOfIRExpr(irbb->tyenv,y) =3D=3D Ity_I1);
+ return unop(Iop_32to1,=20
+ binop(Iop_And32,=20
+ unop(Iop_1Uto32,x),=20
+ unop(Iop_1Uto32,y)));
+}
=20
+
/*------------------------------------------------------------*/
/*--- Helpers for %eflags. ---*/
/*------------------------------------------------------------*/
@@ -10555,9 +10565,8 @@
break;
=20
case 0xE3: /* JECXZ or perhaps JCXZ, depending on OSO ? Intel
- manual says it depends on address size override,
- which doesn't sound right to me. */
- vassert(sz=3D=3D4); /* possibly also OK for sz=3D=3D2 */
+ manual says it depends on address size override. */
+ if (sz !=3D 4) goto decode_failure;
d32 =3D (((Addr32)guest_EIP_bbstart)+delta+1) + getSDisp8(delta);
delta++;
ty =3D szToITy(sz);
@@ -10572,28 +10581,48 @@
DIP("j%sz 0x%x\n", nameIReg(sz, R_ECX), d32);
break;
=20
-//-- case 0xE0: /* LOOPNE disp8 */
-//-- case 0xE1: /* LOOPE disp8 */
-//-- case 0xE2: /* LOOP disp8 */
-//-- /* Again, the docs say this uses ECX/CX as a count depending =
on
-//-- the address size override, not the operand one. Since we
-//-- don't handle address size overrides, I guess that means
-//-- ECX. */
-//-- d32 =3D (eip+1) + getSDisp8(eip); eip++;
-//-- t1 =3D newTemp(cb);
-//-- uInstr2(cb, GET, 4, ArchReg, R_ECX, TempReg, t1);
-//-- uInstr1(cb, DEC, 4, TempReg, t1);
-//-- uInstr2(cb, PUT, 4, TempReg, t1, ArchReg, R_ECX);
-//-- uInstr2(cb, JIFZ, 4, TempReg, t1, Literal, 0);
-//-- uLiteral(cb, eip);
-//-- if (opc =3D=3D 0xE0 || opc =3D=3D 0xE1) { /* LOOPE/LOOPNE *=
/
-//-- jcc_lit(cb, eip, (opc =3D=3D 0xE1 ? CondNZ : CondZ));
-//-- }
-//-- jmp_lit(cb, d32);
-//-- whatNext =3D Dis_StopHere;
-//-- DIP("loop 0x%x\n", d32);
-//-- break;
+ case 0xE0: /* LOOPNE disp8: decrement count, jump if count !=3D 0 && =
ZF=3D=3D0 */
+ case 0xE1: /* LOOPE disp8: decrement count, jump if count !=3D 0 && =
ZF=3D=3D1 */
+ case 0xE2: /* LOOP disp8: decrement count, jump if count !=3D 0 */
+ { /* Again, the docs say this uses ECX/CX as a count depending on
+ the address size override, not the operand one. Since we
+ don't handle address size overrides, I guess that means
+ ECX. */
+ IRExpr* zbit =3D NULL;
+ IRExpr* count =3D NULL;
+ IRExpr* cond =3D NULL;
+ HChar* xtra =3D NULL;
=20
+ if (sz !=3D 4) goto decode_failure;
+ d32 =3D (((Addr32)guest_EIP_bbstart)+delta+1) + getSDisp8(delta);
+ delta++;
+ putIReg(4, R_ECX, binop(Iop_Sub32, getIReg(4,R_ECX), mkU32(1)));
+
+ count =3D getIReg(4,R_ECX);
+ cond =3D binop(Iop_CmpNE32, count, mkU32(0));
+ switch (opc) {
+ case 0xE2:=20
+ xtra =3D "";=20
+ break;
+ case 0xE1:=20
+ xtra =3D "e";=20
+ zbit =3D mk_x86g_calculate_condition( X86CondZ );
+ cond =3D mkAnd1(cond, zbit);
+ break;
+ case 0xE0:=20
+ xtra =3D "ne";
+ zbit =3D mk_x86g_calculate_condition( X86CondNZ );
+ cond =3D mkAnd1(cond, zbit);
+ break;
+ default:
+ vassert(0);
+ }
+ stmt( IRStmt_Exit(cond, Ijk_Boring, IRConst_U32(d32)) );
+
+ DIP("loop%s 0x%x\n", xtra, d32);
+ break;
+ }
+
/* ------------------------ IMUL ----------------------- */
=20
case 0x69: /* IMUL Iv, Ev, Gv */
|
|
From: <sv...@va...> - 2005-08-23 16:13:37
|
Author: njn Date: 2005-08-23 17:13:35 +0100 (Tue, 23 Aug 2005) New Revision: 4477 Log: update Modified: trunk/docs/internals/3_0_BUGSTATUS.txt Modified: trunk/docs/internals/3_0_BUGSTATUS.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/docs/internals/3_0_BUGSTATUS.txt 2005-08-23 16:10:36 UTC (rev 4= 476) +++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-23 16:13:35 UTC (rev 4= 477) @@ -404,3 +404,10 @@ FIXED-TRUNK: TODO FIXED-30BRANCH: TODO =20 +---------------------------------------------------------------- + +111102 (comment #4) Fixed 64-bit unclean "silly arg" message + +FIXED-TRUNK: 4476 +FIXED-30BRANCH: TODO + |
|
From: <sv...@va...> - 2005-08-23 16:10:42
|
Author: njn
Date: 2005-08-23 17:10:36 +0100 (Tue, 23 Aug 2005)
New Revision: 4476
Log:
Make "silly arg" message 64-bit clean.
Modified:
trunk/memcheck/mac_malloc_wrappers.c
Modified: trunk/memcheck/mac_malloc_wrappers.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_malloc_wrappers.c 2005-08-23 15:45:33 UTC (rev 447=
5)
+++ trunk/memcheck/mac_malloc_wrappers.c 2005-08-23 16:10:36 UTC (rev 447=
6)
@@ -158,7 +158,15 @@
// assuming here that the size asked for is not greater than 2^31 byt=
es
// (for 32-bit platforms) or 2^63 bytes (for 64-bit platforms).
if ((SSizeT)sizeB < 0) {
- VG_(message)(Vg_UserMsg, "Warning: silly arg (%d) to %s()", sizeB,=
fn );
+#if VG_WORDSIZE =3D=3D 4
+ VG_(message)(Vg_UserMsg, "Warning: silly arg (%d) to %s()",
+ (Int)sizeB, fn );
+#elif VG_WORDSIZE =3D=3D 8
+ VG_(message)(Vg_UserMsg, "Warning: silly arg (%lld) to %s()",
+ (Long)sizeB, fn );
+#else
+# error Unexpected word size
+#endif
return True;
}
return False;
@@ -167,8 +175,15 @@
static Bool complain_about_silly_args2(SizeT n, SizeT sizeB)
{
if ((SSizeT)n < 0 || (SSizeT)sizeB < 0) {
+#if VG_WORDSIZE =3D=3D 4
VG_(message)(Vg_UserMsg, "Warning: silly args (%d,%d) to calloc()"=
,
- n, sizeB);
+ (Int)n, (Int)sizeB);
+#elif VG_WORDSIZE =3D=3D 8
+ VG_(message)(Vg_UserMsg, "Warning: silly args (%lld,%lld) to callo=
c()",
+ (Long)n, (Long)sizeB);
+#else
+# error Unexpected word size
+#endif
return True;
}
return False;
|
|
From: <sv...@va...> - 2005-08-23 15:45:37
|
Author: sewardj Date: 2005-08-23 16:45:33 +0100 (Tue, 23 Aug 2005) New Revision: 4475 Log: Update. Modified: trunk/docs/internals/3_0_BUGSTATUS.txt Modified: trunk/docs/internals/3_0_BUGSTATUS.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/docs/internals/3_0_BUGSTATUS.txt 2005-08-21 00:49:41 UTC (rev 4= 474) +++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-23 15:45:33 UTC (rev 4= 475) @@ -393,5 +393,14 @@ =20 111092 x86: dis_Grp2(Reg): unhandled case(x86)=20 =20 +FIXED-TRUNK: 1341 +FIXED-30BRANCH: TODO + +---------------------------------------------------------------- + +111231 sctp_getladdrs() and sctp_getpaddrs() returns uninitialized + memory + FIXED-TRUNK: TODO FIXED-30BRANCH: TODO + |
|
From: <sv...@va...> - 2005-08-23 15:41:43
|
Author: sewardj Date: 2005-08-23 16:41:40 +0100 (Tue, 23 Aug 2005) New Revision: 1342 Log: Enable testing of RCL insns. Modified: trunk/test/test-i386.c Modified: trunk/test/test-i386.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/test/test-i386.c 2005-08-23 15:41:14 UTC (rev 1341) +++ trunk/test/test-i386.c 2005-08-23 15:41:40 UTC (rev 1342) @@ -124,11 +124,9 @@ #define OP_CC #include "test-i386-shift.h" =20 -#if 0 #define OP rcl #define OP_CC #include "test-i386-shift.h" -#endif =20 #define OP shld #define OP_SHIFTD |
|
From: <sv...@va...> - 2005-08-23 15:41:18
|
Author: sewardj
Date: 2005-08-23 16:41:14 +0100 (Tue, 23 Aug 2005)
New Revision: 1341
Log:
Support x86 RCL instructions.
Modified:
trunk/priv/guest-x86/gdefs.h
trunk/priv/guest-x86/ghelpers.c
trunk/priv/guest-x86/toIR.c
Modified: trunk/priv/guest-x86/gdefs.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/priv/guest-x86/gdefs.h 2005-08-21 00:48:37 UTC (rev 1340)
+++ trunk/priv/guest-x86/gdefs.h 2005-08-23 15:41:14 UTC (rev 1341)
@@ -104,9 +104,12 @@
=20
extern UInt x86g_calculate_FXAM ( UInt tag, ULong dbl );
=20
-extern ULong x86g_calculate_RCR (=20
+extern ULong x86g_calculate_RCR (=20
UInt arg, UInt rot_amt, UInt eflags_in, UInt sz=20
);
+extern ULong x86g_calculate_RCL (=20
+ UInt arg, UInt rot_amt, UInt eflags_in, UInt sz=20
+ );
=20
extern ULong x86g_check_fldcw ( UInt fpucw );
=20
Modified: trunk/priv/guest-x86/ghelpers.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-x86/ghelpers.c 2005-08-21 00:48:37 UTC (rev 1340)
+++ trunk/priv/guest-x86/ghelpers.c 2005-08-23 15:41:14 UTC (rev 1341)
@@ -1638,6 +1638,61 @@
}
=20
=20
+/* CALLED FROM GENERATED CODE: CLEAN HELPER */
+/* Calculate both flags and value result for rotate left
+ through the carry bit. Result in low 32 bits,=20
+ new flags (OSZACP) in high 32 bits.
+*/
+ULong x86g_calculate_RCL ( UInt arg, UInt rot_amt, UInt eflags_in, UInt =
sz )
+{
+ UInt tempCOUNT =3D rot_amt & 0x1F, cf=3D0, of=3D0, tempcf;
+
+ switch (sz) {
+ case 4:
+ cf =3D (eflags_in >> X86G_CC_SHIFT_C) & 1;
+ while (tempCOUNT > 0) {
+ tempcf =3D (arg >> 31) & 1;
+ arg =3D (arg << 1) | (cf & 1);
+ cf =3D tempcf;
+ tempCOUNT--;
+ }
+ of =3D ((arg >> 31) ^ cf) & 1;
+ break;
+ case 2:
+ while (tempCOUNT >=3D 17) tempCOUNT -=3D 17;
+ cf =3D (eflags_in >> X86G_CC_SHIFT_C) & 1;
+ while (tempCOUNT > 0) {
+ tempcf =3D (arg >> 15) & 1;
+ arg =3D 0xFFFF & ((arg << 1) | (cf & 1));
+ cf =3D tempcf;
+ tempCOUNT--;
+ }
+ of =3D ((arg >> 15) ^ cf) & 1;
+ break;
+ case 1:
+ while (tempCOUNT >=3D 9) tempCOUNT -=3D 9;
+ cf =3D (eflags_in >> X86G_CC_SHIFT_C) & 1;
+ while (tempCOUNT > 0) {
+ tempcf =3D (arg >> 7) & 1;
+ arg =3D 0xFF & ((arg << 1) | (cf & 1));
+ cf =3D tempcf;
+ tempCOUNT--;
+ }
+ of =3D ((arg >> 7) ^ cf) & 1;
+ break;
+ default:=20
+ vpanic("calculate_RCL: invalid size");
+ }
+
+ cf &=3D 1;
+ of &=3D 1;
+ eflags_in &=3D ~(X86G_CC_MASK_C | X86G_CC_MASK_O);
+ eflags_in |=3D (cf << X86G_CC_SHIFT_C) | (of << X86G_CC_SHIFT_O);
+
+ return (((ULong)eflags_in) << 32) | ((ULong)arg);
+}
+
+
/* CALLED FROM GENERATED CODE */
/* DIRTY HELPER (modifies guest state) */
/* Claim to be a P55C (Intel Pentium/MMX) */
Modified: trunk/priv/guest-x86/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-x86/toIR.c 2005-08-21 00:48:37 UTC (rev 1340)
+++ trunk/priv/guest-x86/toIR.c 2005-08-23 15:41:14 UTC (rev 1341)
@@ -2146,7 +2146,7 @@
/* delta on entry points at the modrm byte. */
HChar dis_buf[50];
Int len;
- Bool isShift, isRotate, isRotateRC;
+ Bool isShift, isRotate, isRotateC;
IRType ty =3D szToITy(sz);
IRTemp dst0 =3D newTemp(ty);
IRTemp dst1 =3D newTemp(ty);
@@ -2170,16 +2170,18 @@
isRotate =3D False;
switch (gregOfRM(modrm)) { case 0: case 1: isRotate =3D True; }
=20
- isRotateRC =3D toBool(gregOfRM(modrm) =3D=3D 3);
+ isRotateC =3D False;
+ switch (gregOfRM(modrm)) { case 2: case 3: isRotateC =3D True; }
=20
- if (!isShift && !isRotate && !isRotateRC) {
+ if (!isShift && !isRotate && !isRotateC) {
vex_printf("\ncase %d\n", gregOfRM(modrm));
vpanic("dis_Grp2(Reg): unhandled case(x86)");
}
=20
- if (isRotateRC) {
- /* call a helper; this insn is so ridiculous it does not deserve
- better */
+ if (isRotateC) {
+ /* call a helper; these insns are so ridiculous they do not
+ deserve better */
+ Bool left =3D toBool(gregOfRM(modrm) =3D=3D 2);
IRTemp r64 =3D newTemp(Ity_I64);
IRExpr** args=20
=3D mkIRExprVec_4( widenUto32(mkexpr(dst0)), /* thing to rotate=
*/
@@ -2189,7 +2191,8 @@
assign( r64, mkIRExprCCall(
Ity_I64,=20
0/*regparm*/,=20
- "x86g_calculate_RCR", &x86g_calculate_RCR,
+ left ? "x86g_calculate_RCL" : "x86g_calculate_RCR"=
,=20
+ left ? &x86g_calculate_RCL : &x86g_calculate_RCR,
args
)
);
|
|
From: Nicholas N. <nj...@cs...> - 2005-08-23 13:23:28
|
On Tue, 23 Aug 2005, Julian Seward wrote: > I looked at the attached vg.log.20643 but couldn't see anything > obviously wrong. Right at the top: VG_(get_memory_from_mmap): sectors[sno].tc's request for 9217920 bytes failed. VG_(get_memory_from_mmap): 231183424 bytes already allocated. The rest of the info is the segment list at the time of failure. >> VG_(get_memory_from_mmap): newSuperblock's request for N bytes failed. >> VG_(get_memory_from_mmap): M bytes already allocated. >> >> with various values for N and M. > > What were N and M when it failed? (I can't find the original > message right now). The sizes from the original emails were: - Christoph Bartosch: 2MB, 242MB - Meir Yeshurun: 1MB, 224MB - Prashantha A.S: 6MB, 39MB Those three were failures in newSuperblock(); interestingly Christoph's new logfile shows a failure in sectors[sno].tc. N |
|
From: Julian S. <js...@ac...> - 2005-08-23 09:44:17
|
I looked at the attached vg.log.20643 but couldn't see anything obviously wrong. > VG_(get_memory_from_mmap): newSuperblock's request for N bytes failed. > VG_(get_memory_from_mmap): M bytes already allocated. > > with various values for N and M. What were N and M when it failed? (I can't find the original message right now). J |
|
From: <js...@ac...> - 2005-08-23 02:44:48
|
Nightly build on g5 ( YDL 4.0, ppc970 ) started at 2005-08-23 04:40:00 CEST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 157 tests, 17 stderr failures, 1 stdout failure ================= memcheck/tests/badjump (stderr) memcheck/tests/badjump2 (stderr) memcheck/tests/fprw (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/supp1 (stderr) memcheck/tests/supp_unknown (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) cachegrind/tests/chdir (stderr) cachegrind/tests/dlclose (stdout) cachegrind/tests/dlclose (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/fdleak_ipv4 (stderr) |
|
From: Tom H. <to...@co...> - 2005-08-23 02:41:50
|
Nightly build on dunsmere ( athlon, Fedora Core 4 ) started at 2005-08-23 03:30:04 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 185 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-08-23 02:37:38
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-08-23 03:00:04 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 162 tests, 7 stderr failures, 1 stdout failure ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) none/tests/tls (stdout) |