]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
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

14 years agos390x: minor code generation tweaks. There were a few loose ends
Julian Seward [Wed, 13 Apr 2011 14:44:29 +0000 (14:44 +0000)] 
s390x: minor code generation tweaks.  There were a few loose ends
(identified by fixs390) in code generation that are fixed by the
attached patch:
- use of SLFI insn if available
- unnecessary vpanic
An out-of-date comment is also removed.

Fixes #269736.  (Florian Krohm <britzel@acm.org>)

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

14 years agos390x: tweak s390_emit_load_cc. #269864.
Julian Seward [Tue, 5 Apr 2011 14:04:53 +0000 (14:04 +0000)] 
s390x: tweak s390_emit_load_cc.  #269864.
(Florian Krohm, britzel@acm.org)

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

14 years agoRemove unused parameter in functions s390_emit_SLL/SRL/SRA.
Julian Seward [Tue, 5 Apr 2011 14:00:37 +0000 (14:00 +0000)] 
Remove unused parameter in functions s390_emit_SLL/SRL/SRA.
Fixes #269863.  (Florian Krohm, britzel@acm.org)

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

14 years agoSupport conditional load and store for s390x (VEX side).
Julian Seward [Tue, 5 Apr 2011 13:19:33 +0000 (13:19 +0000)] 
Support conditional load and store for s390x (VEX side).
Fixes #269209.  (Christian Borntraeger, borntraeger@de.ibm.com)

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

14 years agoAdd some extra folding rules. Fixes #268513.
Julian Seward [Tue, 5 Apr 2011 11:06:02 +0000 (11:06 +0000)] 
Add some extra folding rules.  Fixes #268513.
(Florian Krohm <britzel@acm.org>)

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

14 years agoRemove dead assignments that gcc-4.6.0 complains about
Julian Seward [Mon, 28 Mar 2011 12:14:48 +0000 (12:14 +0000)] 
Remove dead assignments that gcc-4.6.0 complains about
("[-Wunused-but-set-variable]")

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

14 years agoAdd a spec rule for NS after LOGICB. Fixes #266990.
Julian Seward [Sun, 27 Mar 2011 22:16:08 +0000 (22:16 +0000)] 
Add a spec rule for NS after LOGICB.  Fixes #266990.

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

14 years agoDon't overwrite CC_NDEP in shift by zero. Fixes #269354.
Julian Seward [Sat, 26 Mar 2011 07:28:51 +0000 (07:28 +0000)] 
Don't overwrite CC_NDEP in shift by zero.  Fixes #269354.
(Stephen McCamant, smcc@CS.Berkeley.EDU)

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

14 years agoHandle more cases of SUB (SP minus immediate/register). Also
Julian Seward [Thu, 24 Mar 2011 11:14:02 +0000 (11:14 +0000)] 
Handle more cases of SUB (SP minus immediate/register).  Also
tighten up checks for SP plus register.  Fixes #269078.
(Ulrich Weigand, uweigand@de.ibm.com)

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

14 years agos390x: MHY is not universally available. Fixes #268930.
Julian Seward [Thu, 24 Mar 2011 09:01:50 +0000 (09:01 +0000)] 
s390x: MHY is not universally available.  Fixes #268930.
(Florian Krohm, britzel@acm.org)

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

14 years agos390x: FLOGR is not universally available. Fixes #268715.
Julian Seward [Thu, 24 Mar 2011 08:57:29 +0000 (08:57 +0000)] 
s390x: FLOGR is not universally available.  Fixes #268715.
(Florian Krohm, britzel@acm.org)

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

14 years agos390x: improve IR generation for XC. Fixes #268621.
Julian Seward [Thu, 24 Mar 2011 08:50:04 +0000 (08:50 +0000)] 
s390x: improve IR generation for XC.  Fixes #268621.
(Florian Krohm, britzel@acm.org)

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

14 years agoEmit Ain_Imm64 (64-bit immediate constant loads to register) using a
Julian Seward [Tue, 22 Mar 2011 16:51:38 +0000 (16:51 +0000)] 
Emit Ain_Imm64 (64-bit immediate constant loads to register) using a
short form when the immediate is < 2^20.  Gives a 3% code size
reduction for Helgrind with --ignore-stack-refs=yes.

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

