]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
13 years agoComment-only change.
Julian Seward [Fri, 20 Apr 2012 22:32:34 +0000 (22:32 +0000)] 
Comment-only change.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2294

13 years agoAvoid word-size warnings when this is compiled on 64 bit platforms.
Julian Seward [Fri, 20 Apr 2012 15:41:33 +0000 (15:41 +0000)] 
Avoid word-size warnings when this is compiled on 64 bit platforms.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2293

13 years agoChanges to make t-chaining work on ppc64-linux. More fun than a
Julian Seward [Fri, 20 Apr 2012 10:42:24 +0000 (10:42 +0000)] 
Changes to make t-chaining work on ppc64-linux.  More fun than a
bathtub full of ferrets.  (VEX side)

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2292

13 years agoMinor non-functional tweak.
Florian Krohm [Fri, 20 Apr 2012 02:50:28 +0000 (02:50 +0000)] 
Minor non-functional tweak.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2291

13 years agoFill in some more bits to do with t-chaining for ppc64
Julian Seward [Fri, 20 Apr 2012 02:18:31 +0000 (02:18 +0000)] 
Fill in some more bits to do with t-chaining for ppc64
(still doesn't work) (VEX side)

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2290

13 years agoAdd translation chaining support for ppc32 (tested) and to
Julian Seward [Fri, 20 Apr 2012 00:13:28 +0000 (00:13 +0000)] 
Add translation chaining support for ppc32 (tested) and to
a large extent for ppc64 (incomplete, untested) (VEX side)

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2289

13 years agoCorrectly update the guest IA at the end of an insn to point to
Florian Krohm [Thu, 19 Apr 2012 14:23:48 +0000 (14:23 +0000)] 
Correctly update the guest IA at the end of an insn to point to
the next insn, not the current one.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2288

13 years agoMore fixes:
Florian Krohm [Tue, 17 Apr 2012 02:41:56 +0000 (02:41 +0000)] 
More fixes:
- A few dummy_put_IA's were missing, causing asserts to fire.
  Mostly for the "load/store conditional" kind of insns
- EX needed some finishing touches
- Assignments to irsb->next are forbidden. We had a few in the "special
  opcodes" section. Now fixed, I hope.
With this patch most regressions run through. I see 3 failures in none
and a few more in the memcheck bucket.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2287

13 years agoFix s390_tchain_patch_load64; some bytes were mixed up.
Florian Krohm [Sun, 15 Apr 2012 04:11:07 +0000 (04:11 +0000)] 
Fix s390_tchain_patch_load64; some bytes were mixed up.
Fix unchainXDirect_S390; modified place_to_unchain address
before patching the code there.
Add some convenience functions for insn verification in
chain/unchain machinery.
Avoid magic constants.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2286

13 years agoMake the list of handled jump kinds the same in s390_isel_stmt
Florian Krohm [Sat, 14 Apr 2012 20:35:17 +0000 (20:35 +0000)] 
Make the list of handled jump kinds the same in s390_isel_stmt
and iselNext.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2285

13 years agoNo idea what happened here. Fixed as obvious.
Florian Krohm [Sat, 14 Apr 2012 16:22:26 +0000 (16:22 +0000)] 
No idea what happened here. Fixed as obvious.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2284

13 years agoDeal with CLFLUSH, which were not correctly dealt with (w.r.t. new IR
Julian Seward [Fri, 13 Apr 2012 23:03:45 +0000 (23:03 +0000)] 
Deal with CLFLUSH, which were not correctly dealt with (w.r.t. new IR
generation conventions) and caused bb_to_IR.c to assert.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2283

13 years agoNo need to handle Ijk_Sys_int32 which is specific to amd64.
Florian Krohm [Fri, 13 Apr 2012 21:46:57 +0000 (21:46 +0000)] 
No need to handle Ijk_Sys_int32 which is specific to amd64.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2282

13 years agoFirst round of fixes: some cut'n paste errors. And the guest_IA in
Florian Krohm [Fri, 13 Apr 2012 21:14:24 +0000 (21:14 +0000)] 
First round of fixes: some cut'n paste errors. And the guest_IA in
a conditional jump.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2281

13 years agoTranslation chaining for s390. To be debugged.
Florian Krohm [Fri, 13 Apr 2012 04:04:06 +0000 (04:04 +0000)] 
Translation chaining for s390. To be debugged.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2279

13 years agoARMin_MFence: implement using ARMv7 insns instead of the legacy mcr-15
Julian Seward [Wed, 4 Apr 2012 14:20:56 +0000 (14:20 +0000)] 
ARMin_MFence: implement using ARMv7 insns instead of the legacy mcr-15
instructions.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2275

13 years agoAdd translation chaining support for amd64, x86 and ARM (VEX side).
Julian Seward [Mon, 2 Apr 2012 21:54:49 +0000 (21:54 +0000)] 
Add translation chaining support for amd64, x86 and ARM (VEX side).
See #296422.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2273

13 years agoMake a copy of r2270/r12476 for work on translation chaining.
Julian Seward [Mon, 2 Apr 2012 14:08:42 +0000 (14:08 +0000)] 
Make a copy of r2270/r12476 for work on translation chaining.

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2271

13 years agoInitial support for POWER Processor decimal floating point instruction
Julian Seward [Mon, 2 Apr 2012 10:20:48 +0000 (10:20 +0000)] 
Initial support for POWER Processor decimal floating point instruction
support -- VEX side changes.  See #295221.

This patch adds the DFP 64-bit and 128-bit support, support for the
new IEEE rounding modes and the Add, Subtract, Multiply and Divide
instructions for both 64-bit and 128-bit instructions to Valgrind.

Carl Love (carll@us.ibm.com) and Maynard Johnson (maynardj@us.ibm.com)

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

13 years agoConsolidate guest state offset computation. There is only
Florian Krohm [Tue, 27 Mar 2012 03:09:49 +0000 (03:09 +0000)] 
Consolidate guest state offset computation. There is only
one way. No need to precompute them and have them named in
three different ways.... Get rid of libvex_guest_offsets.h
dependency.

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

13 years agogcc seems to have taken to generating "orl $0xFFFFFFFF, %reg32" to get
Julian Seward [Mon, 26 Mar 2012 09:44:39 +0000 (09:44 +0000)] 
gcc seems to have taken to generating "orl $0xFFFFFFFF, %reg32" to get
-1 (32-bit) into a register.  [Is this wise?  Does the processor know
that this generates no dependency on the previous value of the
register?]  Teach the constant folder about such cases, therefore.

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

13 years agoRemove prototype for non-existing function.
Florian Krohm [Sun, 25 Mar 2012 16:17:18 +0000 (16:17 +0000)] 
Remove prototype for non-existing function.
Fix vpanic call.

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

13 years agoFor (T3) "ADD (SP plus register)", allow "add rX, SP, rY, lsl
Julian Seward [Wed, 21 Mar 2012 19:36:37 +0000 (19:36 +0000)] 
For (T3) "ADD (SP plus register)", allow "add rX, SP, rY, lsl
#{1,2,3}" as well as the non-shifted version.

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

13 years agoRename function. We want to be able to extract implemented
Florian Krohm [Sat, 17 Mar 2012 23:38:39 +0000 (23:38 +0000)] 
Rename function. We want to be able to extract implemented
opcodes by matching  /^s390_irgen_[A-Z]+/

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

13 years agoThis is a followup to r2263. Use offsetof.
Florian Krohm [Mon, 27 Feb 2012 15:38:34 +0000 (15:38 +0000)] 
This is a followup to r2263. Use offsetof.

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

13 years agoDo not assume that a pointer is the worst-aligned data type.
Florian Krohm [Sun, 26 Feb 2012 17:00:03 +0000 (17:00 +0000)] 
Do not assume that a pointer is the worst-aligned data type.
Fixes #283671

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

13 years agoIgnore redundant REX prefix on 4 byte form of PMOVMSKB. BZ#294736.
Tom Hughes [Fri, 24 Feb 2012 12:16:11 +0000 (12:16 +0000)] 
Ignore redundant REX prefix on 4 byte form of PMOVMSKB. BZ#294736.

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

13 years agoAdd a spec rule for SUBQ/NBE.
Julian Seward [Thu, 23 Feb 2012 07:36:43 +0000 (07:36 +0000)] 
Add a spec rule for SUBQ/NBE.

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

13 years agoImplementation of SSE 4.1 MPSADBW instruction. Fixes #294048.
Julian Seward [Tue, 21 Feb 2012 11:02:44 +0000 (11:02 +0000)] 
Implementation of SSE 4.1 MPSADBW instruction.  Fixes #294048.

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

13 years agoDon't claim to support 3dnow or 3dnowext on the baseline x86_64
Julian Seward [Tue, 21 Feb 2012 08:53:54 +0000 (08:53 +0000)] 
Don't claim to support 3dnow or 3dnowext on the baseline x86_64
CPU.  Fixes #291568.  (Reimar Döffinger, Reimar.Doeffinger@gmx.de)

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

13 years agoImprove code generation on s390x for assignment of constant
Florian Krohm [Mon, 20 Feb 2012 15:01:14 +0000 (15:01 +0000)] 
Improve code generation on s390x for assignment of constant
values to guest registers. Motivated by the observation that
piecing together a 64-bit value requires 4 insns on z900 and 2 insns
on newer models. Specifically:
(1) Assigning 0 can be done by using XC
(2) Assigning a value that differs by a small amount from the
    value previously assigned can be done using AGSI
    (Happens a lot for guest IA updates).
(3) If the new value differs from the previous one only
    in the lower word it is sufficient to assign the lower word.
(4) If the new value equals the old value the assignment is redundant
    and can be eliminated. This happens surprisingly often.
This buys us somewhere between 5% and 11.8% of insns (as measured
on the perf bucket).

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

13 years agoAccept DMB (mcr 15, 0, rT, c7, c10, 5) for any rT <= 14,
Julian Seward [Fri, 17 Feb 2012 15:07:09 +0000 (15:07 +0000)] 
Accept DMB (mcr 15, 0, rT, c7, c10, 5) for any rT <= 14,
not just when rT = r0.

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

13 years agoImplement PHMINPOSUW (SSE 4.1). Fixes #287301.
Julian Seward [Thu, 16 Feb 2012 22:02:14 +0000 (22:02 +0000)] 
Implement PHMINPOSUW (SSE 4.1).  Fixes #287301.
(Laurent Birtz, seerdecker@yahoo.com.au)

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

13 years agoRe-enable RET $imm16 following insn decoding framework rework.
Julian Seward [Thu, 16 Feb 2012 19:09:43 +0000 (19:09 +0000)] 
Re-enable RET $imm16 following insn decoding framework rework.
Fixes #292430 (a regression).

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

13 years agoAdd support for some 16-bit PCMPxSTRx variants. Prior to this point
Julian Seward [Thu, 16 Feb 2012 15:21:08 +0000 (15:21 +0000)] 
Add support for some 16-bit PCMPxSTRx variants.  Prior to this point
only 8-bit variants were supported.

Fixes #293754.  (Eliot Moss, moss@cs.umass.edu)

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

13 years agoAdds 16 and 32 bit fnsave/frstor, and 0x66 prefix on fldl, to guest
Julian Seward [Thu, 16 Feb 2012 14:18:56 +0000 (14:18 +0000)] 
Adds 16 and 32 bit fnsave/frstor, and 0x66 prefix on fldl, to guest
amd64.

The Oracle/Sun HotSpot Java virtual machine uses fnsave and frstor,
which valgrind supports for x86 but not amd64. Even more interesting,
HotSpot uses the 0x66 size prefix on these instructions, and on
fldl. This patch adds the 16- and 32-bit versions of fnsave/frstor to
the amd64 guest, and tolerates the 0x66 size prefix on fldl (but only
on these three fpu instructions, even though the AMD docs say all
other fpu instructions (except fnstenv and fldenv) *ignore* 0x66).

Fixes #294191.  (Eliot Moss, moss@cs.umass.edu)

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

13 years agoRe-enable CLFLUSH in the new decoding framework. Fixes #293808.
Julian Seward [Thu, 16 Feb 2012 13:45:13 +0000 (13:45 +0000)] 
Re-enable CLFLUSH in the new decoding framework.  Fixes #293808.
(Eliot Moss, moss@cs.umass.edu)

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

13 years agoBroadens the range on INT imm8 values that SIGSEGV, allowing Jikes RVM
Julian Seward [Thu, 16 Feb 2012 12:36:47 +0000 (12:36 +0000)] 
Broadens the range on INT imm8 values that SIGSEGV, allowing Jikes RVM
to work.

Jikes RVM uses INT 0x3F through 0x49, assuming that they result in a
SIGSEGV. The x86 guest currently does this only for INT 0x40 through
0x43. The attached patch extends the range to 0x3F through 0x4F,
covering all existing Jikes RVM INTs and leaving room for it to add a
few more before it runs into this problem again.

Fixes #294185.  (Eliot Moss, moss@cs.umass.edu)

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

13 years agoAdd a spec rule for HI after SUB. This turns up quite a lot
Julian Seward [Wed, 15 Feb 2012 19:11:44 +0000 (19:11 +0000)] 
Add a spec rule for HI after SUB.  This turns up quite a lot
on my Nexus S.

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

13 years agoAdd some VEX sanity checks for ppc64 unhandled instructions.
Florian Krohm [Wed, 15 Feb 2012 04:05:05 +0000 (04:05 +0000)] 
Add some VEX sanity checks for ppc64 unhandled instructions.
Patch by Maynard Johnson (maynardj@us.ibm.com). Fixes #293088.

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

13 years agoIn fold_Expr use a switch instead of an if-chain for clarity and
Florian Krohm [Wed, 15 Feb 2012 00:43:36 +0000 (00:43 +0000)] 
In fold_Expr use a switch instead of an if-chain for clarity and
efficiency.

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

13 years ago* fix Bug 290655 - Add support for AESKEYGENASSIST instruction
Philippe Waroquiers [Tue, 14 Feb 2012 21:34:56 +0000 (21:34 +0000)] 
* fix Bug 290655 - Add support for AESKEYGENASSIST instruction
  (VEX part)
  Patch implementing the AES instructions (AESKEYGENASSIST, AESIMC,
  AESENC, AESENCLAST, AESDEC, AESDECLAST).

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

13 years agoThis patch is a follow-up to r2244 which fixed bugzilla #287260 on
Florian Krohm [Mon, 13 Feb 2012 00:06:29 +0000 (00:06 +0000)] 
This patch is a follow-up to r2244 which fixed bugzilla #287260 on
some platforms but not on all that we test.

The issue was that cprop_BB did not see that in Add32(t2,t3) the
driving expressions for t2 and t3 were the same. Therefore, the
Add was not replaced with a shift (which is necessary for proper
memcheck operation).
So in this patch:

(1) In cprop_BB, when setting up the "env", record *any* assignment
    to a temporary (and not just those that are subject to copy
    propagation).
(2) Pass this env down to fold_Expr and then sameIRExprs.
(3) Replace sameIRTemps with sameIRExprs and enhance it. Upon
    encountering an RdTmp, check "env" and recurse into the
    expression assigned to the temporary.
    As a side, the functions sameIcoU32s and sameIRTempsOrIcoU32s
    and replaced with sameIRExprs.
(4) Add some machinery to monitor frequency and effectiveness of
    sameIRExprs (can be enabled by setting STATS_IROPT).

Hopefully, fixes #287260 for good.

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

13 years agoImplement TR, TRE, TRTT, TROT, TRTO insns.
Florian Krohm [Sat, 4 Feb 2012 17:07:07 +0000 (17:07 +0000)] 
Implement TR, TRE, TRTT, TROT, TRTO insns.
These are the VEX bits for fixing #273114.
Patch by Divya Vyas (divyvyas@linux.vnet.ibm.com).

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

13 years agoRewrite algebraic transformations for binary operators.
Florian Krohm [Sun, 29 Jan 2012 02:19:43 +0000 (02:19 +0000)] 
Rewrite algebraic transformations for binary operators.
Some optimizations were missed due to complex control flow.
Fixes #287260.

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

13 years agoMerge, from AVX branch, everything up to and including r2242
Julian Seward [Fri, 20 Jan 2012 13:07:24 +0000 (13:07 +0000)] 
Merge, from AVX branch, everything up to and including r2242
(revs 2212 - 2242 inclusive).  In summary, brings the new decoding
framework into the trunk.

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

13 years agoRevert accidental check in (part of r2240).
Florian Krohm [Wed, 18 Jan 2012 14:04:23 +0000 (14:04 +0000)] 
Revert accidental check in (part of r2240).

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

13 years agoRevert r2238. In 64-bit mode the length is in bits 0:63.
Florian Krohm [Wed, 18 Jan 2012 14:00:31 +0000 (14:00 +0000)] 
Revert r2238. In 64-bit mode the length is in bits 0:63.
Not sure what I was thinking then....

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

13 years agoRemove broken support for TS insn in s390 port. The
Florian Krohm [Mon, 16 Jan 2012 17:25:55 +0000 (17:25 +0000)] 
Remove broken support for TS insn in s390 port. The
atomicity was not modelled.
The insn is not issued (gcc) or used (glibc, libdfp)
and is discouraged in the principles of operations.
No point spending time on it. Fixes #270796

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

13 years agoFollowup to r2237. The length is in bits 32:63 only -- not 0:63.
Florian Krohm [Sun, 15 Jan 2012 23:17:06 +0000 (23:17 +0000)] 
Followup to r2237. The length is in bits 32:63 only -- not 0:63.

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

13 years agoAdd support for the s390's TROO insn. These are the VEX bits.
Florian Krohm [Sun, 15 Jan 2012 21:01:16 +0000 (21:01 +0000)] 
Add support for the s390's TROO insn. These are the VEX bits.
New hardware capability: VEX_HWCAPS_S390X_ETF2.
Patch by Divya Vyas (divyvyas@linux.vnet.ibm.com).
Partial fix of #273114

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

13 years agoAdd a comment about setting aside a register for VG_(dispatch_ctr)
Florian Krohm [Wed, 4 Jan 2012 01:34:53 +0000 (01:34 +0000)] 
Add a comment about setting aside a register for VG_(dispatch_ctr)
on s390.

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

13 years agoWhen reinterpreting a 32 bit int as a float we need to move it
Florian Krohm [Sun, 18 Dec 2011 15:51:54 +0000 (15:51 +0000)] 
When reinterpreting a 32 bit int as a float we need to move it
from gpr[32:63] to fpr[0:31]. And vice versa.

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

13 years agoHandle Iop_ReinterpF32asI32 and Iop_ReinterpI32asF32 in insn selection.
Florian Krohm [Sun, 18 Dec 2011 00:08:17 +0000 (00:08 +0000)] 
Handle Iop_ReinterpF32asI32 and Iop_ReinterpI32asF32 in insn selection.

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

13 years agoIop_1Uto64 was not handled in the ppc insn selector.
Florian Krohm [Wed, 16 Nov 2011 03:54:12 +0000 (03:54 +0000)] 
Iop_1Uto64 was not handled in the ppc insn selector.
Patch by Maynard Johnson (maynardj@us.ibm.com). Fixes #286374

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

13 years agoUpdate comment in r2229 to place the blame in the right place.
Julian Seward [Mon, 31 Oct 2011 15:25:55 +0000 (15:25 +0000)] 
Update comment in r2229 to place the blame in the right place.

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

13 years agox86g_dirtyhelper_FXRSTOR: work around what looks like a LLVM bug,
Julian Seward [Mon, 31 Oct 2011 10:52:21 +0000 (10:52 +0000)] 
x86g_dirtyhelper_FXRSTOR: work around what looks like a LLVM bug,
that causes this routine to segfault on x86-darwin.

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

13 years agoHandle "add.w reg, sp, #constT" and "addw reg, sp, #uimm12" for reg !=
Julian Seward [Wed, 26 Oct 2011 15:06:25 +0000 (15:06 +0000)] 
Handle "add.w reg, sp, #constT" and "addw reg, sp, #uimm12" for reg !=
PC.  Previous handling was overly restrictive -- only allowed
reg == SP.  (n-i-bz)

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

13 years agoUpdate all copyright dates, from 20xy-2010 to 20xy-2011.
Julian Seward [Sun, 23 Oct 2011 07:33:43 +0000 (07:33 +0000)] 
Update all copyright dates, from 20xy-2010 to 20xy-2011.

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

13 years agoFix the guest state definition for s390x and introduce dummy members
Florian Krohm [Sat, 22 Oct 2011 23:18:00 +0000 (23:18 +0000)] 
Fix the guest state definition for s390x and introduce dummy members
in places where 8-byte alignment is needed.

We need to make sure that libvex_guest_offsets.h contains correct
offsets even when genoffsets.c is compiled for a 32-bit target.

With this change a tarball built on x86 will result in a working
valgrind on s390x.

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

13 years agoVEX side fixes to match r12190, which is a fix for #279698 (incorrect
Julian Seward [Sat, 22 Oct 2011 09:32:16 +0000 (09:32 +0000)] 
VEX side fixes to match r12190, which is a fix for #279698 (incorrect
Memcheck handling of saturating narrowing operations.)

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

13 years agoFix timerfd-syscall testcase on s390x.
Florian Krohm [Thu, 20 Oct 2011 21:15:55 +0000 (21:15 +0000)] 
Fix timerfd-syscall testcase on s390x.

This was caused by an interaction of resteering and the infamous
EX insn. This sequence

j  someplace
ex ....

with the unconditional jump being subject to restering caused madness.
Such a sequence is found in glibc's syscall.S with the effect that all
system calls > 255 would have run into the same problem as timerfd_*.

Patch by Christian Borntraeger (borntraeger@de.ibm.com).

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

13 years agoHandle Thumb2 ROR (register) encoding T2. #284472.
Julian Seward [Thu, 20 Oct 2011 12:41:38 +0000 (12:41 +0000)] 
Handle Thumb2 ROR (register) encoding T2.  #284472.

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

13 years agoIgnore redundant REX.W on PTEST. #279071.
Julian Seward [Wed, 19 Oct 2011 20:36:20 +0000 (20:36 +0000)] 
Ignore redundant REX.W on PTEST.  #279071.
(Jakub Jelinek, jakub@redhat.com)

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

13 years agoHandle PCMPxSTRx case 0x38. Fixes #273318.
Julian Seward [Wed, 19 Oct 2011 20:08:57 +0000 (20:08 +0000)] 
Handle PCMPxSTRx case 0x38.  Fixes #273318.

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

13 years agoImplement the SSE4.1 insn PCMPEQQ. n-i-bz. (VEX side changes)
Julian Seward [Wed, 19 Oct 2011 15:24:01 +0000 (15:24 +0000)] 
Implement the SSE4.1 insn PCMPEQQ.  n-i-bz.  (VEX side changes)
** MERGE TO AVX **

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

13 years agoImplement SSE4.1 PMULUDQ. Fixes #280290. ** MERGE TO AVX **
Julian Seward [Wed, 19 Oct 2011 14:50:27 +0000 (14:50 +0000)] 
Implement SSE4.1 PMULUDQ.  Fixes #280290.  ** MERGE TO AVX **

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

13 years agoMark IR level calls and returns derived from ARM and Thumb code
Julian Seward [Fri, 14 Oct 2011 15:44:00 +0000 (15:44 +0000)] 
Mark IR level calls and returns derived from ARM and Thumb code
more correctly.  Fixes #252091.
(Timothy B. Terriberry, tterribe@xiph.org)

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

13 years agoIgnore the precision flag in the ROUND{SS,SD,PS,PD} rounding mode.
Tom Hughes [Sun, 2 Oct 2011 10:04:29 +0000 (10:04 +0000)] 
Ignore the precision flag in the ROUND{SS,SD,PS,PD} rounding mode.
Fixes #283000.

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

13 years agoarm backend: general (fallback) case handling for 64HLtoV128
Julian Seward [Fri, 30 Sep 2011 08:49:02 +0000 (08:49 +0000)] 
arm backend: general (fallback) case handling for 64HLtoV128
(Niall Dalton, niall.dalton@gmail.com).  Fixes #281836.

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

13 years agoSupport ARM and Thumb "CLREX" instructions since Dalvik generates
Julian Seward [Mon, 26 Sep 2011 16:19:43 +0000 (16:19 +0000)] 
Support ARM and Thumb "CLREX" instructions since Dalvik generates
them.  Mucho hassle for something that is used considerably less often
than once in a blue moon.

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

13 years agoAdd another slot on the stack frame used in the dispatcher.
Florian Krohm [Sun, 25 Sep 2011 00:05:31 +0000 (00:05 +0000)] 
Add another slot on the stack frame used in the dispatcher.
It is used by the profiling dispatcher to store the IA between
iterations.

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

13 years agoDocument and assert that needs_self_check of VexTranslateArgs
Florian Krohm [Fri, 23 Sep 2011 18:03:21 +0000 (18:03 +0000)] 
Document and assert that needs_self_check of VexTranslateArgs
must not be NULL.

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

13 years agoAdd a couple of spec rules for MI and PL after LOGIC. These are
Julian Seward [Fri, 23 Sep 2011 15:04:29 +0000 (15:04 +0000)] 
Add a couple of spec rules for MI and PL after LOGIC.  These are
important for avoiding false positives in Android syscall handlers.

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

13 years agoAdd some counter arrays for profiling N,Z,C,V flag evaluations.
Julian Seward [Fri, 23 Sep 2011 10:12:19 +0000 (10:12 +0000)] 
Add some counter arrays for profiling N,Z,C,V flag evaluations.

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

13 years agoAdd a couple more spec rules: LO after SUB and GT after SUB.
Julian Seward [Fri, 23 Sep 2011 08:30:34 +0000 (08:30 +0000)] 
Add a couple more spec rules: LO after SUB and GT after SUB.

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

13 years agoEnable move coalescing for Neon (vector) moves. Reduces code
Julian Seward [Thu, 22 Sep 2011 21:33:27 +0000 (21:33 +0000)] 
Enable move coalescing for Neon (vector) moves.  Reduces code
size by about 10% for Neon-heavy code; gark.

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

13 years agoFix an obscure type error in printing of Neon instructions, that
Julian Seward [Thu, 22 Sep 2011 21:01:52 +0000 (21:01 +0000)] 
Fix an obscure type error in printing of Neon instructions, that
could cause assertion failures under some circumstances.  (How come
none of the static checkers etc picked this up before now?)

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

13 years agoUse mkite throughout.
Florian Krohm [Fri, 9 Sep 2011 02:38:55 +0000 (02:38 +0000)] 
Use mkite throughout.

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

13 years agoSupport CLCL and MVCL instructions. Based on a patch from
Florian Krohm [Thu, 8 Sep 2011 15:37:39 +0000 (15:37 +0000)] 
Support CLCL and MVCL instructions. Based on a patch from
Divya Vyas (divyvyas@linux.vnet.ibm.com) with several changes.
Fixes #279027.

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

13 years agoAdd support for IBM Power ISA 2.06 -- stage 3.
Julian Seward [Mon, 5 Sep 2011 12:11:06 +0000 (12:11 +0000)] 
Add support for IBM Power ISA 2.06 -- stage 3.
The purpose of this bug is to add support for the third and final subset of the
new instructions in IBM Power ISA 2.06 (i.e., IBM POWER7 processor).
(VEX changes.  Bug 279994 comment 1).
(Maynard Johnson, maynardj@us.ibm.com)

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

13 years agoAdd support for s390x model z114.
Florian Krohm [Fri, 2 Sep 2011 22:19:47 +0000 (22:19 +0000)] 
Add support for s390x model z114.

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

13 years agoSupport "ENTER $imm16, $0"; some part of the OSX 10.7 library stack
Julian Seward [Sat, 27 Aug 2011 21:00:22 +0000 (21:00 +0000)] 
Support "ENTER $imm16, $0"; some part of the OSX 10.7 library stack
needs it (I forget which bit).

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

13 years agoSupport alternate (C0 /6) encoding of SHL on x86 and amd64. Fixes #209995.
Tom Hughes [Fri, 19 Aug 2011 16:06:52 +0000 (16:06 +0000)] 
Support alternate (C0 /6) encoding of SHL on x86 and amd64. Fixes #209995.

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

13 years agoFix panic message.
Florian Krohm [Fri, 19 Aug 2011 02:58:51 +0000 (02:58 +0000)] 
Fix panic message.

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

14 years agoSupport an address size override prefix for REP prefixed string
Tom Hughes [Fri, 12 Aug 2011 15:42:56 +0000 (15:42 +0000)] 
Support an address size override prefix for REP prefixed string
instructions on amd64. Fixes remaining issues from #211371.

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

14 years agoAdd support for CKSM.
Florian Krohm [Thu, 11 Aug 2011 16:58:45 +0000 (16:58 +0000)] 
Add support for CKSM.
Patch by Divya Vyas (divyvyas@linux.vnet.ibm.com) with modifications.
Fixes #275517.

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

14 years agoSupport FEMMS in x86 mode as we already do for amd64. Fix for #204574.
Tom Hughes [Thu, 11 Aug 2011 14:43:12 +0000 (14:43 +0000)] 
Support FEMMS in x86 mode as we already do for amd64. Fix for #204574.

Note, from #124499 where this was discussed for amd64, that FEMMS is
a 3DNow instruction that has identical behaviour to EMMS and is only
supposed on AMD processors for backwards compatibility.

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

14 years agoSupport XCHG AX, reg16 on amd64. Fixes #252695.
Tom Hughes [Wed, 10 Aug 2011 12:58:03 +0000 (12:58 +0000)] 
Support XCHG AX, reg16 on amd64. Fixes #252695.

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

14 years agoSupplement to r2189.
Florian Krohm [Mon, 8 Aug 2011 19:41:58 +0000 (19:41 +0000)] 
Supplement to r2189.
Provide dummy function definition for non-s390 hosts.

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

14 years agoHandle the invalid opcode 0000.
Florian Krohm [Mon, 8 Aug 2011 18:22:58 +0000 (18:22 +0000)] 
Handle the invalid opcode 0000.
This is sometimes used by applications on purpose.
Although never executed, we might still decode it because
of chasing unconditional goto/calls.

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

14 years agoRemove a redundant check. Found by Coverity.
Florian Krohm [Mon, 1 Aug 2011 22:33:10 +0000 (22:33 +0000)] 
Remove a redundant check. Found by Coverity.
Patch by Jakub Jelinek (jakub@redhat.com). Fixes #279062.

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

14 years agoFor a special opcode the address of the next insn was
Florian Krohm [Mon, 1 Aug 2011 22:07:51 +0000 (22:07 +0000)] 
For a special opcode the address of the next insn was
not computed correctly. It would point to an insn in
the middle of the the pattern that identifies a special opcode.
That didn't hurt much but was confusing. Now fixed.

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

14 years agoFix an assert.
Florian Krohm [Sat, 30 Jul 2011 20:09:28 +0000 (20:09 +0000)] 
Fix an assert.
This occured when we were chasing a branch insn (thereby setting the
disassembly result to Dis_ResteerU and the continueAt field to something
non-zero) and later changing the result kind to Dis_StopHere (because
the next insn is an EX insn). The ContinueAt field remained non-zero
in the case causing an assert down the road.
This should fix the failing test memcheck/tests/linux/timerfd-syscall

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

14 years agoDo not access addresses that belong to the client executable.
Florian Krohm [Wed, 27 Jul 2011 20:40:22 +0000 (20:40 +0000)] 
Do not access addresses that belong to the client executable.
It might not be there when we use VEX outside valgrind.

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

14 years agoAdd support for IBM Power ISA 2.06 -- stage 2. Bug 276784.
Julian Seward [Sun, 24 Jul 2011 14:13:21 +0000 (14:13 +0000)] 
Add support for IBM Power ISA 2.06 -- stage 2.  Bug 276784.
(Maynard Johnson, maynardj@us.ibm.com)

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

14 years agoComparing a boolean value for != 0 yields a result that is identical
Florian Krohm [Sat, 23 Jul 2011 00:23:02 +0000 (00:23 +0000)] 
Comparing a boolean value for != 0 yields a result that is identical
to the value being compared. So we can simplify e.g

   CmpNE32( 1Uto32(CmpEQ64(p,q)), 0 )   -->   CmpEQ64(p,q).

And likewise for CmpNEZ operations.
This revision adds tree patterns to optimise some of those
comparisons.

This is particularly beneficial for s390x where moving the
condition code into a GPR is an expensive operation. With this
optimisation an up to 8% reduction in generated code was observed.

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

14 years agoRemove a redundant assert. Minor code tweaks.
Florian Krohm [Fri, 22 Jul 2011 02:12:28 +0000 (02:12 +0000)] 
Remove a redundant assert. Minor code tweaks.

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

14 years agoNeon loads/stores: rename some vars, plus the main function, and add
Julian Seward [Thu, 21 Jul 2011 22:45:42 +0000 (22:45 +0000)] 
Neon loads/stores: rename some vars, plus the main function, and add
comments.  Non-functional change.

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

14 years agoAdd algebraic simplification as follows:
Florian Krohm [Thu, 21 Jul 2011 16:21:58 +0000 (16:21 +0000)] 
Add algebraic simplification as follows:
  Add64(0,x) ==> x
  Add32(0,x) ==> x
  Sub64(x,0) ==> x

Add helper functions: isZeroU32 and isZeroU64.

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