]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
11 years agoFix an enum type confusion, PPCAvFpOp vs PPCAvOp, as excellently
Julian Seward [Fri, 20 Jun 2014 14:27:27 +0000 (14:27 +0000)] 
Fix an enum type confusion, PPCAvFpOp vs PPCAvOp, as excellently
detected by Clang.  Gcc, are you paying attention?

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

11 years agoIncrease the number of vector registers available for allocation from
Julian Seward [Fri, 20 Jun 2014 08:30:21 +0000 (08:30 +0000)] 
Increase the number of vector registers available for allocation from
3 to 5.

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

11 years agoImplement: dup_{d_d[], s_s[], h_h[], b_b[]}, ext
Julian Seward [Thu, 19 Jun 2014 22:20:47 +0000 (22:20 +0000)] 
Implement: dup_{d_d[], s_s[], h_h[], b_b[]}, ext

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

11 years agoImplement: orr_{8h,4h}_imm8_shifted, orr_{4s,2s}_imm8_shifted,
Julian Seward [Thu, 19 Jun 2014 14:21:37 +0000 (14:21 +0000)] 
Implement: orr_{8h,4h}_imm8_shifted, orr_{4s,2s}_imm8_shifted,
bic_{8h,4h}_imm8_shifted, bic_{4s,2s}_imm8_shifted, cls_std6_std6,
cm{eq,ge,gt,hi,hs,tst}_d_d_d, cm{ge,gt,le,lt}_d_d_zero,
cnt_{16,8}b_{16,8}b

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

11 years agoarm64: implement: addp std7_std7_std7, addv vector, addp d_2d
Julian Seward [Sun, 15 Jun 2014 21:55:33 +0000 (21:55 +0000)] 
arm64: implement: addp std7_std7_std7, addv vector, addp d_2d

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

11 years agoarm64: implement: abs d_d, neg d_d, abs std7_std7, addhn, subhn, raddhn, rsubhn
Julian Seward [Sun, 15 Jun 2014 19:36:29 +0000 (19:36 +0000)] 
arm64: implement: abs d_d, neg d_d, abs std7_std7, addhn, subhn, raddhn, rsubhn

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

11 years agoRemove temporary front end scaffolding for Cat{Even,Odd}Lanes
Julian Seward [Sun, 15 Jun 2014 08:17:35 +0000 (08:17 +0000)] 
Remove temporary front end scaffolding for Cat{Even,Odd}Lanes
and Interleave{LO,HI} operations, and instead generate real
UZP1/UZP2/ZIP1/ZIP2 instructions in the back end.

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

11 years agoImplement LD1R (single structure, replicate).
Julian Seward [Sat, 14 Jun 2014 18:05:30 +0000 (18:05 +0000)] 
Implement LD1R (single structure, replicate).

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

11 years agoImplement FMUL 2d_2d_d[], 4s_4s_s[], 2s_2s_s[].
Julian Seward [Thu, 12 Jun 2014 13:16:01 +0000 (13:16 +0000)] 
Implement FMUL 2d_2d_d[], 4s_4s_s[], 2s_2s_s[].

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

11 years agoRemove the old SIMD decoder entirely.
Julian Seward [Thu, 12 Jun 2014 10:15:46 +0000 (10:15 +0000)] 
Remove the old SIMD decoder entirely.

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

11 years agoMove remaining implemented SIMD instructions into the new SIMD/FP
Julian Seward [Wed, 11 Jun 2014 20:57:23 +0000 (20:57 +0000)] 
Move remaining implemented SIMD instructions into the new SIMD/FP
decoding framework.

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

11 years agoReimplement the SIMD and FP instruction decoder, so as to avoid huge
Julian Seward [Tue, 10 Jun 2014 22:52:05 +0000 (22:52 +0000)] 
Reimplement the SIMD and FP instruction decoder, so as to avoid huge
amounts of duplicated decode, and to follow the documentation more
closely.

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

11 years agomips: Fix non mips compiler warning.
Dejan Jevtic [Mon, 9 Jun 2014 10:54:49 +0000 (10:54 +0000)] 
mips: Fix non mips compiler warning.

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

11 years agoSupport ADC/ADCS/SBC/SBCS. Fixes #335496. (dimitry@google.com)
Julian Seward [Wed, 4 Jun 2014 13:09:44 +0000 (13:09 +0000)] 
Support ADC/ADCS/SBC/SBCS.  Fixes #335496.  (dimitry@google.com)

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

11 years agoSupport the "ishst" variant of "dmb". Fixes #335263. (dimitry@google.com)
Julian Seward [Wed, 4 Jun 2014 11:44:45 +0000 (11:44 +0000)] 
Support the "ishst" variant of "dmb".  Fixes #335263.  (dimitry@google.com)

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

11 years agoSupport movi_{16b,8b}_#imm8. Fixes #335262. (dimitry@google.com)
Julian Seward [Wed, 4 Jun 2014 11:36:54 +0000 (11:36 +0000)] 
Support movi_{16b,8b}_#imm8.  Fixes #335262.  (dimitry@google.com)

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

