]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
17 years agoMerge r1826 (amd64 support for FUCOMPP). (#161378, #160136)
Julian Seward [Tue, 13 May 2008 08:51:17 +0000 (08:51 +0000)] 
Merge r1826 (amd64 support for FUCOMPP).  (#161378, #160136)

git-svn-id: svn://svn.valgrind.org/vex/branches/VEX_3_3_BRANCH@1842

17 years agoMerge r1808,1809,1810: SSSE3 x86/amd64 support, and update CPUID accordingly.
Julian Seward [Tue, 13 May 2008 08:38:43 +0000 (08:38 +0000)] 
Merge r1808,1809,1810: SSSE3 x86/amd64 support, and update CPUID accordingly.
(Fixes #155528, although only tangentially)

git-svn-id: svn://svn.valgrind.org/vex/branches/VEX_3_3_BRANCH@1841

17 years agoMerge r1807 (Very kludgey implementation of IRET. May or may not fix
Julian Seward [Tue, 13 May 2008 08:12:12 +0000 (08:12 +0000)] 
Merge r1807 (Very kludgey implementation of IRET.  May or may not fix
#155011.)

git-svn-id: svn://svn.valgrind.org/vex/branches/VEX_3_3_BRANCH@1840

17 years agoHandle Left64 on 32-bit host. This stops Memcheck on ppc32 asserting
Julian Seward [Mon, 12 May 2008 23:09:09 +0000 (23:09 +0000)] 
Handle Left64 on 32-bit host.  This stops Memcheck on ppc32 asserting
on some bits of Altivec code.  Partial merge of r1832.

git-svn-id: svn://svn.valgrind.org/vex/branches/VEX_3_3_BRANCH@1839

17 years agoCreate stable branch associated with Valgrind 3.3.X (copy of trunk r1804)
Julian Seward [Tue, 11 Dec 2007 00:41:57 +0000 (00:41 +0000)] 
Create stable branch associated with Valgrind 3.3.X (copy of trunk r1804)

 --This line, and those below, will be ignored--

A    VEX_3_3_BRANCH

git-svn-id: svn://svn.valgrind.org/vex/branches/VEX_3_3_BRANCH@1806

17 years agoGenerate code to handle 64-bit integer loads and stores on 32-bit
Julian Seward [Tue, 4 Dec 2007 19:04:17 +0000 (19:04 +0000)] 
Generate code to handle 64-bit integer loads and stores on 32-bit
targets, as this is needed by Massif in Valgrind 3.3.0.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1804

17 years agoHandle the case Add64(expr,const) a bit better. Apparently Massif The
Julian Seward [Tue, 27 Nov 2007 00:11:13 +0000 (00:11 +0000)] 
Handle the case Add64(expr,const) a bit better.  Apparently Massif The
Second does that kind of thing a lot.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1803

17 years agoFix stupid bug in x86 isel: when generating code for a 64-bit integer
Julian Seward [Mon, 26 Nov 2007 23:18:52 +0000 (23:18 +0000)] 
Fix stupid bug in x86 isel: when generating code for a 64-bit integer
store, don't generate code to compute the address expression twice.
Spotted by Nick N whilst peering at code generated for new Massif.
Preventative changes in amd64 back end (which doesn't appear to have
the same problem).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1802

17 years agoImplement lods{b,w,l}. Fixes #152818.
Julian Seward [Sun, 25 Nov 2007 01:34:03 +0000 (01:34 +0000)] 
Implement lods{b,w,l}.  Fixes #152818.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1801

17 years agoImplement DAA/DAS/AAA/AAS. Really stupid and ugly instructions which
Julian Seward [Fri, 23 Nov 2007 02:46:29 +0000 (02:46 +0000)] 
Implement DAA/DAS/AAA/AAS.  Really stupid and ugly instructions which
might have made sense in 1973, but not now.  Fixes #152501.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1800

17 years agoSupport in{b,w,l} and out{b,w,l} on amd64. Fixes #152357.
Julian Seward [Tue, 20 Nov 2007 17:29:08 +0000 (17:29 +0000)] 
Support in{b,w,l} and out{b,w,l} on amd64.  Fixes #152357.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1799

17 years agoFix this:
Julian Seward [Mon, 19 Nov 2007 00:39:23 +0000 (00:39 +0000)] 
Fix this:
vex: priv/guest-amd64/toIR.c:3741 (dis_Grp5): Assertion `sz == 4' failed.
(CALL Ev with sz==8) as reported in #150678 and #146252.  Also change a
bunch of assertions on undecoded instructions into proper decoding failures.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1798

17 years agogcc-4.3 build fixes.
Julian Seward [Fri, 16 Nov 2007 12:43:32 +0000 (12:43 +0000)] 
gcc-4.3 build fixes.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1797

17 years agoImplement SALC. Fixes #147628.
Julian Seward [Fri, 16 Nov 2007 02:30:38 +0000 (02:30 +0000)] 
Implement SALC.  Fixes #147628.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1796

17 years agoEnable CMPXCHG Gb,Eb. Fixes #147498.
Julian Seward [Fri, 16 Nov 2007 00:18:44 +0000 (00:18 +0000)] 
Enable CMPXCHG Gb,Eb.  Fixes #147498.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1795

17 years agoHandle the "alternative" (non-binutils) encoding of 'adc' and tidy up
Julian Seward [Thu, 15 Nov 2007 23:30:16 +0000 (23:30 +0000)] 
Handle the "alternative" (non-binutils) encoding of 'adc' and tidy up
some other op-G-E / op-E-G decodings.  This fixes a bug which was
reported on valgrind-users@lists.sourceforge.net on 11 Aug 2007
("LibVEX called failure_exit() with 3.3.0svn-r6769 with Linux on
AMD64") I don't think it ever was formally filed as a bug report.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1794

17 years agoMerge changes from THRCHECK branch r1787. These changes are all to do
Julian Seward [Fri, 9 Nov 2007 21:15:04 +0000 (21:15 +0000)] 
Merge changes from THRCHECK branch r1787.  These changes are all to do
with making x86/amd64 LOCK prefixes properly visible in the IR, since
threading tools need to see them.  Probably would be no bad thing for
cachegrind/callgrind to notice them too, since asserting a bus lock on
a multiprocessor is an expensive event that programmers might like to
know about.

* amd64 front end: handle LOCK prefixes a lot more accurately

* x86 front end: ditto, and also a significant cleanup of prefix
  handling, which was a mess

* To represent prefixes, remove the IR 'Ist_MFence' construction
  and replace it with something more general: an IR Memory Bus
  Event statement (Ist_MBE), which can represent lock
  acquisition, lock release, and memory fences.

* Fix up all front ends and back ends to respectively generate
  and handle Ist_MBE.  Fix up the middle end (iropt) to deal with
  them.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1793

17 years agoAccept some apparently redundant REX.W prefixes seen on code in the
Julian Seward [Tue, 6 Nov 2007 20:39:17 +0000 (20:39 +0000)] 
Accept some apparently redundant REX.W prefixes seen on code in the
wild.  Quite possibly fixes #133962.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1792

17 years agoImplement maskmovq and maskmovdq.
Julian Seward [Sat, 1 Sep 2007 18:59:53 +0000 (18:59 +0000)] 
Implement maskmovq and maskmovdq.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1787

17 years agoSupport x86 $int 0x40 .. 0x43 instructions on Linux. Apparently these
Julian Seward [Wed, 29 Aug 2007 09:09:17 +0000 (09:09 +0000)] 
Support x86 $int 0x40 .. 0x43 instructions on Linux.  Apparently these
generate a segfault and then restart the instruction.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1786

17 years agoSupport td (64-bit counterpart to r1784).
Julian Seward [Tue, 28 Aug 2007 16:39:52 +0000 (16:39 +0000)] 
Support td (64-bit counterpart to r1784).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1785

17 years agoBetter support for trap insns. This adds support for tw (previously twi and
Julian Seward [Tue, 28 Aug 2007 14:48:35 +0000 (14:48 +0000)] 
Better support for trap insns.  This adds support for tw (previously twi and
tdi only were supported).  td to follow.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1784

17 years agoAdd missing return.
Julian Seward [Tue, 28 Aug 2007 06:06:57 +0000 (06:06 +0000)] 
Add missing return.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1783

17 years agoMerge, from CGTUNE branch, r1774:
Julian Seward [Tue, 28 Aug 2007 06:06:27 +0000 (06:06 +0000)] 
Merge, from CGTUNE branch, r1774:

Vex-side changes to allow tools to provide a final_tidy function which
they can use to mess with the final post-tree-built IR before it is
handed off to instruction selection.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1782

17 years agoMerge from CGTUNE branch, code generation improvements for amd64:
Julian Seward [Sat, 25 Aug 2007 23:21:08 +0000 (23:21 +0000)] 
Merge from CGTUNE branch, code generation improvements for amd64:

r1772:
When generating code for helper calls, be more aggressive about
computing values directly into argument registers, thereby avoiding
some reg-reg shuffling.  This reduces the amount of code (on amd64)
generated by Cachegrind by about 6% and has zero or marginal benefit
for other tools.

r1773:
Emit 64-bit branch targets using 32-bit short forms when possible.
Since (with V's default amd64 load address of 0x38000000) this is
usually possible, it saves about 7% in code size for Memcheck and even
more for Cachegrind.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1781

17 years agoMerge from CGTUNE branch:
Julian Seward [Sat, 25 Aug 2007 23:07:44 +0000 (23:07 +0000)] 
Merge from CGTUNE branch:

r1769:
This commit provides a bunch of enhancements to the IR optimiser
(iropt) and to the various backend instruction selectors.
Unfortunately the changes are interrelated and cannot easily be
committed in pieces in any meaningful way.  Between them and the
already-committed register allocation enhancements (r1765, r1767)
performance of Memcheck is improved by 0%-10%.  Improvements are also
applicable to other tools to lesser extents.

Main changes are:

* Add new IR primops Iop_Left64/32/16/8 and Iop_CmpwNEZ64/32/16/8
  which Memcheck uses to express some primitive operations on
  definedness (V) bits:

     Left(x)    = set all bits to the left of the rightmost 1 bit to 1
     CmpwNEZ(x) = if x == 0 then 0 else 0xFF...FF

  Left and CmpwNEZ are detailed in the Usenix 2005 paper (in which
  CmpwNEZ is called PCast).  The new primops expose opportunities for
  IR optimisation at tree-build time.  Prior to this change Memcheck
  expressed Left and CmpwNEZ in terms of lower level primitives
  (logical or, negation, compares, various casts) which was simpler
  but hindered further optimisation.

* Enhance the IR optimiser's tree builder so it can rewrite trees
  as they are constructed, according to useful identities, for example:

     CmpwNEZ64( Or64 ( CmpwNEZ64(x), y ) ) --> CmpwNEZ64( Or64( x, y ) )

  which gets rid of a CmpwNEZ64 operation - a win as they are relatively
  expensive.  See functions fold_IRExpr_Binop and fold_IRExpr_Unop.

  Allowing the tree builder to rewrite trees also makes it possible to
  have a single implementation of certain transformation rules which
  were previously duplicated in the x86, amd64 and ppc instruction
  selectors.  For example

     32to1(1Uto32(x)) --> x

  This simplifies the instruction selectors and gives a central place
  to put such IR-level transformations, which is a Good Thing.

* Various minor refinements to the instruction selectors:
  - ppc64 generates 32Sto64 into 1 instruction instead of 2
  - x86 can now generate movsbl
  - x86 handles 64-bit integer Mux0X better for cases typically
    arising from Memchecking of FP code
  - misc other patterns handled better

Overall these changes are a straight win - vex generates less code,
and does so a bit faster since its register allocator has to chew
through fewer instructions.  The main risk is that of correctness:
making Left and CmpwNEZ explicit, and adding rewrite rules for them,
is a substantial change in the way Memcheck deals with undefined value
tracking, and I am concerned to ensure that the changes do not cause
false negatives.  I _think_ it's all correct so far.

r1770:
Get rid of Iop_Neg64/32/16/8 as they are no longer used by Memcheck,
and any uses as generated by the front ends are so infrequent that
generating the equivalent Sub(0, ..) is good enough.  This gets rid of
quite a few lines of code.  Add isel cases for Sub(0, ..) patterns so
that the x86/amd64 backends still generate negl/negq where possible.

r1771:
Handle Left64.  Fixes failure on none/tests/x86/insn_sse2.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1780

17 years agoMerge, from CGTUNE branch:
Julian Seward [Sat, 25 Aug 2007 21:29:03 +0000 (21:29 +0000)] 
Merge, from CGTUNE branch:

r1768:
Cosmetic (non-functional) changes associated with r1767.

r1767:
Add a second spill-code-avoidance optimisation, which could be called
'directReload' for lack of a better name.

If an instruction reads exactly one vreg which is currently in a spill
slot, and this is last use of that vreg, see if the instruction can be
converted into one that reads directly from the spill slot.  This is
clearly only possible for x86 and amd64 targets, since ppc is a
load-store architecture.  So, for example,

   orl %vreg, %dst

where %vreg is in a spill slot, and this is its last use, would
previously be converted to

   movl $spill-offset(%ebp), %tmp
   orl %tmp, %dst

whereas now it becomes

   orl $spill-offset(%ebp), %dst

This not only avoids an instruction, it eliminates the need for a
reload temporary (%tmp in this example) and so potentially further
reduces spilling.

Implementation is in two parts: an architecture independent part, in
reg_alloc2.c, which finds candidate instructions, and a host dependent
function (directReload_ARCH) for each arch supporting the
optimisation.  The directReload_ function does the instruction form
conversion, when possible.  Currently only x86 hosts are supported.

As a side effect, change the form of the X86_Test32 instruction from
reg-only to reg/mem so it can participate in such transformations.

This gives a code size reduction of 0.6% for perf/bz2 on x86 memcheck,
but tends to be more effective for long blocks of x86 FP code.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1779

17 years agoMerge, from CGTUNE branch:
Julian Seward [Sat, 25 Aug 2007 21:11:33 +0000 (21:11 +0000)] 
Merge, from CGTUNE branch:

r1765:
During register allocation, keep track of which (real) registers have
the same value as their associated spill slot.  Then, if a register
needs to be freed up for some reason, and that register has the same
value as its spill slot, there is no need to produce a spill store.
This substantially reduces the number of spill store instructions
created.  Overall gives a 1.9% generated code size reduction for
perf/bz2 running on x86.

r1766:
Followup to r1765: fix some comments, and rearrange fields in struct
RRegState so as to fit it into 16 bytes.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1778

17 years agoAllow up to 7 prefixes, so as to accept
Julian Seward [Thu, 23 Aug 2007 18:53:59 +0000 (18:53 +0000)] 
Allow up to 7 prefixes, so as to accept
66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00  nopw   %cs:0x0(%rax,%rax,1)
as a valid no-op.  Blargh.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1776

18 years ago* implement fistp
Julian Seward [Wed, 11 Jul 2007 22:49:26 +0000 (22:49 +0000)] 
* implement fistp
* fix incorrect behaviour in out-of-range conversion conditions for fisttp

git-svn-id: svn://svn.valgrind.org/vex/trunk@1775

18 years agoOops. Fix longstanding bug which will have caused an unnecessary 4M
Julian Seward [Sat, 5 May 2007 12:26:23 +0000 (12:26 +0000)] 
Oops.  Fix longstanding bug which will have caused an unnecessary 4M
of bss space to be allocated.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1763

18 years agoHandle x87 FCOMP.
Julian Seward [Fri, 4 May 2007 09:41:24 +0000 (09:41 +0000)] 
Handle x87 FCOMP.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1761

18 years agoStop gcc-4.2 producing hundreds of complaints of the form "warning:
Julian Seward [Tue, 1 May 2007 13:53:01 +0000 (13:53 +0000)] 
Stop gcc-4.2 producing hundreds of complaints of the form "warning:
cast from pointer to integer of different size" when compiling on a
64-bit target.  gcc-4.2 is correct to complain.  An interesting
question is why no previous gcc warned about this.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1759

18 years agoImplement lahf/sahf on amd64. Also set NDEP on x86 sahf. Fixes #143907.
Julian Seward [Sat, 7 Apr 2007 12:25:37 +0000 (12:25 +0000)] 
Implement lahf/sahf on amd64.  Also set NDEP on x86 sahf.  Fixes #143907.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1749

18 years agoFix various cases where the instruction decoder asserted/paniced
Julian Seward [Thu, 5 Apr 2007 15:06:56 +0000 (15:06 +0000)] 
Fix various cases where the instruction decoder asserted/paniced
instead of doing the normal SIGILL thing.  Fixes #143354.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1748

18 years agoFold Add8(t,t) ==> t << 1. Fixes #143817 (Unused bitfield pad bits
Julian Seward [Wed, 4 Apr 2007 22:48:06 +0000 (22:48 +0000)] 
Fold Add8(t,t) ==> t << 1.  Fixes #143817 (Unused bitfield pad bits
confuse memcheck)

git-svn-id: svn://svn.valgrind.org/vex/trunk@1747

18 years agoCounterpart to r1745: teach the amd64 back end how to generate 'lea'
Julian Seward [Sat, 31 Mar 2007 19:12:38 +0000 (19:12 +0000)] 
Counterpart to r1745: teach the amd64 back end how to generate 'lea'
instructions, and generate them in an important place.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1746

18 years agoTeach the x86 back end how generate 'lea' instructions, and generate
Julian Seward [Sat, 31 Mar 2007 14:30:12 +0000 (14:30 +0000)] 
Teach the x86 back end how generate 'lea' instructions, and generate
them in a couple of places which are important.  This reduces the
amount of generated code for memcheck and none by about 1%, and (in
very unscientific tests on perf/bz2) speeds memcheck up by about 1%.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1745

18 years agox86 back end: use 80-bit loads/stores for floating point spills rather
Julian Seward [Sun, 25 Mar 2007 04:14:58 +0000 (04:14 +0000)] 
x86 back end: use 80-bit loads/stores for floating point spills rather
than 64-bit ones, to reduce accuracy loss.  To support this, in
reg-alloc, allocate 2 64-bit spill slots for each HRcFlt64 vreg
instead of just 1.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1744

18 years agoamd64 equivalents of vx1742 (synthesise SIGILL in the normal way for
Julian Seward [Wed, 21 Mar 2007 00:21:56 +0000 (00:21 +0000)] 
amd64 equivalents of vx1742 (synthesise SIGILL in the normal way for
some obscure invalid instruction cases, rather than asserting)

git-svn-id: svn://svn.valgrind.org/vex/trunk@1743

18 years agox86 front end: synthesise SIGILL in the normal way for some obscure
Julian Seward [Tue, 20 Mar 2007 14:18:45 +0000 (14:18 +0000)] 
x86 front end: synthesise SIGILL in the normal way for some obscure
invalid instruction cases, rather than asserting, as happened in
#143079 and #142279.  amd64 equivalents to follow.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1742

18 years agoSupport 'INT $3' instruction on amd64 (counterpart to vx1736).
Julian Seward [Mon, 12 Mar 2007 00:43:59 +0000 (00:43 +0000)] 
Support 'INT $3' instruction on amd64 (counterpart to vx1736).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1741

18 years agoTolerate redundant REX.W prefix produced by Mono for 'fsqrt' (a lame
Julian Seward [Sun, 11 Mar 2007 19:34:13 +0000 (19:34 +0000)] 
Tolerate redundant REX.W prefix produced by Mono for 'fsqrt' (a lame
kludge).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1740

18 years agoWhen generating 64-bit code, ensure that any addresses used in 4 or 8
Julian Seward [Fri, 9 Mar 2007 18:07:00 +0000 (18:07 +0000)] 
When generating 64-bit code, ensure that any addresses used in 4 or 8
byte loads or stores of the form reg+imm have the lowest 2 bits of imm
set to zero, so that they can safely be used in ld/ldu/lda/std/stdu
instructions.  This boils down to doing an extra check in
iselWordExpr_AMode and avoiding the reg+imm case in cases where the
amode might end up in any of the abovementioned instructions.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1739

18 years agoComment-only changes.
Julian Seward [Fri, 9 Mar 2007 14:24:38 +0000 (14:24 +0000)] 
Comment-only changes.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1738

18 years agoHandle the (bizarre) no-op "26 2E 64 65 90 %es:%cs:%fs:%gs:nop". This
Julian Seward [Thu, 1 Mar 2007 18:42:07 +0000 (18:42 +0000)] 
Handle the (bizarre) no-op "26 2E 64 65 90 %es:%cs:%fs:%gs:nop".  This
makes it possible to run Sun's JVM 1.5.0 on Valgrind.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1737

18 years agoSupport 'INT $3' instruction.
Julian Seward [Wed, 28 Feb 2007 23:31:42 +0000 (23:31 +0000)] 
Support 'INT $3' instruction.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1736

18 years agoHandle FCOM and FCOMPP in 64-bit mode (see #141790)
Julian Seward [Fri, 23 Feb 2007 08:48:22 +0000 (08:48 +0000)] 
Handle FCOM and FCOMPP in 64-bit mode (see #141790)

git-svn-id: svn://svn.valgrind.org/vex/trunk@1735

18 years agoMore IRBB -> IRSB renaming.
Julian Seward [Tue, 6 Feb 2007 01:52:52 +0000 (01:52 +0000)] 
More IRBB -> IRSB renaming.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1734

18 years agoFill in missing cases in eqIRConst. This stops iropt's CSE pass from
Julian Seward [Sat, 27 Jan 2007 00:46:28 +0000 (00:46 +0000)] 
Fill in missing cases in eqIRConst.  This stops iropt's CSE pass from
asserting in the presence of V128 immediates, which is a regression
in valgrind 3.2.2.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1731

18 years agoConstant fold XorV128(t,t) -> 0. Effect is that memcheck 'knows'
Julian Seward [Tue, 16 Jan 2007 19:19:55 +0000 (19:19 +0000)] 
Constant fold  XorV128(t,t) -> 0.  Effect is that memcheck 'knows'
that pxor %xmm_n, %xmm_n does not depend on the previous contents
of %xmm_n.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1728

18 years agoUpdate.
Julian Seward [Fri, 12 Jan 2007 20:31:49 +0000 (20:31 +0000)] 
Update.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1726

18 years agoImplement rcl{b,w,l,q} on amd64.
Julian Seward [Fri, 12 Jan 2007 20:29:01 +0000 (20:29 +0000)] 
Implement rcl{b,w,l,q} on amd64.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1725

18 years agoImplement FXSAVE on amd64. Mysteriously my Athlon64 does not seem to
Julian Seward [Wed, 10 Jan 2007 04:59:33 +0000 (04:59 +0000)] 
Implement FXSAVE on amd64.  Mysteriously my Athlon64 does not seem to
write all the fields that the AMD documentation says it should: it
skips ROP, RIP and RDP, so vex's implementation writes zeroes there.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1722

18 years agoAdd 'missing' primop Iop_ReinterpF32asI32 and code generation support
Julian Seward [Tue, 9 Jan 2007 15:20:07 +0000 (15:20 +0000)] 
Add 'missing' primop Iop_ReinterpF32asI32 and code generation support
for it on x86 hosts.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1721

18 years agoStraggler
Julian Seward [Mon, 8 Jan 2007 06:02:53 +0000 (06:02 +0000)] 
Straggler

git-svn-id: svn://svn.valgrind.org/vex/trunk@1720

18 years agoUpdate copyright dates.
Julian Seward [Mon, 8 Jan 2007 05:51:05 +0000 (05:51 +0000)] 
Update copyright dates.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1719

18 years agoAdd mkIRExprVec_6/7.
Julian Seward [Mon, 8 Jan 2007 05:09:55 +0000 (05:09 +0000)] 
Add mkIRExprVec_6/7.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1718

18 years agoUse 'ifndef' in the makefile correctly.
Julian Seward [Thu, 4 Jan 2007 16:13:14 +0000 (16:13 +0000)] 
Use 'ifndef' in the makefile correctly.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1716

18 years agoTidy up flags spec fn, and add a rule for INCW-CondZ.
Julian Seward [Fri, 29 Dec 2006 01:54:36 +0000 (01:54 +0000)] 
Tidy up flags spec fn, and add a rule for INCW-CondZ.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1714

18 years agoTidy up and finalise x86/amd64 flag spec rules for 3.2.2.
Julian Seward [Thu, 28 Dec 2006 04:40:12 +0000 (04:40 +0000)] 
Tidy up and finalise x86/amd64 flag spec rules for 3.2.2.
x86 COPY-CondP/NP needs re-verification.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1713

18 years agoHandle recent binutils padding "nopw %cs:0x0(%eax,%eax,1)"
Julian Seward [Thu, 28 Dec 2006 01:49:29 +0000 (01:49 +0000)] 
Handle recent binutils padding "nopw %cs:0x0(%eax,%eax,1)"

git-svn-id: svn://svn.valgrind.org/vex/trunk@1711

18 years agoEnable support for altivec prefetches: dss, dst, dstt, dstst, dststt.
Julian Seward [Wed, 27 Dec 2006 23:59:31 +0000 (23:59 +0000)] 
Enable support for altivec prefetches: dss, dst, dstt, dstst, dststt.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1709

18 years agoEnable lvxl and stvxl.
Julian Seward [Wed, 27 Dec 2006 21:21:14 +0000 (21:21 +0000)] 
Enable lvxl and stvxl.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1707

18 years agoImplement mfspr 268 and 269. Fixes #139050.
Julian Seward [Wed, 27 Dec 2006 18:39:46 +0000 (18:39 +0000)] 
Implement mfspr 268 and 269.  Fixes #139050.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1705

18 years agox86 front end: Implement MASKMOVQ (MMX class insn, introduced in SSE1)
Julian Seward [Wed, 27 Dec 2006 01:15:29 +0000 (01:15 +0000)] 
x86 front end: Implement MASKMOVQ (MMX class insn, introduced in SSE1)
and MASKMOVDQU (SSE class insn, introduced in SSE2).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1702

18 years agoA large but non-functional commit: as suggested by Nick, rename some
Julian Seward [Sun, 24 Dec 2006 02:20:24 +0000 (02:20 +0000)] 
A large but non-functional commit: as suggested by Nick, rename some
IR types, structure fields and functions to make IR a bit easier to
understand.  Specifically:

  dopyIR* -> deepCopyIR*

  sopyIR* -> shallowCopyIR*

  The presence of a .Tmp union in both IRExpr and IRStmt is
  confusing.  It has been renamed to RdTmp in IRExpr, reflecting
  the fact that here we are getting the value of an IRTemp, and to
  WrTmp in IRStmt, reflecting the fact that here we are assigning
  to an IRTemp.

  IRBB (IR Basic Block) is renamed to IRSB (IR SuperBlock),
  reflecting the reality that Vex does not really operate in terms
  of basic blocks, but in terms of superblocks - single entry,
  multiple exit sequences.

  IRArray is renamed to IRRegArray, to make it clearer it refers
  to arrays of guest registers and not arrays in memory.

  VexMiscInfo is renamed to VexAbiInfo, since that's what it is
  -- relevant facts about the ABI (calling conventions, etc) for
  both the guest and host platforms.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1689

18 years agoMake compilable again.
Julian Seward [Sun, 17 Dec 2006 17:40:36 +0000 (17:40 +0000)] 
Make compilable again.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1688

18 years agoMake this compilable again.
Julian Seward [Sun, 17 Dec 2006 14:24:05 +0000 (14:24 +0000)] 
Make this compilable again.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1687

18 years agoChange a stupid algorithm that deals with real register live
Julian Seward [Fri, 1 Dec 2006 02:59:17 +0000 (02:59 +0000)] 
Change a stupid algorithm that deals with real register live
ranges into a less stupid one.  Prior to this change, the complexity
of reg-alloc included an expensive term

O(#instrs in code sequence x #real-register live ranges in code sequence)

This commit changes that term to essentially

O(#instrs in code sequence) + O(time to sort real-reg-L-R array)

On amd64 this nearly halves the cost of register allocation and means
Valgrind performs better in translation-intensive situations (a.k.a
starting programs).  Eg, firefox start/exit falls from 119 to 113
seconds.  The effect will be larger on ppc32/64 as there are more real
registers and hence real-reg live ranges to consider, and will be
smaller on x86 for the same reason.

The actual code the JIT produces should be unchanged.  This commit
merely modifies how the register allocator handles one of its
important data structures.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1686

18 years agoAdd a couple of %rflags spec rules which improve performance of amd64
Julian Seward [Mon, 27 Nov 2006 04:09:52 +0000 (04:09 +0000)] 
Add a couple of %rflags spec rules which improve performance of amd64
FP comparisons.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1685

18 years agoNew function dopyIRBBExceptStmts which makes it a bit easier to write
Julian Seward [Fri, 24 Nov 2006 23:32:55 +0000 (23:32 +0000)] 
New function dopyIRBBExceptStmts which makes it a bit easier to write
tools.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1684

18 years agoSpecialise computation of carry flag after ADDL.
Julian Seward [Wed, 22 Nov 2006 23:31:37 +0000 (23:31 +0000)] 
Specialise computation of carry flag after ADDL.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1683

18 years agoEven more flag-spec rules: SUBL-CondNL, SUBL-CondNBE, SUBL-NB and redo
Julian Seward [Wed, 22 Nov 2006 17:39:51 +0000 (17:39 +0000)] 
Even more flag-spec rules: SUBL-CondNL, SUBL-CondNBE, SUBL-NB and redo
SUBL-CondNS.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1682

18 years agoA couple more x86 spec rules: COPY-CondNZ and SUBL-CondNS.
Julian Seward [Wed, 22 Nov 2006 16:01:45 +0000 (16:01 +0000)] 
A couple more x86 spec rules: COPY-CondNZ and SUBL-CondNS.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1681

18 years agoOn amd64, allow the register allocator to use %r10 which it previously
Julian Seward [Sun, 19 Nov 2006 02:05:47 +0000 (02:05 +0000)] 
On amd64, allow the register allocator to use %r10 which it previously
did not.  This gives a 0%-3% speedup, mostly closer to the 0% end.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1680

18 years agoHandle long-form encoding of 'push{l,w} %reg'.
Julian Seward [Sat, 18 Nov 2006 22:56:46 +0000 (22:56 +0000)] 
Handle long-form encoding of 'push{l,w} %reg'.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1679

18 years agoHandle JCXZ.
Julian Seward [Thu, 16 Nov 2006 10:42:02 +0000 (10:42 +0000)] 
Handle JCXZ.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1678

18 years agoAdd many extra comments describing the IR.
Julian Seward [Wed, 15 Nov 2006 02:57:05 +0000 (02:57 +0000)] 
Add many extra comments describing the IR.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1677

18 years agoHandle 'ret imm16'. Fixes #136650.
Julian Seward [Tue, 14 Nov 2006 17:50:16 +0000 (17:50 +0000)] 
Handle 'ret imm16'.  Fixes #136650.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1676

18 years agoAdd an %eflags rule for COPY-CondP.
Julian Seward [Tue, 14 Nov 2006 17:46:12 +0000 (17:46 +0000)] 
Add an %eflags rule for COPY-CondP.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1675

18 years agoRe-enable 'repne movs' (fix for original bug in #126147).
Julian Seward [Tue, 14 Nov 2006 15:33:05 +0000 (15:33 +0000)] 
Re-enable 'repne movs' (fix for original bug in #126147).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1674

18 years agoRe-enable 'repne stos' (fix for Gernot Tenchio's part of #126147).
Julian Seward [Tue, 14 Nov 2006 15:13:55 +0000 (15:13 +0000)] 
Re-enable 'repne stos' (fix for Gernot Tenchio's part of #126147).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1673

18 years agoImplement 'xlat' (fixes #125959 and #135012).
Julian Seward [Sun, 12 Nov 2006 22:25:21 +0000 (22:25 +0000)] 
Implement 'xlat' (fixes #125959 and #135012).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1672

18 years agoWhen doing rlwinm in 64-bit mode, bind the intermediate 32-bit result
Julian Seward [Thu, 19 Oct 2006 03:01:09 +0000 (03:01 +0000)] 
When doing rlwinm in 64-bit mode, bind the intermediate 32-bit result
to a temporary so it is only computed once.  What's there currently
causes it to be computed twice.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1671

18 years agoppc64: detect rldicl/rldicr which are simply 64-bit shifts left/right
Julian Seward [Thu, 19 Oct 2006 00:15:25 +0000 (00:15 +0000)] 
ppc64: detect rldicl/rldicr which are simply 64-bit shifts left/right
and emit IR directly as such.  Improves performance of 64-bit code (a
bit).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1670

18 years agoMerge r1663-r1666:
Julian Seward [Tue, 17 Oct 2006 00:28:22 +0000 (00:28 +0000)] 
Merge r1663-r1666:

- AIX5 build changes

- genoffsets.c: print the offsets of a few more ppc registers

- Get rid of a bunch of ad-hoc hacks which hardwire in certain
  assumptions about guest and host ABIs.  Instead pass that info
  in a VexMiscInfo structure.  This cleans up various grotty bits.

- Add to ppc32 guest state, redirection-stack stuff already present
  in ppc64 guest state.  This is to enable function redirection/
  wrapping in the presence of TOC pointers in 32-bit mode.

- Add to both ppc32 and ppc64 guest states, a new pseudo-register
  LR_AT_SC.  This holds the link register value at the most recent
  'sc', so that AIX can back up to restart a syscall if needed.

- Add to both ppc32 and ppc64 guest states, a SPRG3 register.

- Use VexMiscInfo to handle 'sc' on AIX differently from Linux:
  on AIX, 'sc' continues at the location stated in the link
  register, not at the next insn.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1669

18 years agoReinstate support for 'mcrfs'.
Julian Seward [Wed, 4 Oct 2006 17:46:11 +0000 (17:46 +0000)] 
Reinstate support for 'mcrfs'.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1667

18 years agoAnother day, another %eflags reduction rule.
Julian Seward [Sun, 17 Sep 2006 10:02:35 +0000 (10:02 +0000)] 
Another day, another %eflags reduction rule.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1660

18 years agoSupport pextrw when the destination register is 64 bits too. Fixes
Julian Seward [Mon, 11 Sep 2006 14:37:27 +0000 (14:37 +0000)] 
Support pextrw when the destination register is 64 bits too.  Fixes
#133678.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1656

18 years agoAdd support for amd64 'fprem' (fixes bug 132918). This isn't exactly
Julian Seward [Mon, 11 Sep 2006 11:07:34 +0000 (11:07 +0000)] 
Add support for amd64 'fprem' (fixes bug 132918).  This isn't exactly
right; the C3/2/1/0 FPU flags sometimes don't get set the same as
natively, and I can't figure out why.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1655

18 years ago64-bit counterpart to v1652 (Stop mkU16 asserting if d32 is a negative
Julian Seward [Mon, 28 Aug 2006 18:54:18 +0000 (18:54 +0000)] 
64-bit counterpart to v1652 (Stop mkU16 asserting if d32 is a negative
16-bit number (bug #132813)).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1653

18 years agoStop mkU16 asserting if d32 is a negative 16-bit number (bug #132813).
Julian Seward [Mon, 28 Aug 2006 18:04:33 +0000 (18:04 +0000)] 
Stop mkU16 asserting if d32 is a negative 16-bit number (bug #132813).

git-svn-id: svn://svn.valgrind.org/vex/trunk@1652

18 years agoMore reduction rules, which further reduce memcheck's false error
Julian Seward [Fri, 25 Aug 2006 12:52:19 +0000 (12:52 +0000)] 
More reduction rules, which further reduce memcheck's false error
rate on optimised x86 and amd64 code.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1642

18 years agoFix previous commit (r1640?) so that it's actually correct :-)
Julian Seward [Sat, 19 Aug 2006 22:18:53 +0000 (22:18 +0000)] 
Fix previous commit (r1640?) so that it's actually correct :-)

git-svn-id: svn://svn.valgrind.org/vex/trunk@1641

18 years agoComparing a reg with itself produces a result which doesn't depend on
Julian Seward [Sat, 19 Aug 2006 18:31:53 +0000 (18:31 +0000)] 
Comparing a reg with itself produces a result which doesn't depend on
the contents of the reg.  Therefore remove the false dependency, which
has been known to cause memcheck to produce false errors for
xlc-compiled code.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1640

18 years agoImplement amd64 insns cmpxchg8b and cmpxchg16b. Fixes #127521.
Julian Seward [Thu, 17 Aug 2006 01:20:01 +0000 (01:20 +0000)] 
Implement amd64 insns cmpxchg8b and cmpxchg16b.  Fixes #127521.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1639

18 years agoGenerate less verbose IR for amd64 'bswapq'. Fixes #132146.
Julian Seward [Wed, 16 Aug 2006 00:25:28 +0000 (00:25 +0000)] 
Generate less verbose IR for amd64 'bswapq'.  Fixes #132146.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1638

18 years agoamd64 insn printing fix.
Julian Seward [Wed, 16 Aug 2006 00:23:21 +0000 (00:23 +0000)] 
amd64 insn printing fix.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1637

19 years ago64-bit equivalent to r1635: handle all SSE3 instructions except
Julian Seward [Fri, 4 Aug 2006 14:51:19 +0000 (14:51 +0000)] 
64-bit equivalent to r1635: handle all SSE3 instructions except
monitor and mwait in 64-bit mode.  Regression tests to follow soon.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1636