14 years agoAdd missing VG_REGPARM definition for ppc32-linux following r2108.
Julian Seward [Tue, 15 Mar 2011 12:41:30 +0000 (12:41 +0000)] 
Add missing VG_REGPARM definition for ppc32-linux following r2108.
Also add spacing to make this a bit more readable.

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

14 years agoFix some signed-vs-unsigned char warnings in s390 code. (Christian
Julian Seward [Tue, 15 Mar 2011 12:36:44 +0000 (12:36 +0000)] 
Fix some signed-vs-unsigned char warnings in s390 code.  (Christian
Borntraeger <borntraeger@de.ibm.com>)

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

14 years agoDon't apply function attributes to a functional parameter when
Julian Seward [Tue, 15 Mar 2011 08:05:12 +0000 (08:05 +0000)] 
Don't apply function attributes to a functional parameter when
being compiled by g++ 3.x, as that can't them.  Fixes #265762.

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

14 years agoWrap up "__attribute__((regparm(n)))" inside a macro so it is only
Julian Seward [Mon, 14 Mar 2011 12:35:18 +0000 (12:35 +0000)] 
Wrap up "__attribute__((regparm(n)))" inside a macro so it is only
visible on x86, so as to avoid producing compiler warnings on targets
for which it is ignored.  Fixes #247223.  (Modified version of patch
from Bart Van Assche).

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

14 years agoFix standalone vex builds following s390x merge.
Julian Seward [Mon, 14 Mar 2011 11:27:26 +0000 (11:27 +0000)] 
Fix standalone vex builds following s390x merge.

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

14 years agoAdd folding rules for Clz32 and Clz64. See bug 243404 comment 52.
Julian Seward [Mon, 7 Mar 2011 18:34:34 +0000 (18:34 +0000)] 
Add folding rules for Clz32 and Clz64.  See bug 243404 comment 52.
(Florian Krohn, britzel@acm.org).

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

14 years agoAdd a port to IBM z/Architecture (s390x) running Linux -- VEX
Julian Seward [Mon, 7 Mar 2011 16:04:07 +0000 (16:04 +0000)] 
Add a port to IBM z/Architecture (s390x) running Linux -- VEX
side components. (Florian Krohm <britzel@acm.org> and Christian
Borntraeger <borntraeger@de.ibm.com>).  Fixes #243404.

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

14 years agoHandle Ico_V128(0xFFFF), created by more aggressive constant folding
Julian Seward [Thu, 10 Feb 2011 12:20:02 +0000 (12:20 +0000)] 
Handle Ico_V128(0xFFFF), created by more aggressive constant folding
in ir_opt.c.  Fixes #262985 (a regression from 3.5.0).
(Maynard Johnson, maynardj@us.ibm.com)

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

14 years agoHandle moves from TPIDRURO to integer registers in Thumb mode.
Julian Seward [Wed, 9 Feb 2011 14:21:45 +0000 (14:21 +0000)] 
Handle moves from TPIDRURO to integer registers in Thumb mode.
Fixes #263877.  (Jani Monoses, jani@ubuntu.com)

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

14 years agoGet rid of unintended complex integral constant, that causes build
Julian Seward [Wed, 2 Feb 2011 13:35:01 +0000 (13:35 +0000)] 
Get rid of unintended complex integral constant, that causes build
failure with icc-12.x and dodgyness (works-by-accident) with gcc.

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

14 years agoImplement LOOPNEL (32-bit version of LOOPNE). Fixes #256669.
Julian Seward [Fri, 21 Jan 2011 20:56:16 +0000 (20:56 +0000)] 
Implement LOOPNEL (32-bit version of LOOPNE).  Fixes #256669.
(Jakub Jelinek <jakub@redhat.com>)

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

14 years agoImplement rex.W/FXSAVE and also both variants of FXRSTOR.
Julian Seward [Fri, 21 Jan 2011 18:05:19 +0000 (18:05 +0000)] 
Implement rex.W/FXSAVE and also both variants of FXRSTOR.
Ick.  I knew there was a reason I'd been putting this off.
Fixes #194402.

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

