]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
13 years agoMerge from trunk, r2229 and 2230 (lame workaround for the fact that
Julian Seward [Tue, 1 Nov 2011 07:10:37 +0000 (07:10 +0000)] 
Merge from trunk, r2229 and 2230 (lame workaround for the fact that
VEX doesn't keep the stack properly aligned for function calls on Darwin)

git-svn-id: svn://svn.valgrind.org/vex/branches/VEX_3_7_BRANCH@2231

13 years agoMerge from trunk, r2227 (Handle "add.w reg, sp, #constT" et al better.)
Julian Seward [Thu, 27 Oct 2011 10:58:38 +0000 (10:58 +0000)] 
Merge from trunk, r2227 (Handle "add.w reg, sp, #constT" et al better.)

git-svn-id: svn://svn.valgrind.org/vex/branches/VEX_3_7_BRANCH@2228

13 years agoCreate branches/VEX_3_7_BRANCH as a copy of trunk r2225.
Julian Seward [Tue, 25 Oct 2011 09:10:58 +0000 (09:10 +0000)] 
Create branches/VEX_3_7_BRANCH as a copy of trunk r2225.

git-svn-id: svn://svn.valgrind.org/vex/branches/VEX_3_7_BRANCH@2226

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

14 years agoAdd support for Thumb2 encodings of PLD and PLDW. Bug 277653.
Julian Seward [Thu, 21 Jul 2011 06:17:21 +0000 (06:17 +0000)] 
Add support for Thumb2 encodings of PLD and PLDW.  Bug 277653.
(Mans Rullgard, mans@mansr.com)

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

14 years agoMake VMOV.F32 load the correct value into the destination register.
Julian Seward [Tue, 19 Jul 2011 15:48:29 +0000 (15:48 +0000)] 
Make VMOV.F32 load the correct value into the destination register.
Bug 277780.  (Mans Rullgard, mans@mansr.com)

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

14 years agoFix BLX r14 in ARM mode, which was broken due to incorrect sequencing
Julian Seward [Tue, 19 Jul 2011 08:20:24 +0000 (08:20 +0000)] 
Fix BLX r14 in ARM mode, which was broken due to incorrect sequencing
of guest r14 reading vs writing.  Thumb mode does not have the same
problem.  Bug 277694.  (Mans Rullgard, mans@mansr.com)

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

14 years agoFix NEON VMUL by float scalar. Bug 277663.
Julian Seward [Tue, 19 Jul 2011 07:37:03 +0000 (07:37 +0000)] 
Fix NEON VMUL by float scalar.  Bug 277663.
(Mans Rullgard, mans@mansr.com)

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

14 years agoUpdate a FIXME. Should have been included in r2174
Florian Krohm [Sun, 17 Jul 2011 14:16:41 +0000 (14:16 +0000)] 
Update a FIXME. Should have been included in r2174

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

14 years agoVEX-side changes to enable chasing of unconditional jumps/calls
Florian Krohm [Sat, 16 Jul 2011 02:11:50 +0000 (02:11 +0000)] 
VEX-side changes to enable chasing of unconditional jumps/calls
for s390x.  See also valgrind r11899.

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

14 years agoTighten up an instruction decoding exception for
Julian Seward [Mon, 11 Jul 2011 15:49:39 +0000 (15:49 +0000)] 
Tighten up an instruction decoding exception for
add.w reg, sp, #constT.

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

14 years agoComplete the implementation of ARM atomic ops: {LD,ST}REX{,B,H,D} in
Julian Seward [Mon, 11 Jul 2011 11:43:38 +0000 (11:43 +0000)] 
Complete the implementation of ARM atomic ops: {LD,ST}REX{,B,H,D} in
both ARM and Thumb encodings, for NEON and non-NEON capable backends.
Bug 266035 comments 4, 43, 51.  Derived from patches by Jeff Brown
<jeffbrown@google.com>, Igor Saenko <igor.saenko@gmail.com> and
Dr. David Alan Gilbert <david.gilbert@linaro.org>.

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

14 years agoSupport the STFLE instruction via a dirty helper.
Florian Krohm [Mon, 11 Jul 2011 01:48:02 +0000 (01:48 +0000)] 
Support the STFLE instruction via a dirty helper.
VEX-side changes to fix bug #271776.
Patch provided by Divya Vyas <divyvyas@linux.vnet.ibm.com>

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

14 years agoAdd support for Thumb ADDW reg, reg, #uimm12 and SUBW ditto. Bug
Julian Seward [Fri, 8 Jul 2011 15:36:59 +0000 (15:36 +0000)] 
Add support for Thumb ADDW reg, reg, #uimm12 and SUBW ditto.  Bug
266035 comments 7 and 8.  (Jeff Brown, jeffbrown@google.com and Kenny
Root.)

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

14 years agoAdd a spec rule for NZ after LOGICQ, whilst chasing after a strange
Julian Seward [Thu, 7 Jul 2011 13:58:10 +0000 (13:58 +0000)] 
Add a spec rule for NZ after LOGICQ, whilst chasing after a strange
interaction between Memcheck and Clang-generated code.

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

14 years agoRename S390_GUEST_OFFSET to S390X_GUEST_OFFSET and use
Florian Krohm [Tue, 5 Jul 2011 02:48:39 +0000 (02:48 +0000)] 
Rename S390_GUEST_OFFSET to S390X_GUEST_OFFSET and use
it throughout.

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

14 years agoMisc s390x cleanups
Florian Krohm [Tue, 5 Jul 2011 02:09:01 +0000 (02:09 +0000)] 
Misc s390x cleanups
- Give more functions internal linkage
- Remove unneeded tag names

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

14 years agoThumb2 front end: improved analysis of IT instructions that might
Julian Seward [Mon, 4 Jul 2011 16:58:40 +0000 (16:58 +0000)] 
Thumb2 front end: improved analysis of IT instructions that might
guard the one being translated, with the goal of proving this
isn't the case more of the time.  Reduces the amount of generated
code by about 10% with --tool=none, and performance improvements
(also with --tool=none) of up to 25% have been observed.

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

14 years agoGet rid of redundant address mode calculation.
Florian Krohm [Sat, 25 Jun 2011 02:25:41 +0000 (02:25 +0000)] 
Get rid of redundant address mode calculation.
Fixes #275710.   (Christian Borntraeger <borntraeger@de.ibm.com>)

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

14 years agoUpdate ignored files for VEX.
Florian Krohm [Thu, 23 Jun 2011 12:00:32 +0000 (12:00 +0000)] 
Update ignored files for VEX.

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

14 years agoRename and rationalise the vector narrowing and widening primops, so
Julian Seward [Thu, 16 Jun 2011 11:36:23 +0000 (11:36 +0000)] 
Rename and rationalise the vector narrowing and widening primops, so
as to give them a consistent, understandable naming scheme.  Finishes
off the process that was begun in r2159.

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

14 years agoReduce warning noise (make it in line with main Valgrind build)
Julian Seward [Thu, 16 Jun 2011 11:34:25 +0000 (11:34 +0000)] 
Reduce warning noise (make it in line with main Valgrind build)

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

14 years agoUnbreak Altivec support following r2159 (rename of saturating
Julian Seward [Wed, 15 Jun 2011 19:06:36 +0000 (19:06 +0000)] 
Unbreak Altivec support following r2159 (rename of saturating
narrowing primops)

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

14 years agoImplement PACKUSDW (SSE4.1). Fixes #274776.
Julian Seward [Wed, 15 Jun 2011 16:05:07 +0000 (16:05 +0000)] 
Implement PACKUSDW (SSE4.1).  Fixes #274776.

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

14 years agoPartially fix underspecification of saturating narrowing primops that
Julian Seward [Wed, 15 Jun 2011 15:09:37 +0000 (15:09 +0000)] 
Partially fix underspecification of saturating narrowing primops that
became apparent whilst looking into the problem of implementing the
SSE4 packusdw instruction.  Probably breaks Altivec.

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

14 years agoChange the interface to LibVEX_Translate slightly, so as to make the
Julian Seward [Tue, 7 Jun 2011 21:28:38 +0000 (21:28 +0000)] 
Change the interface to LibVEX_Translate slightly, so as to make the
generation of self-modifying-code checks more flexible.  With this
change, the decision about which parts (extents) of the newly created
IRSB need self-checks is deferred until after the IRSB has been
created.  This allows the caller to decide, for each extent
individually, whether it needs a self-check, and the caller can make
those decisions based on the addresses of the guest instructions in
the extents.

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

14 years agoAdd some more spec rules, for performance purposes:
Julian Seward [Mon, 6 Jun 2011 10:17:46 +0000 (10:17 +0000)] 
Add some more spec rules, for performance purposes:
* S and NS after LOGICL
* BE after SUBB
* B after SUBL

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

14 years agoImprovements to code generation for 32 bit instructions. When
Julian Seward [Sun, 5 Jun 2011 17:56:03 +0000 (17:56 +0000)] 
Improvements to code generation for 32 bit instructions.  When
appropriate, generate 32 bit add/sub/and/or/xor/cmp, so as to avoid a
bunch of cases where previously values would have been widened to 64
bits, or shifted left 32 bits, before being used.  Reduces the size of
the generated code by up to 2.8%.

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

14 years agox86 and amd64 back ends: when generating transfers back to the
Julian Seward [Sun, 29 May 2011 09:29:18 +0000 (09:29 +0000)] 
x86 and amd64 back ends: when generating transfers back to the
dispatcher, generate a jump either to the unassisted (GSP unchanged,
the common case) or assisted (GSP changed, request some action before
continuing) dispatcher.  This removes two instructions per dispatch
for the common case.  Changes for all other targets are interface-only
changes due to change in type of the emit_XXInstr functions.

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

14 years agoComment-only change.
Julian Seward [Sat, 28 May 2011 11:06:14 +0000 (11:06 +0000)] 
Comment-only change.

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

14 years agoAdd a field 'UChar delta' to IRStmt_IMark, and use it to carry around
Julian Seward [Fri, 27 May 2011 13:20:56 +0000 (13:20 +0000)] 
Add a field 'UChar delta' to IRStmt_IMark, and use it to carry around
the T bit for the instruction when the instruction is a ARM/Thumb.
This more or less avoids introducing Thumb specific hacks in the IR,
yet makes it possible to identify, from an IMark, whether it refers to
a Thumb or ARM instruction.  This is important for the GDB server
integration to work properly on Thumb code.

Patch from bug 214909 comment 99 (vex part).
(Philippe Waroquiers, philippe.waroquiers@skynet.be)

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

14 years agos390x: provide clock instructions like STCK
Julian Seward [Tue, 17 May 2011 16:18:36 +0000 (16:18 +0000)] 
s390x: provide clock instructions like STCK
s390x provides user space accessible instructions to get the HW time (e.g. via
store clock STCK). while userspace programs should use gettimeofday and friends
to cope with ntp/system time etc, a lot of programs still make use of STCK.
valgrind should implement these instruction.
(Christian Borntraeger <borntraeger@de.ibm.com> and Divya Vyas)

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

14 years agoARM front end only: when processing Thumb instructions, create
Julian Seward [Wed, 11 May 2011 14:17:35 +0000 (14:17 +0000)] 
ARM front end only: when processing Thumb instructions, create
IMark entries for the correct addresses.

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

14 years agoAdd LIKELY/UNLIKELY macros for general use, replacing s390x-specific
Julian Seward [Mon, 9 May 2011 21:45:04 +0000 (21:45 +0000)] 
Add LIKELY/UNLIKELY macros for general use, replacing s390x-specific
versions.  See #271504.  (Florian Krohm, britzel@acm.org)

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

14 years agos390x: fix DISP20 macro. Remove duplicate defn and avoid problems of
Julian Seward [Mon, 9 May 2011 20:35:41 +0000 (20:35 +0000)] 
s390x: fix DISP20 macro.  Remove duplicate defn and avoid problems of
right-shifting negative values.  Fixes #272067.
(Florian Krohm, britzel@acm.org)

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

14 years agoHandle Iop_I64UtoF32 in the ppc32/ppc64 insn selector. Fixes #270851.
Julian Seward [Sun, 8 May 2011 22:05:10 +0000 (22:05 +0000)] 
Handle Iop_I64UtoF32 in the ppc32/ppc64 insn selector.  Fixes #270851.
(Maynard Johnson, maynardj@us.ibm.com)

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

14 years agoFix jump kind for indirect BLX for Thumb insns. Bug 266035 comment
Julian Seward [Sun, 8 May 2011 10:16:45 +0000 (10:16 +0000)] 
Fix jump kind for indirect BLX for Thumb insns.  Bug 266035 comment
14.  (Evgeniy Stepanov, eugeni.stepanov@gmail.com)

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

14 years agoSupport DMB and DSB variants on Thumb. Bug 266035 comment 6.
Julian Seward [Sun, 8 May 2011 09:09:12 +0000 (09:09 +0000)] 
Support DMB and DSB variants on Thumb.  Bug 266035 comment 6.
(Jeff Brown, jeffbrown@google.com)

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

14 years agoFix an assertion failure caused by r2144 (improved assertions to do
Julian Seward [Thu, 5 May 2011 07:46:28 +0000 (07:46 +0000)] 
Fix an assertion failure caused by r2144 (improved assertions to do
with PPCCondCode).

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

14 years agoTighten up condition code handling in the back end, so as to placate
Julian Seward [Wed, 4 May 2011 09:50:48 +0000 (09:50 +0000)] 
Tighten up condition code handling in the back end, so as to placate
IBM's BEAM checker.  There is no error in the existing code.  However
BEAM doesn't know that when PPCCondCode::test == Pct_ALWAYS then the
::flag field is irrelevant, and so it believes it is being used
uninitialised.  Add a Pcf_NONE ::flag value for use in that case, and
add assertions to match.  (Untested!)

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

14 years agoSupport DMB and DSB variants on ARM. Bug 266035 comment 3.
Julian Seward [Tue, 3 May 2011 14:57:59 +0000 (14:57 +0000)] 
Support DMB and DSB variants on ARM.  Bug 266035 comment 3.
(Jeff Brown, jeffbrown@google.com)

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

14 years agoFix a bogus assertion observed by Florian Krohm.
Julian Seward [Tue, 3 May 2011 11:08:39 +0000 (11:08 +0000)] 
Fix a bogus assertion observed by Florian Krohm.

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

14 years agoFix a nonsensical assertion observed by Florian Krohm.
Julian Seward [Tue, 3 May 2011 07:51:49 +0000 (07:51 +0000)] 
Fix a nonsensical assertion observed by Florian Krohm.

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

14 years agoAdd a spec rule for V after SUB.
Julian Seward [Mon, 2 May 2011 18:57:56 +0000 (18:57 +0000)] 
Add a spec rule for V after SUB.

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

14 years agoSplit up armg_calculate_flags_nzcv into four functions that compute
Julian Seward [Mon, 2 May 2011 07:21:04 +0000 (07:21 +0000)] 
Split up armg_calculate_flags_nzcv into four functions that compute
the flags individually.  This seems to be a net performance win,
because often only one or two of the flags computed by
armg_calculate_flags_nzcv, so time was wasted computing the other
ones.

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

14 years agoImprovements to condition code handling on ARM.
Julian Seward [Sun, 1 May 2011 18:47:10 +0000 (18:47 +0000)] 
Improvements to condition code handling on ARM.

(1) guest_arm_spechelper: add another spec rule for
    armg_calculate_condition.  Add a spec rules for
    armg_calculate_flag_c and armg_calculate_flag_v.

(2) guest_arm_toIR.c: when storing oldC (shifter carry out) and
    oldV values in the thunk, be sure to ensure the top 31 bits
    are zero.  This improves the effectiveness of the new spec
    rules (1) by avoiding getting into situations where we have
    Mux0X(c, x, And32(x,1)), where in fact x has bits 31:1 as
    zero.  iropt can't fold that out.  So make sure the spec
    rules don't generate any unnecessary And32(x,1); hence the
    above becomes Mux0X(c, x, x) which iropt can reduce simply
    to "x".

(3) armg_calculate_flags_nzcv: assert condition (2) wherever
    possible.

These changes drastically improve --tool=none performance in some
cases (eg, perf/fbench with softfloat is doubled in speed).

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

14 years agoWhen simplifying (improving) the IR generated by the ARM front end, do
Julian Seward [Sun, 1 May 2011 18:36:51 +0000 (18:36 +0000)] 
When simplifying (improving) the IR generated by the ARM front end, do
CSE by default.  This significantly improves performance for ARM (not
Thumb) code that leans heavily on predicated instructions by commoning
up duplicate condition code evaluations within a single IRSB.

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

14 years agoHandle Iop_Not64 when doing 32-bit code generation. Also, assert that
Julian Seward [Thu, 28 Apr 2011 21:03:54 +0000 (21:03 +0000)] 
Handle Iop_Not64 when doing 32-bit code generation.  Also, assert that
iselWordExpr_R is not asked to handle Iop_Not64 in 32-bit mode.
Fixes #270856.  (Maynard Johnson, maynardj@us.ibm.com)

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

14 years agos390x : misc cleanups
Julian Seward [Thu, 28 Apr 2011 20:13:45 +0000 (20:13 +0000)] 
s390x : misc cleanups

- Remove fixs390 regarding storing the instruction address in the
  IP_AT_SYSCALL slot in the guest state. I'm not sure this is used
  but it certainly makes sense.

- Remove fixs390 in function s390_irgen_XONC. This was missed in
  VEX r2113.

Partial fix for #271501. (Florian Krohm, britzel@acm.org)

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

14 years agos390x: Implement Ist_MBE
Julian Seward [Thu, 28 Apr 2011 18:48:06 +0000 (18:48 +0000)] 
s390x: Implement Ist_MBE
VEX IR provides the statement Ist_MBE which is used to implement memory
barriers (Imbe_Fence). We use this statement to implement serialization which
is similar.
Fixes #271385.  (Florian Krohm, britzel@acm.org)

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

14 years agos390x: fix code confusion
Julian Seward [Thu, 28 Apr 2011 18:38:42 +0000 (18:38 +0000)] 
s390x: fix code confusion
Fix an enum-type mixup found by the IBM checker.
Fixes #271259.  (Florian Krohm, britzel@acm.org)

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

14 years agos390x: invalid use of R0 as base register
Julian Seward [Wed, 27 Apr 2011 12:07:01 +0000 (12:07 +0000)] 
s390x: invalid use of R0 as base register
When emitting code for a shift operation with the shift amount operand being in
memory we load the shift amount into R0 and use that register in SLAG etc..
That won't work because the contents of R0 will be ignored when used as a base
reg.
So, let's choose some other register and save/restore it.

Fixes #270959.  (Florian Krohm, britzel@acm.org)

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

14 years agos390x: fpr - gpr transfer facility
Julian Seward [Wed, 27 Apr 2011 11:58:22 +0000 (11:58 +0000)] 
s390x: fpr - gpr transfer facility
We need to introduce a new hwcap to model the presence of the fpr - gpr
transfer facility. If it is not available, we cannot use the LDGR and LGDR
insns and need to use a trick similar to what ppc does (write/read stack
location).
Fixes #268619 (vex side).
(Florian Krohm, britzel@acm.org)

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

14 years agoFix up incorrect usage of Iop_I64UtoF32 in the PowerPC front and back
Julian Seward [Wed, 27 Apr 2011 10:07:42 +0000 (10:07 +0000)] 
Fix up incorrect usage of Iop_I64UtoF32 in the PowerPC front and back
ends.  Partial fix for #270851.

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

14 years agoFix up some enum confusion to do with ARMNeonUnOp and ARMNeonUnOpS, as
Julian Seward [Wed, 27 Apr 2011 07:02:44 +0000 (07:02 +0000)] 
Fix up some enum confusion to do with ARMNeonUnOp and ARMNeonUnOpS, as
found by "the IBM checker", and also by clang-2.9.  Fixes #271820.
(Florian Krohm, britzel@acm.org)

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

14 years agoFix up enum confusion between PPCAvOp and PPCAvFpOp, as found by
Julian Seward [Tue, 26 Apr 2011 21:36:09 +0000 (21:36 +0000)] 
Fix up enum confusion between PPCAvOp and PPCAvFpOp, as found by
"the IBM checker", and also by clang-2.9.  Fixes #271579.
(Florian Krohm, britzel@acm.org)

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

14 years agoAdd support for IBM Power ISA 2.06 -- stage 1. Bug #267630 and
Julian Seward [Fri, 15 Apr 2011 11:55:00 +0000 (11:55 +0000)] 
Add support for IBM Power ISA 2.06 -- stage 1.  Bug #267630 and
followup fix #270794.  (Maynard Johnson, maynardj@us.ibm.com)

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

14 years agos390x: reconsider "long displacement" requirement. We currently
Julian Seward [Wed, 13 Apr 2011 15:38:17 +0000 (15:38 +0000)] 
s390x: reconsider "long displacement" requirement.  We currently
require that the host supports accessing memory using long
displacement. On older machines e.g. z900 that is an expensive
operation, because it is millicoded. It would be a performance win to
relax that requirement.  (VEX side changes.)  See #268620.
(Florian Krohm, britzel@acm.org)

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

14 years agos390x: Make sure to point the PSW address to the next address on SIGILL
Julian Seward [Wed, 13 Apr 2011 15:10:16 +0000 (15:10 +0000)] 
s390x: Make sure to point the PSW address to the next address on SIGILL
Fixes #270082.  (Christian Borntraeger <borntraeger@de.ibm.com>)

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