11 years agomips64: Support for Cavium MIPS Octeon Atomic and Count Instructions.
Dejan Jevtic [Wed, 4 Jun 2014 11:28:07 +0000 (11:28 +0000)] 
mips64: Support for Cavium MIPS Octeon Atomic and Count Instructions.

Implement Cavium MIPS specific instructions:
baddu, pop, dpop, saa, saad, laa, laad, lai, laid, lad, ladd, law, lawd,
las, lasd, lac, lacd

Fixes BZ #327223.

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

11 years agoImplement PCMPxSTRx cases 0x0E, 0x34, 0x14, and reformat some of the
Julian Seward [Wed, 21 May 2014 14:42:04 +0000 (14:42 +0000)] 
Implement PCMPxSTRx cases 0x0E, 0x34, 0x14, and reformat some of the
associated switch statements.  Fixes #326469, #327639, #328878
respectively.

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

11 years agoImplement SHL_d_d_#imm.
Julian Seward [Fri, 16 May 2014 11:20:07 +0000 (11:20 +0000)] 
Implement SHL_d_d_#imm.

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

11 years agoInitial front-end fixings needed to handle code generated by gcc-4.9
Julian Seward [Thu, 15 May 2014 16:49:21 +0000 (16:49 +0000)] 
Initial front-end fixings needed to handle code generated by gcc-4.9
on arm64-linux.

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

11 years agoImplement VFPv4 VFMA and VFMS (F32 and F64 versions). Fixes #331057.
Julian Seward [Wed, 14 May 2014 23:38:23 +0000 (23:38 +0000)] 
Implement VFPv4 VFMA and VFMS (F32 and F64 versions).  Fixes #331057.
Patch from Janne Hellsten (jjhellst@gmail.com) with algebraic
rearrangement for the VFMS cases so as to make result signs match with
the hardware when some of the inputs are infinities.

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

11 years agoThumb encoding: fix assertion failure caused by
Julian Seward [Tue, 13 May 2014 15:54:14 +0000 (15:54 +0000)] 
Thumb encoding: fix assertion failure caused by
"ldr.w pc, [reg, #imm]".  Fixes #333428.  (dimitry@google.com)

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