14 years agoAdd alignment checking for FXSAVE/FXRSTOR.
Julian Seward [Fri, 21 Jan 2011 18:02:54 +0000 (18:02 +0000)] 
Add alignment checking for FXSAVE/FXRSTOR.

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

14 years agoAdd support for SSE4.2 CRC32{B,W,L,Q}. Fixes #261966.
Julian Seward [Fri, 21 Jan 2011 17:51:44 +0000 (17:51 +0000)] 
Add support for SSE4.2 CRC32{B,W,L,Q}.  Fixes #261966.

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

14 years agoAccept redundant REX.W for EXTRACTPS. See #258870 comment 5.
Julian Seward [Wed, 19 Jan 2011 12:21:51 +0000 (12:21 +0000)] 
Accept redundant REX.W for EXTRACTPS.  See #258870 comment 5.

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

14 years agoHandle PCMPxSTRx $0x00. Fixes #262995.
Julian Seward [Mon, 17 Jan 2011 23:06:16 +0000 (23:06 +0000)] 
Handle PCMPxSTRx $0x00.  Fixes #262995.

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

14 years agoTolerate redundant REX.W in POPQ m64. (#256669).
Julian Seward [Mon, 17 Jan 2011 13:11:37 +0000 (13:11 +0000)] 
Tolerate redundant REX.W in POPQ m64.  (#256669).

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

14 years agoAdd support for AAD and AAM (base 10 only). Fixes #256387.
Julian Seward [Mon, 17 Jan 2011 12:32:25 +0000 (12:32 +0000)] 
Add support for AAD and AAM (base 10 only).  Fixes #256387.
(Vince Weaver, vince@csl.cornell.edu)

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

14 years agoPrint 8 insn bytes when failing, not 6.
Julian Seward [Mon, 17 Jan 2011 11:58:47 +0000 (11:58 +0000)] 
Print 8 insn bytes when failing, not 6.

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

14 years agoImplement SSE4.x EXTRACTPS. Fixes #258870.
Julian Seward [Mon, 17 Jan 2011 10:32:18 +0000 (10:32 +0000)] 
Implement SSE4.x EXTRACTPS.  Fixes #258870.
Implement SSE4.x BLENDVPD, BLENDVPS, PBLENDVB.  Fixes #256968 + dup #263376.

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

14 years agoImplement SSE4.1 PBLENDW. Fixes #257011 (comment 1, at least).
Julian Seward [Tue, 11 Jan 2011 19:55:39 +0000 (19:55 +0000)] 
Implement SSE4.1 PBLENDW.  Fixes #257011 (comment 1, at least).

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

14 years agoHandle non-immediate-rounding-mode versions of ROUND{P,S}{S,D}.
Julian Seward [Tue, 11 Jan 2011 18:22:53 +0000 (18:22 +0000)] 
Handle non-immediate-rounding-mode versions of ROUND{P,S}{S,D}.
Fixes #255418.

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

14 years agoFix bug in ppc64g_dirtyhelper_LVS (well, elsewhere, really) causing
Julian Seward [Mon, 10 Jan 2011 17:44:30 +0000 (17:44 +0000)] 
Fix bug in ppc64g_dirtyhelper_LVS (well, elsewhere, really) causing
incorrect Altivec lvsl/lvsr handling on ppc64. (bug 250038)

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

14 years agoImplement ROUNDPD and ROUNDPS (imm rounding mode only).
Julian Seward [Mon, 10 Jan 2011 15:16:38 +0000 (15:16 +0000)] 
Implement ROUNDPD and ROUNDPS (imm rounding mode only).
Fixes #257063 (roundps) and #255963 (roundpd).

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

14 years agoSave an instruction on the normal idiom generated for smc-checks.
Julian Seward [Mon, 10 Jan 2011 15:10:48 +0000 (15:10 +0000)] 
Save an instruction on the normal idiom generated for smc-checks.

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

14 years agoImprove performance of smc-checks substantially, by:
Julian Seward [Mon, 10 Jan 2011 15:08:41 +0000 (15:08 +0000)] 
Improve performance of smc-checks substantially, by:

(1) allowing translations to chase across BB boundaries, as in the
    non-smc-check case

(2) on 64-bit targets, do the checksumming with 64-bit loads
    instead of 32-bit ones.

(vex-side change)

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

15 years agoAdd support for SMSAD{X}, SMLSD{X}, USAD{A}8.
Julian Seward [Mon, 18 Oct 2010 16:29:40 +0000 (16:29 +0000)] 
Add support for SMSAD{X}, SMLSD{X}, USAD{A}8.

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

15 years agoUpdate copyright notices.
Julian Seward [Tue, 12 Oct 2010 10:10:46 +0000 (10:10 +0000)] 
Update copyright notices.

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

15 years agoHandle NOP.W (Thumb) and NOP (ARM). Partial fix for #253636.
Julian Seward [Mon, 11 Oct 2010 18:57:10 +0000 (18:57 +0000)] 
Handle NOP.W (Thumb) and NOP (ARM).  Partial fix for #253636.
Add a comment re conditionalisation of Thumb memory barrier insns.

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

15 years agoFix bogus register constraints for ARM mode LDREX and STREX.
Julian Seward [Mon, 11 Oct 2010 18:03:13 +0000 (18:03 +0000)] 
Fix bogus register constraints for ARM mode LDREX and STREX.
Derived from a patch by Rodrigo Belem <rodrigo.belem@openbossa.org>
Partially fixes #253636.

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

15 years agoNEON front end: fix bugs in VMIN, VZIP, VRSHL.
Julian Seward [Wed, 6 Oct 2010 20:47:22 +0000 (20:47 +0000)] 
NEON front end: fix bugs in VMIN, VZIP, VRSHL.
(Dmitry Zhurikhin, zhur@ispras.ru), no bug number.

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

15 years agoFix some enum type confusion in host_arm_defs.[ch].
Julian Seward [Wed, 6 Oct 2010 20:34:53 +0000 (20:34 +0000)] 
Fix some enum type confusion in host_arm_defs.[ch].
(Dmitry Zhurikhin, zhur@ispras.ru), no bug number.

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

15 years agoThumb instructions: instead of generating tons of lardy boilerplate IR
Julian Seward [Tue, 5 Oct 2010 22:29:49 +0000 (22:29 +0000)] 
Thumb instructions: instead of generating tons of lardy boilerplate IR
to compute the guarding condition for instructions, and then leaning
heavily on ir_opt to almost always fold it out, avoid generating it in
the first place if it's not necessary, as per the ITxxx optimisation
analysis.  This reduces startup time of Thumb applications by 0%-30%
by reducing the amount of time the JIT has to spend translating.  No
effect on ARM instructions since those don't require a complex IR
preamble to establish the gating condition.

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

15 years agoGive all the ARM code generation enums non-overlapping value ranges, so
Julian Seward [Mon, 4 Oct 2010 09:34:46 +0000 (09:34 +0000)] 
Give all the ARM code generation enums non-overlapping value ranges, so
as to get better diagnostic information about type errors from gcc-4.5.

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

15 years agoImprove constant folding of expressions of the form 'op(t,t)'
Julian Seward [Fri, 1 Oct 2010 14:06:22 +0000 (14:06 +0000)] 
Improve constant folding of expressions of the form 'op(t,t)'
where t is an IRTemp.  This superficially fixes #213865, although
it doesn't actually fix all the Intel-prescribed dependency-breaking
cases tterrib listed there.  The newly-handled cases here are:

OrV128(t,t) ==> t
Sub64(t,t) ==> 0
CmpEQ64(t,t), CmpEQ8x8(t,t), CmpEQ8x16(t,t)  ==> all-1s

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

15 years agoAdd alignment checks to MOVDQA and a bunch of other SSE insns which
Julian Seward [Thu, 30 Sep 2010 14:51:51 +0000 (14:51 +0000)] 
Add alignment checks to MOVDQA and a bunch of other SSE insns which
require them but for which they were missing.  Fixes #153699.

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

15 years agoHandle the undocumented but apparently-actually-used instruction
Julian Seward [Thu, 30 Sep 2010 13:37:31 +0000 (13:37 +0000)] 
Handle the undocumented but apparently-actually-used instruction
MOVSWW [tentative fix].  Fixes #250799.

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

15 years agoamd64 CPUID: don't claim that the guest supports AES insns,
Julian Seward [Thu, 30 Sep 2010 10:51:56 +0000 (10:51 +0000)] 
amd64 CPUID: don't claim that the guest supports AES insns,
since it doesn't.  Fixes #249991.

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

15 years agoComment-only change.
Julian Seward [Wed, 29 Sep 2010 21:39:48 +0000 (21:39 +0000)] 
Comment-only change.

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

15 years agoIncrease the size of the JIT's scratch working area from 4MB to 5MB.
Julian Seward [Wed, 29 Sep 2010 21:39:12 +0000 (21:39 +0000)] 
Increase the size of the JIT's scratch working area from 4MB to 5MB.
This is needed to handle long blocks of NEON code with Memcheck
--track-origins=yes.

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

15 years agoOn ARM, request precise exceptions for R7. This is needed to
Julian Seward [Wed, 29 Sep 2010 21:36:56 +0000 (21:36 +0000)] 
On ARM, request precise exceptions for R7.  This is needed to
get sane stack traces in Thumb code.

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

15 years agoSupport PCLMULDQ (Emmanuel Thomé, Emmanuel.Thome@gmail.com).
Julian Seward [Tue, 28 Sep 2010 19:56:32 +0000 (19:56 +0000)] 
Support PCLMULDQ (Emmanuel Thomé, Emmanuel.Thome@gmail.com).
Fixes #251251.

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

15 years agoTrack (but ignore) the state of %RFLAGS.ACFLAG, since that is
Julian Seward [Tue, 28 Sep 2010 15:59:04 +0000 (15:59 +0000)] 
Track (but ignore) the state of %RFLAGS.ACFLAG, since that is
necessary for proper CPUID checking.  (pepp, pelloux+kde@gmail.com)
Fixes #249943.

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

15 years agoHandle Ity_I128 in sizeofIRType. (Florian Krohm, britzel@acm.org).
Julian Seward [Tue, 28 Sep 2010 15:20:47 +0000 (15:20 +0000)] 
Handle Ity_I128 in sizeofIRType.  (Florian Krohm, britzel@acm.org).
Fixes #247875.

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

15 years agoSupport CMPXCHG reg, reg on amd64. (Vince Weaver, vince@csl.cornell.edu).
Julian Seward [Tue, 28 Sep 2010 14:57:03 +0000 (14:57 +0000)] 
Support CMPXCHG reg, reg on amd64.  (Vince Weaver, vince@csl.cornell.edu).
Fixes #246311.

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

15 years agoHandle ADC Iv, eAX and SBB Iv, eAX (Jakub Jelinek, jakub@redhat.com)
Julian Seward [Tue, 28 Sep 2010 14:38:39 +0000 (14:38 +0000)] 
Handle ADC Iv, eAX and SBB Iv, eAX (Jakub Jelinek, jakub@redhat.com)
Fixes #211410.

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

15 years agoSupport REV and REV16 in Thumb mode, both short and long encodings.
Julian Seward [Sun, 26 Sep 2010 00:48:41 +0000 (00:48 +0000)] 
Support REV and REV16 in Thumb mode, both short and long encodings.

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

15 years agoImplement (Thumb) ORN (immediate) and ORN (register). Fixes #252326.
Julian Seward [Sat, 25 Sep 2010 22:06:12 +0000 (22:06 +0000)] 
Implement (Thumb) ORN (immediate) and ORN (register).  Fixes #252326.

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

15 years agoImplement v7 barrier insns (DMB, DSB, ISB) in Thumb mode
Julian Seward [Fri, 24 Sep 2010 23:48:29 +0000 (23:48 +0000)] 
Implement v7 barrier insns (DMB, DSB, ISB) in Thumb mode
(Peter Maydell, peter.maydell@linaro.org).  Fixes #252253.

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

15 years agoImplement LDREX and STREX in Thumb mode. Fixes #252258.
Julian Seward [Fri, 24 Sep 2010 23:35:59 +0000 (23:35 +0000)] 
Implement LDREX and STREX in Thumb mode.  Fixes #252258.

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

15 years agoImplement RBIT in ARM mode.
Julian Seward [Fri, 24 Sep 2010 21:59:55 +0000 (21:59 +0000)] 
Implement RBIT in ARM mode.

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