11 years agoThumb encoding: correctly deal with misaligned loads of the form
Julian Seward [Tue, 13 May 2014 14:44:21 +0000 (14:44 +0000)] 
Thumb encoding: correctly deal with misaligned loads of the form
   LD Rt, [Rn +/- #imm12]  when Rn == PC
Fixes #333145.  (dimitry@google.com)

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

11 years agoRecognize MPX instructions and bnd prefix. Bug #333666.
Mark Wielaard [Fri, 9 May 2014 11:41:06 +0000 (11:41 +0000)] 
Recognize MPX instructions and bnd prefix. Bug #333666.

Recognize and parse operands of new MPX instructions BNDMK, BNDCL,
BNDCU, BNDCN, BNDMOV, BNDLDX and BNDSTX. Also recognize bnd (F2) prefix
for CALL (E8,FF/2), RET (C2,C3), JMP (EB,E9,FF/4) and Jcc (70-7F,0F 80-8F).
All new MPX instructions are currently NOPs and the bnd prefix is ignored.

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

11 years agoHandle "blr lr" correctly -- read the destination register
Julian Seward [Wed, 7 May 2014 11:09:28 +0000 (11:09 +0000)] 
Handle "blr lr" correctly -- read the destination register
_before_ writing the return address in LR.

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

11 years agoEnable 'smulh'.
Julian Seward [Wed, 7 May 2014 09:41:40 +0000 (09:41 +0000)] 
Enable 'smulh'.

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

11 years agoHandle IRStmt::STle of type F32.
Julian Seward [Wed, 7 May 2014 09:20:59 +0000 (09:20 +0000)] 
Handle IRStmt::STle of type F32.

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

11 years agoAllow early-writeback for the cases
Julian Seward [Wed, 7 May 2014 09:20:11 +0000 (09:20 +0000)] 
Allow early-writeback for the cases
   stp d, d, [sp,#-imm]!
   stp s, s, [sp,#-imm]!
as well as for the existing case
   stp q, q, [sp,#-imm]!

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

11 years agoFix assertion failures resulting from change of arity of
Julian Seward [Mon, 5 May 2014 10:03:56 +0000 (10:03 +0000)] 
Fix assertion failures resulting from change of arity of
Iop_{Add,Sub,Mul}32Fx4 introduced in r2809, in which said IROps
acquired a rounding-mode argument.

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

11 years agoRenaming only (no functional change): rename IR artefacts to do
Julian Seward [Sun, 4 May 2014 10:52:11 +0000 (10:52 +0000)] 
Renaming only (no functional change): rename IR artefacts to do
with i-cache invalidation to be more consistent with new d-cache
invalidation functionality:
  Ijk_TInval          -> Ijk_InvalICache
  TISTART             -> CMSTART (CM == "Cache Management")
  TILEN               -> CMLEN
  VEX_TRC_JMP_TINVAL  -> VEX_TRC_JMP_INVALICACHE

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

11 years agoARM64: add support for cache management instructions (VEX side):
Julian Seward [Sat, 3 May 2014 21:20:56 +0000 (21:20 +0000)] 
ARM64: add support for cache management instructions (VEX side):
  dc cvau, regX
  ic ivau, regX
  mrs regX, ctr_el0
Fixes #333228 and #333230.

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

11 years agox87 instructions FSIN, FCOS, FSINCOS and FPTAN: handle out-of-range
Julian Seward [Wed, 30 Apr 2014 22:50:34 +0000 (22:50 +0000)] 
x87 instructions FSIN, FCOS, FSINCOS and FPTAN: handle out-of-range
arguments correctly.  Mozilla bug 995564.

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

11 years agoFinish off vector integer comparison instructions, and
Julian Seward [Sun, 27 Apr 2014 12:02:12 +0000 (12:02 +0000)] 
Finish off vector integer comparison instructions, and
vector shift-by-immediates (Shr/Shl/Sar) instructions.

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

11 years agoHandle Iop_Max32U, so as to make origin tracking in Memcheck work.
Julian Seward [Tue, 8 Apr 2014 15:24:15 +0000 (15:24 +0000)] 
Handle Iop_Max32U, so as to make origin tracking in Memcheck work.

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

11 years ago{FMOV,MOVI} (vector, immediate): fix incorrect DIP format string
Julian Seward [Tue, 8 Apr 2014 15:23:42 +0000 (15:23 +0000)] 
{FMOV,MOVI} (vector, immediate): fix incorrect DIP format string

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

11 years agoImplement
Julian Seward [Thu, 3 Apr 2014 23:03:32 +0000 (23:03 +0000)] 
Implement
LD2/ST2 (multiple structures, post index) (some cases)
LD1/ST1 (multiple structures, no offset)  (some cases)

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

11 years agoImplement TBL and TBX instructions.
Julian Seward [Thu, 3 Apr 2014 13:48:54 +0000 (13:48 +0000)] 
Implement TBL and TBX instructions.

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

11 years agoAdd a couple more constant folding rules for vectors.
Julian Seward [Thu, 3 Apr 2014 13:48:21 +0000 (13:48 +0000)] 
Add a couple more constant folding rules for vectors.

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

11 years agoBug 332658 - ldrd.w r1, r2, [PC, #imm] does not adjust for 32bit alignment
Julian Seward [Tue, 1 Apr 2014 11:00:36 +0000 (11:00 +0000)] 
Bug 332658 - ldrd.w r1, r2, [PC, #imm] does not adjust for 32bit alignment
(dimitry@google.com)

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

11 years agoImplement FCM{EQ,GE,GT}, FAC{GE,GT} (vector).
Julian Seward [Thu, 27 Mar 2014 18:59:00 +0000 (18:59 +0000)] 
Implement FCM{EQ,GE,GT}, FAC{GE,GT} (vector).

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

11 years agomips32: Avoid compiler warnings.
Dejan Jevtic [Wed, 19 Mar 2014 11:10:51 +0000 (11:10 +0000)] 
mips32: Avoid compiler warnings.

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

11 years agoUn-break the arm32 compilation pipeline following the change of
Julian Seward [Sat, 15 Mar 2014 11:41:39 +0000 (11:41 +0000)] 
Un-break the arm32 compilation pipeline following the change of
arity of Iop_Mul32Fx4, Iop_Sub32Fx4, Iop_Add32Fx4 in r2809.

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

11 years agoLDRD/STRD reg+/-#imm8: allow PC as the base register in the
Julian Seward [Sat, 15 Mar 2014 08:33:06 +0000 (08:33 +0000)] 
LDRD/STRD reg+/-#imm8: allow PC as the base register in the
case "ldrd Rt, Rt2, [PC, #+/-imm8]".  n-i-bz.

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

11 years agoCorrectly handle add(hi) when the destination register is the PC.
Julian Seward [Sat, 15 Mar 2014 08:14:06 +0000 (08:14 +0000)] 
Correctly handle add(hi) when the destination register is the PC.
Fixes #332037.

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

11 years agoBack-end handling of Iop_CmpNEZ32x4, Iop_CmpNEZ16x8, Iop_CmpNEZ8x16,
Julian Seward [Mon, 10 Mar 2014 10:40:48 +0000 (10:40 +0000)] 
Back-end handling of Iop_CmpNEZ32x4, Iop_CmpNEZ16x8, Iop_CmpNEZ8x16,
needed for Memchecking of SIMD arm64 code.

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

11 years agoImplement a couple of backend artefacts needed by Memcheck on large
Julian Seward [Sun, 9 Mar 2014 09:41:56 +0000 (09:41 +0000)] 
Implement a couple of backend artefacts needed by Memcheck on large
applications:
  Iop_CmpNEZ64x2 expressions
  Ijk_NoRedir block terminators

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

11 years agoDo early writeback of the base register for the following instruction
Julian Seward [Sun, 9 Mar 2014 09:40:23 +0000 (09:40 +0000)] 
Do early writeback of the base register for the following instruction
forms, to stop Memcheck complaining about writes below the stack
pointer:
  str x3, [sp,#-16]!
  stp q0, q1, [sp,#-512]!

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

11 years ago* iselIntExpr_AMode_wrk: generate correct code for the case
Julian Seward [Sat, 8 Mar 2014 13:08:17 +0000 (13:08 +0000)] 
* iselIntExpr_AMode_wrk: generate correct code for the case
  "Sub64(expr,simm9)."

* handle 1Uto64(arbitrary-expression)

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

11 years agoSupport extra instruction bits and pieces, enough to get Firefox started:
Julian Seward [Fri, 7 Mar 2014 22:52:19 +0000 (22:52 +0000)] 
Support extra instruction bits and pieces, enough to get Firefox started:
* more scalar int <-> FP conversions
* more vector integer narrowing
* a few more vector shift by imm cases
* FCVTAS (kludged)

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

11 years agomips32: Fix the problem with reading the guest_FCSR register from the wrong guest...
Dejan Jevtic [Mon, 3 Mar 2014 14:13:37 +0000 (14:13 +0000)] 
mips32: Fix the problem with reading the guest_FCSR register from the wrong guest state.

When Valgrind isn't executed in mode64, register fcsr need to read from the VexGuestMIPS32State.

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

11 years agoFix error in 64-bit and smaller load versions of
Julian Seward [Mon, 3 Mar 2014 08:42:16 +0000 (08:42 +0000)] 
Fix error in 64-bit and smaller load versions of
LDR/STR (immediate, SIMD&FP, unsigned offset)

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

11 years agoImplement REV16, REV32, FCVTN, SHL (vector, immediate), NEG (vector)
Julian Seward [Sun, 2 Mar 2014 12:47:18 +0000 (12:47 +0000)] 
Implement REV16, REV32, FCVTN, SHL (vector, immediate), NEG (vector)

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

11 years agoRemove redundant FMOV (vector, immediate) case.
Julian Seward [Sat, 1 Mar 2014 11:19:45 +0000 (11:19 +0000)] 
Remove redundant FMOV (vector, immediate) case.
Minor comment fixes.
Fix bugs in {U,S}{MIN,MAX}V, {U,S}{MIN,MAX}, {S,U}SSHL

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

11 years agoSelect and emit insns for
Julian Seward [Sat, 1 Mar 2014 11:16:57 +0000 (11:16 +0000)] 
Select and emit insns for
Iop_ZeroHI64ofV128 Iop_Max8Sx16 Iop_Min8Sx16

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

11 years agomips32: Fpu guest registers are ULong and the initial values need to be
Dejan Jevtic [Thu, 27 Feb 2014 14:17:19 +0000 (14:17 +0000)] 
mips32: Fpu guest registers are ULong and the initial values need to be
extended.

Because we are supporting both big and little endian mips32 we need to
make sure that the initial values for the fpu registers are the same for both
endian.

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

11 years agoImplement a few more integer instructions:
Julian Seward [Thu, 27 Feb 2014 11:10:19 +0000 (11:10 +0000)] 
Implement a few more integer instructions:
NOP
LDA{R,RH,RB}
STL{R,RH,RB}
RBIT

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

11 years agomips32: Fix the problem with the floating point compare instruction on mips32.
Dejan Jevtic [Tue, 25 Feb 2014 15:25:49 +0000 (15:25 +0000)] 
mips32: Fix the problem with the floating point compare instruction on mips32.

This patch is fixing the problem with emitting Iop_CmpF64.
Problem was introduced while running Valgrind for mips with v8 javascript engine.

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

11 years ago* add a kludgey fix for "mrs rT, dczid_el0"
Julian Seward [Fri, 21 Feb 2014 14:49:44 +0000 (14:49 +0000)] 
* add a kludgey fix for "mrs rT, dczid_el0"
* make ISB and DSB really generate memory barriers

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

11 years agoFirst pass at implementation of load/store exclusive and
Julian Seward [Thu, 20 Feb 2014 17:43:38 +0000 (17:43 +0000)] 
First pass at implementation of load/store exclusive and
load/store exclusive w/ read-acquire/store-release:
LD{,A}X{R,RH,RB}
ST{,L}X{R,RH,RB}

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

11 years agoImplement unchainXDirect_ARM64.
Julian Seward [Wed, 19 Feb 2014 17:42:59 +0000 (17:42 +0000)] 
Implement unchainXDirect_ARM64.

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

11 years agomips32: VEX Support for 64bit FPU on MIPS32 platforms.
Dejan Jevtic [Wed, 19 Feb 2014 11:56:29 +0000 (11:56 +0000)] 
mips32: VEX Support for 64bit FPU on MIPS32 platforms.

This patch is adding support for mips32 with 64bit FPU.
Assume that floating-point registers are 64 bits wide.

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

11 years agoImplement more aarch64 vector insns:
Julian Seward [Mon, 17 Feb 2014 11:00:53 +0000 (11:00 +0000)] 
Implement more aarch64 vector insns:
CM{EQ,HI,HS,GE,GT,TST,LE,LT} (vector)
{EOR,BSL,BIT,BIF} (vector)
{USHR,SSHR} (vector, immediate)
{U,S}SHLL{,2}
INS (general)
FABD Vd,Vn,Vm

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

11 years agomips64: add support for load indexed instructions from DSP ASE
Petar Jovanovic [Fri, 14 Feb 2014 17:28:15 +0000 (17:28 +0000)] 
mips64: add support for load indexed instructions from DSP ASE

Handling lwx, ldx and lbux for MIPS-Cavium processors.

Patch by Zahid Anwar, with some changes.

Related to Bugzilla issue 326444.

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

11 years agoFix comments and code snippets that were making incorrect claims about
Florian Krohm [Fri, 14 Feb 2014 08:55:32 +0000 (08:55 +0000)] 
Fix comments and code snippets that were making incorrect claims about
the alignment requirement of the guest state, shadow areas, and register
spill area sizes.
The size of these areas ought to be a multiple of 16 bytes.

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

11 years agos390: Fix s390_amode_for_guest_state. In general the offset relative
Florian Krohm [Tue, 11 Feb 2014 09:23:01 +0000 (09:23 +0000)] 
s390: Fix s390_amode_for_guest_state. In general the offset relative
to the guest state pointer may be more than the B12 addressing mode can
handle. Fall back and use a B20 addressing mode in those cases.

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

11 years agoFix the ppc32 special-instruction magic sequence so it really does
Julian Seward [Mon, 10 Feb 2014 12:27:29 +0000 (12:27 +0000)] 
Fix the ppc32 special-instruction magic sequence so it really does
preserve the value of r0, as claimed.  Fixes #278808 (VEX side).

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

11 years agoImplement more aarch64 vector insns:
Julian Seward [Mon, 10 Feb 2014 10:28:13 +0000 (10:28 +0000)] 
Implement more aarch64 vector insns:
{S,U}{MIN,MAX}  Vd.T, Vn.T, Vm.T (8bitx16lane variants)
{S,U}{MIN,MAX}V Vd.T, Vn.T, Vm.T (8bitx16lane variants)
FMOV (vector, immediate)
MOVI (vector, immediate)
FABS (vector)
FNEG (vector)
FMLA (vector)
FMLS (vector)
{AND,BIC,ORR,ORN} (vector)

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

11 years agoAdd support for syscall on x86
Tom Hughes [Sun, 9 Feb 2014 11:40:20 +0000 (11:40 +0000)] 
Add support for syscall on x86

Patch from Ivo Raisr via BZ#330939 also fixes BZ#308729

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

11 years agoImplement a few more vector aarch64 insns:
Julian Seward [Thu, 6 Feb 2014 12:57:58 +0000 (12:57 +0000)] 
Implement a few more vector aarch64 insns:
LD1 {vT.8h}, [xN|SP], #16
LD1 {vT.16b}, [xN|SP], #16
ST1 {vT.4h}, [xN|SP], #8
MUL  Vd.T, Vn.T, Vm.T
PMUL Vd.T, Vn.T, Vm.T  (fe only)
MLA  Vd.T, Vn.T, Vm.T
MLS  Vd.T, Vn.T, Vm.T
UMOV Xd/Wd, Vn.Ts[index]
SMOV Xd/Wd, Vn.Ts[index]

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

11 years agoImplement a few more vector aarch64 insns:
Julian Seward [Wed, 5 Feb 2014 11:01:19 +0000 (11:01 +0000)] 
Implement a few more vector aarch64 insns:
LD1 {vT.4s}, [xN|SP], #16
ADD Dd, Dn, Dm
SUB Dd, Dn, Dm
SMIN Vd.T, Vn.T, Vm.T
UMIN Vd.T, Vn.T, Vm.T
SMAX Vd.T, Vn.T, Vm.T
UMAX Vd.T, Vn.T, Vm.T
SMINV Vd.T, Vn.T, Vm.T
UMINV Vd.T, Vn.T, Vm.T
SMAXV Vd.T, Vn.T, Vm.T
UMAXV Vd.T, Vn.T, Vm.T
DUP Vd.T, Rn
FADD/FSUB/FMUL/FDIV32x4

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

11 years agomips64: Support for Cavium-specific load indexed instructions
Petar Jovanovic [Fri, 31 Jan 2014 12:14:20 +0000 (12:14 +0000)] 
mips64: Support for Cavium-specific load indexed instructions

Support for lhux, lwux, lbx for Cavium.

Patch by Zahid Anwar, with style changes.

Related to Bugzilla issue 326444.

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

11 years agoImprove front and back end support for SIMD instructions on Arm64.
Julian Seward [Sun, 26 Jan 2014 19:11:14 +0000 (19:11 +0000)] 
Improve front and back end support for SIMD instructions on Arm64.

Implement the following instructions -- some but not necessarily
all laneage combinations:

  LD1 {vT.2d},  [Xn|SP]
  ST1 {vT.2d},  [Xn|SP]
  LD1 {vT.4s},  [Xn|SP]
  ST1 {vT.4s},  [Xn|SP]
  LD1 {vT.8h},  [Xn|SP]
  ST1 {vT.8h},  [Xn|SP]
  LD1 {vT.16b}, [Xn|SP]
  ST1 {vT.16b}, [Xn|SP]
  LD1 {vT.1d}, [Xn|SP]
  ST1 {vT.1d}, [Xn|SP]
  LD1 {vT.2s}, [Xn|SP]
  ST1 {vT.2s}, [Xn|SP]
  LD1 {vT.4h}, [Xn|SP]
  ST1 {vT.4h}, [Xn|SP]
  LD1 {vT.8b}, [Xn|SP]
  ST1 {vT.8b}, [Xn|SP]
  ST1 {vT.2d}, [xN|SP], #16
  LD1 {vT.2d}, [xN|SP], #16
  ST1 {vT.4s}, [xN|SP], #16
  ST1 {vT.8h}, [xN|SP], #16
  ST1 {vT.2s}, [xN|SP], #8
  SCVTF Vd, Vn
  UCVTF Vd, Vn
  FADD Vd,Vn,Vm   1
  FSUB Vd,Vn,Vm   2
  FMUL Vd,Vn,Vm   3
  FDIV Vd,Vn,Vm   4
  FMLA Vd,Vn,Vm   5
  FMLS Vd,Vn,Vm   6
  ADD Vd.T, Vn.T, Vm.T
  SUB Vd.T, Vn.T, Vm.T
  XTN {,2}
  DUP Vd.T, Vn.Ts[index]

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

11 years agoMake the following primops take a third (initial) argument to
Julian Seward [Sun, 26 Jan 2014 18:34:23 +0000 (18:34 +0000)] 
Make the following primops take a third (initial) argument to
indicate the rounding mode to use, like their scalar cousins do:

  Iop_Add32Fx4  Iop_Sub32Fx4  Iop_Mul32Fx4  Iop_Div32Fx4
  Iop_Add64Fx2  Iop_Sub64Fx2  Iop_Mul64Fx2  Iop_Div64Fx2
  Iop_Add64Fx4  Iop_Sub64Fx4  Iop_Mul64Fx4  Iop_Div64Fx4
  Iop_Add32Fx8  Iop_Sub32Fx8  Iop_Mul32Fx8  Iop_Div32Fx8

Fix up the x86 and amd64 front ends to add fake rounding modes
(Irrm_NEAREST) when generating expressions using these primops.
Fix up the x86 and amd64 back ends to accept these as triops
rather than as binops, and ignore the first arg.

Add three more ir_opt folding rules to remove memcheck
instrumentation arising from instrumentation of known-defined
rounding modes.

Overall functional and performance effects should be zero.

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

11 years agoThis patch by adrian.sendroiu@freescale.com fixes the lrmw and stmw
Carl Love [Fri, 24 Jan 2014 16:42:26 +0000 (16:42 +0000)] 
This patch by adrian.sendroiu@freescale.com fixes the lrmw and stmw
instructions.

The patch also adds ppc32 and ppc64 test cases for the instructions.

The patch is a fix for bugzilla 329956 "valgrind crashes when lmw/stmw instructions are used on ppc64".

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

11 years agoWhitespace-only change: restrict to 80 col width.
Julian Seward [Tue, 21 Jan 2014 16:33:51 +0000 (16:33 +0000)] 
Whitespace-only change: restrict to 80 col width.

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

11 years agomips64: Change the initial value of fpu registers.
Dejan Jevtic [Wed, 15 Jan 2014 16:26:31 +0000 (16:26 +0000)] 
mips64: Change the initial value of fpu registers.

Initial value of mips fpu registers should be nan instead of 0xffffffffffffffff.

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

11 years agoarm64: rename guest_SP to guest_XSP so as to avoid a name clash with
Julian Seward [Wed, 15 Jan 2014 10:25:21 +0000 (10:25 +0000)] 
arm64: rename guest_SP to guest_XSP so as to avoid a name clash with
guest_SP from s390 world.  Also back out the rename of guest_SP to
guest_s390_SP that caused s390 build breakage in r2803.

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

11 years agoAdd missing ULLs to some 64-bit immediates.
Julian Seward [Sun, 12 Jan 2014 18:23:45 +0000 (18:23 +0000)] 
Add missing ULLs to some 64-bit immediates.

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

11 years agoAdd support for ARMv8 AArch64 (the 64 bit ARM instruction set):
Julian Seward [Sun, 12 Jan 2014 12:49:10 +0000 (12:49 +0000)] 
Add support for ARMv8 AArch64 (the 64 bit ARM instruction set):
integer and FP instructions.

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

11 years agoLibVEX_GuestAMD64_initialise(): give an initial value for
Julian Seward [Wed, 11 Dec 2013 16:47:59 +0000 (16:47 +0000)] 
LibVEX_GuestAMD64_initialise(): give an initial value for
guest_ACFLAG.  Kinda worrying that this was missing.

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

11 years agoThe result of rounding a 128-bit BFP/DFP value to 32/64 bit needs to
Florian Krohm [Tue, 10 Dec 2013 16:51:15 +0000 (16:51 +0000)] 
The result of rounding a 128-bit BFP/DFP value to 32/64 bit needs to
be stored in a register pair. This constraint was not observed previously
and the result was stored in any FPR that happened to be chosen. If the
selected FPR was not identifying a proper FPR pair, a SIGILL was delivered.
Fixes BZ #328455.

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

11 years agoBug 328100 - XABORT not implemented.
Mark Wielaard [Mon, 9 Dec 2013 12:54:06 +0000 (12:54 +0000)] 
Bug 328100 - XABORT not implemented.

XABORT can be called even when there is no current transaction.
In such a case XABORT acts as a NOP. Implement xabort as nop.

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

11 years agomips32/64: Fixed the problem with fpu instructions.
Dejan Jevtic [Thu, 14 Nov 2013 15:44:42 +0000 (15:44 +0000)] 
mips32/64: Fixed the problem with fpu instructions.

Include the value of fcsr register when emitting
some fpu instructions.
Calculate a new value of the fcsr register after
some FPU instructions.

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

11 years agoFix Bug 327284. The condition code of risbg was not correct.
Christian Borntraeger [Thu, 7 Nov 2013 21:37:28 +0000 (21:37 +0000)] 
Fix Bug 327284. The condition code of risbg was not correct.
This instruction might be used by by gcc for masking out bits,
e.g. code like
 n &= 3;
  if (n == 0)

might result in
        risbg   %r4,%r4,62,128+63,0
        je      <target>

The old code set the condition code depending on the operand before
masking. Fix it. This patch also indicates that we need test suite
coverage for risbg and friends.

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

11 years agomips32: Fix problem with some mips32 dsp instructions.
Dejan Jevtic [Wed, 23 Oct 2013 14:05:15 +0000 (14:05 +0000)] 
mips32: Fix problem with some mips32 dsp instructions.

This patch includes VEX optimizations for mips32 and
fixes for some mips32 dsp instructions.

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

11 years agomips32: Fixed the problem with FCSR register.
Dejan Jevtic [Tue, 22 Oct 2013 08:52:46 +0000 (08:52 +0000)] 
mips32: Fixed the problem with FCSR register.

Until now, Valgrind has read two registers to calculate FCSR
value. From now on, Valgrind reads exact number of fpu
registers (one or two).

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

11 years agoIn 64 bit mode, allow 64 bit return values from clean helper calls.
Julian Seward [Mon, 21 Oct 2013 10:05:33 +0000 (10:05 +0000)] 
In 64 bit mode, allow 64 bit return values from clean helper calls.
This makes SMC checking calls work (even though they are irrelevant
on PPC targets).  Fixes #309430.

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

11 years agoUpdate copyright dates (20XY-2012 ==> 20XY-2013)
Julian Seward [Fri, 18 Oct 2013 14:12:58 +0000 (14:12 +0000)] 
Update copyright dates (20XY-2012 ==> 20XY-2013)

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

11 years agoHandle PCMPxSTRx cases 0x30 and 0x40. Fixes #320998.
Julian Seward [Fri, 18 Oct 2013 10:45:21 +0000 (10:45 +0000)] 
Handle PCMPxSTRx cases 0x30 and 0x40.  Fixes #320998.

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

11 years agoThis commit adds support for the following instructions:
Carl Love [Fri, 18 Oct 2013 01:19:06 +0000 (01:19 +0000)] 
This commit adds support for the following instructions:
  vaddcuq, vadduqm, vaddecuq, vaddeuqm,
  vsubcuq, vsubuqm, vsubecuq, vsubeuqm,
  vbpermq and vgbbd.

The vgbbd instruction required a new Iop -- Iop_PwBitMtxXpose64x2.
All other instructions were emulated using existing Iops.

The completes adding the Power ISA 2.07 support.

Bugzilla 325816

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

11 years agoPower 8 support, phase 5
Carl Love [Tue, 15 Oct 2013 18:11:20 +0000 (18:11 +0000)] 
Power 8 support, phase 5

This commit adds support for the following instructions for doing
various arithmetic, bit transformation, cipher, count, logical,
and SHA operations.

  vpmsumb, vpmsumh, vpmsumw, vpmsumd, vpermxor, vcipher, vcipherlast,
  vncipher, vncipherlast, vsbox,
  vclzb, vclzw, vclzh, vclzd,
  vpopcntb, vpopcnth, vpopcntw, vpopcntd,
  vnand, vorc, veqv,
  vshasigmaw, vshasigmad,
  bcdadd, bcdsub

The following Iops were added to support the above instructions:
  Iop_BCDAdd, Iop_BCDSub,
  Iop_PolynomialMulAdd8x16, Iop_PolynomialMulAdd16x8,
  Iop_PolynomialMulAdd32x4, Iop_PolynomialMulAdd64x2,
  Iop_CipherV128, Iop_CipherLV128, Iop_CipherSV128,
  Iop_NCipherV128, Iop_NCipherLV128,
  Iop_SHA512, Iop_SHA256, Iop_Clz64x2

The patch is for Bugzilla 325628

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

11 years agoTidyup -- no functional change. Replace all "pfx & PFX_LOCK"
Julian Seward [Tue, 15 Oct 2013 17:29:19 +0000 (17:29 +0000)] 
Tidyup -- no functional change.  Replace all "pfx & PFX_LOCK"
with haveLOCK(pfx).

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

11 years agoamd64 front end: accept XACQUIRE and XRELEASE on exactly the insns that
Julian Seward [Tue, 15 Oct 2013 17:21:42 +0000 (17:21 +0000)] 
amd64 front end: accept XACQUIRE and XRELEASE on exactly the insns that
the Intel docs say can validly have them.

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

11 years agoAdd support for an alternative encoding of 'PUSH reg', viz FF /6,
Julian Seward [Mon, 14 Oct 2013 21:47:14 +0000 (21:47 +0000)] 
Add support for an alternative encoding of 'PUSH reg', viz FF /6,
that is used by MSVC generated code.  Fixes #324834.

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

11 years agoPPC32/64: Allow 16 byte icache lines.
Julian Seward [Mon, 14 Oct 2013 11:40:24 +0000 (11:40 +0000)] 
PPC32/64: Allow 16 byte icache lines.
Partial fix for #308135.  (christophe.leroy@c-s.fr)

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

11 years agoPower PC, add the two privileged Transactional Memory instructions.
Carl Love [Wed, 9 Oct 2013 17:52:01 +0000 (17:52 +0000)] 
Power PC, add the two privileged Transactional Memory instructions.

The initial Transactional Memory instruction patch did not include the two
privileged (OS) instructions.  This patch adds support for the two
instructions, treclaim and trechkpt.

The patch if for Bugzilla 325751.

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

11 years agomips64: add extra Iop cases in VEX.
Dejan Jevtic [Mon, 7 Oct 2013 10:28:56 +0000 (10:28 +0000)] 
mips64: add extra Iop cases in VEX.

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

11 years agoFix guest_amd64_toIR xbegin and xtest to match cpuid given for AVX hwcaps.
Mark Wielaard [Fri, 4 Oct 2013 22:31:48 +0000 (22:31 +0000)] 
Fix guest_amd64_toIR xbegin and xtest to match cpuid given for AVX hwcaps.

Otherwise valgrind none/tests/amd64/tm1.vgtest might fail on amd64-avx.

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

11 years ago Phase 4 support for IBM Power ISA 2.07
Carl Love [Thu, 3 Oct 2013 21:38:45 +0000 (21:38 +0000)] 
 Phase 4 support for IBM Power ISA 2.07

This patch adds support for the following instructions for doing
various arithmetic, logic, and load/store VSX operations:

  xscvsxdsp xscvuxdsp xsaddsp xssubsp xsdivsp xsmaddasp xsmaddmsp
  xsmsubasp xsmsubmsp xsnmaddasp xsnmaddmsp xsnmsubasp xsnmsubmsp
  xsmulsp xssqrtsp xsresp xsrsqrtesp xsrsp xxlorc xxlnand xxleqv
  lxsiwzx lxsiwax lxsspx stxsiwx stxsspx

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
Bugzilla 325477

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

11 years agoPower PC, Approach 1, add Transactional Memory instruction support
Carl Love [Wed, 2 Oct 2013 16:25:57 +0000 (16:25 +0000)] 
Power PC, Approach 1, add Transactional Memory instruction support

The following Transactional Memory instructions are added:
  tbegin., tend., tsr., tcheck., tabortwc.,
  tabortdc., tabortwci., tabortdci., tabort.

The patch implements the first proposal by Julian on how to handle the
TM instructions. The proposal is as follows:

    translate "XBEGIN fail-addr" as "goto fail-addr"; that is: push
    simulated execution directly onto the failure path.  This is simple
    but will have poor performance, if (as is likely) the failure path
    uses normal locking and is not tuned for speed.

The tbegin instruction on Power sets the condition code register to
indicate if the tbegin instruction suceeded or failed.  The compiler
then generates a conditional branch instruction to take the success
or failure code path for the tbegin instruction.  In order to fail the
tbegin instruction, the condition code register is updated to indicate
that the tbegin instruction failed.  This patch assumes that there is
always an error handler for the tbegin instruction.  The other TM
instructions are all treated as no ops as we shouldn't be executing the
sucess transactional code path.

Signed-off-by: Carl Love <cel@us.ibm.com>
Bugzilla 323803

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