]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
19 years agoFollowup to r1562: fixes for ppc64
Julian Seward [Fri, 3 Feb 2006 19:12:17 +0000 (19:12 +0000)] 
Followup to r1562: fixes for ppc64

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

19 years agoAn overhaul of VEX's floating point handling, to facilitate correct
Julian Seward [Fri, 3 Feb 2006 16:08:03 +0000 (16:08 +0000)] 
An overhaul of VEX's floating point handling, to facilitate correct
simulation of IEEE rounding modes in all FP operations.

The fundamental change is to add a third argument to the basic
floating point primops, eg AddF64, MulF64, etc, indicating the
(IR-encoded) rounding mode to be used for that operation.

Unfortunately IR did not have any way to support three-argument
primops, which means a new kind of IRExpr has been added: a ternary
op, IRExpr_Triop, which is simply a 3-argument form of the existing IR
binary operation node.  The unfortunate side effect is that the size
of the union type IRExpr has increased from 16 to 20 bytes on 32-bit
platforms, and hence the JIT chews through more memory, but this does
not appear to have a measurable effect on the JIT's performance, at
least as measured by Valgrind's perf suite.

* Add IRExpr_Triop, and add handling code to dozens of places which
  examine IRExprs.

* Rename/retype a bunch of floating point IR primops to take a 3rd
  rounding mode argument (which is always the first arg).

* Add extra primops AddF64r32 et al, which do double-precision FP
  operations and then round to single precision, still within a 64-bit
  type.  This is needed to simulate PPC's fadds et al without double
  rounding.

* Adjust the PPC->IR front end, to generate these new primops and
  rounding modes.

* Cause the IR optimiser to do a CSE pass on blocks containing any
  floating point operations.  This commons up the IR rounding mode
  computations, which is important for generating efficient code from
  the backend.

* Adjust the IR->PPC back end, so as to emit instructions to set the
  rounding mode before each FP operation.  Well, at least in
  principle.  In practice there is a bit of cleverness to avoid
  repeatedly setting it to the same value.  This depends on both the
  abovementioned CSE pass, and on the SSA property of IR (cool stuff,
  SSA!).  The effect is that for most blocks containing FP code, the
  rounding mode is set just once, at the start of the block, and the
  resulting overhead is minimal.  See comment on
  set_FPU_rounding_mode().

This change requires followup changes in memcheck.  Also, the
x86/amd64 front/back ends are temporarily broken.

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

19 years agoDo fre/fres in a way which makes minimal demands on the backend.
Julian Seward [Tue, 31 Jan 2006 16:32:25 +0000 (16:32 +0000)] 
Do fre/fres in a way which makes minimal demands on the backend.

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

19 years agoF64i isel fix.
Julian Seward [Tue, 31 Jan 2006 16:31:44 +0000 (16:31 +0000)] 
F64i isel fix.

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

19 years agoHandle fre and frsqrtes. Even though the IBM docs manage to
Julian Seward [Sun, 29 Jan 2006 17:07:57 +0000 (17:07 +0000)] 
Handle fre and frsqrtes.  Even though the IBM docs manage to
contradict themselves about whether these insns exist or not.

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

19 years agoMake lsw work in 64-bit mode.
Julian Seward [Sat, 28 Jan 2006 17:07:19 +0000 (17:07 +0000)] 
Make lsw work in 64-bit mode.

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

19 years agoUn-break ppc64 following recent hw-capabilities hackery. (sigh)
Julian Seward [Fri, 27 Jan 2006 22:05:55 +0000 (22:05 +0000)] 
Un-break ppc64 following recent hw-capabilities hackery.  (sigh)

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

19 years agoUnbreak ppc32 following recent hw-capabilities hackery.
Julian Seward [Fri, 27 Jan 2006 21:52:19 +0000 (21:52 +0000)] 
Unbreak ppc32 following recent hw-capabilities hackery.

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

19 years agoChange the way Vex represents architecture variants into something
Julian Seward [Fri, 27 Jan 2006 21:20:15 +0000 (21:20 +0000)] 
Change the way Vex represents architecture variants into something
more flexible.  Prior to this change, the type VexSubArch effectively
imposed a total ordering on subarchitecture capabilities, which was
overly restrictive.  This change moves to effectively using a bit-set,
allowing some features (instruction groups) to be supported or not
supported independently of each other.

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

19 years agoRe-enable stfiwx.
Julian Seward [Fri, 27 Jan 2006 16:05:49 +0000 (16:05 +0000)] 
Re-enable stfiwx.

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

19 years agoHandle ppc32/64 fres, frsqrte.
Julian Seward [Fri, 27 Jan 2006 15:09:35 +0000 (15:09 +0000)] 
Handle ppc32/64 fres, frsqrte.

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

19 years agoIn 32-bit mode, handle F64toI64 and I64toF64.
Julian Seward [Thu, 26 Jan 2006 03:02:26 +0000 (03:02 +0000)] 
In 32-bit mode, handle F64toI64 and I64toF64.

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

19 years agoA bit more backend tidying:
Julian Seward [Thu, 26 Jan 2006 02:24:17 +0000 (02:24 +0000)] 
A bit more backend tidying:
- fix up more float-integer conversions
- remove unused signedness field on PPCInstr_Load

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

19 years agoChange the way the ppc backend does ppc32/64 float-integer
Julian Seward [Wed, 25 Jan 2006 21:29:48 +0000 (21:29 +0000)] 
Change the way the ppc backend does ppc32/64 float-integer
conversions.  fctiw/fctid/fcfid/stfiwx are now represented explicitly
and are generated by the instruction selector.  This removes the need
for hdefs.c to know anything about scratch areas on the stack and
scratch FP registers.

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

19 years agoC89 fixes.
Julian Seward [Wed, 25 Jan 2006 03:26:27 +0000 (03:26 +0000)] 
C89 fixes.

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

19 years agoTidy up the ppc instruction selector a bit. This is almost all cosmetic:
Julian Seward [Wed, 25 Jan 2006 03:01:09 +0000 (03:01 +0000)] 
Tidy up the ppc instruction selector a bit.  This is almost all cosmetic:

- clarify which functions are to be used both in 64-bit and 32-bit mode,
  and which are for one or other modes only.  Rename accordingly.

- iselWordExpr_AMode: was not generating nice amodes in 64-bit mode.
  Fixed.

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

19 years agoComment-only change: remove commented out code (lots of), change
Julian Seward [Tue, 24 Jan 2006 19:39:02 +0000 (19:39 +0000)] 
Comment-only change: remove commented out code (lots of), change
indentation in a couple of places, adjust comment at top.

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

19 years agoMinor tweaks to handle instructions created by xlc 7.0.
Julian Seward [Tue, 24 Jan 2006 19:00:05 +0000 (19:00 +0000)] 
Minor tweaks to handle instructions created by xlc 7.0.

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

19 years agoRe-enable fsqrts.
Julian Seward [Tue, 24 Jan 2006 03:33:43 +0000 (03:33 +0000)] 
Re-enable fsqrts.

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

19 years agoThe ppc32 port ran itself out of spill slots on some heavy duty FP
Julian Seward [Tue, 24 Jan 2006 00:59:00 +0000 (00:59 +0000)] 
The ppc32 port ran itself out of spill slots on some heavy duty FP
code.

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

19 years agoMore ppc64-only function wrapping hacks:
Julian Seward [Fri, 20 Jan 2006 14:19:25 +0000 (14:19 +0000)] 
More ppc64-only function wrapping hacks:

- increase size of redirect stack from 8 to 16 elems

- augment the _NRADDR pseudo-register with _NRADDR_GPR2,
  which is the value of R2 at the most recent divert point.
  This is needed in the ELF ppc64 ABI in order to safely run
  the function being wrapped.

- add pseudo-instruction to read get _NRADDR_GPR2 into _GPR3.

- related change: always keep R2 up to date wrt possible memory
  exceptions (no specific reason, just being conservative)

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

19 years agoAdd Ijk_EmFail, a new kind of IR block exit: an emulation failure
Julian Seward [Fri, 20 Jan 2006 14:13:55 +0000 (14:13 +0000)] 
Add Ijk_EmFail, a new kind of IR block exit: an emulation failure
(fatal error) from which Vex (generated code) cannot recover.

Handle this in the ppc(64) backend.

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

19 years agoFor ppc64, emit AbiHints from the front end so as to tell tools when
Julian Seward [Wed, 18 Jan 2006 04:14:52 +0000 (04:14 +0000)] 
For ppc64, emit AbiHints from the front end so as to tell tools when
the 288-byte stack should be regarded as having become undefined as
per the ppc64 ELF ABI.

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

19 years agoTwo different sets of changes (hard to disentangle):
Julian Seward [Tue, 17 Jan 2006 01:48:46 +0000 (01:48 +0000)] 
Two different sets of changes (hard to disentangle):

* Remove from Vex all knowledge about function wrapping.  All the IR
  trickery needed can be done on the Valgrind side, by giving
  LibVEX_Translate yet another callback.  This one is called just
  before any instructions are disassembled into IR, allowing Valgrind
  to insert its own IR preamble if it wants.  It also allows Valgrind
  to inhibit any insn disassembly for the block.  Effect is that this
  allows Valgrind to provide any old IR for a given translation, and
  have Vex process it as usual, yet that IR can be anything and does
  not have to bear any relationship to any guest insns anywhere.

* Consistently pass a void* closure argument as the first parameter to
  all Valgrind-supplied callbacks.  This gets rid of various nasty hacks
  at the Valgrind side to do with passing instance-specific values
  to callbacks.

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

19 years agoGive the ppc64 guest state a 16-entry pseudo-register array,
Julian Seward [Tue, 17 Jan 2006 01:42:56 +0000 (01:42 +0000)] 
Give the ppc64 guest state a 16-entry pseudo-register array,
guest_REDIR_STACK.  This is used (along with a stack pointer,
guest_REDIR_SP) by Valgrind to support function replacement and
wrapping on ppc64-linux.  Due to the strange ppc64-linux ABI, both
replacement and wrapping require saving (%R2,%LR) pairs on a stack,
and this provides the stack.

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

19 years agoTeach the ppc back end (64-bit mode only) how to deal with PutI and
Julian Seward [Tue, 17 Jan 2006 01:39:15 +0000 (01:39 +0000)] 
Teach the ppc back end (64-bit mode only) how to deal with PutI and
GetI.  These are needed to support by IR trickery which supports
function replacement/wrapping on ppc64-linux.

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

19 years agoUpdate fn redirect/wrap hooks for ppc64.
Julian Seward [Thu, 12 Jan 2006 21:13:14 +0000 (21:13 +0000)] 
Update fn redirect/wrap hooks for ppc64.

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

19 years agoMerge in function wrapping support from the FNWRAP branch. That
Julian Seward [Thu, 12 Jan 2006 12:27:58 +0000 (12:27 +0000)] 
Merge in function wrapping support from the FNWRAP branch.  That
branch hereby becomes inactive.

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

19 years agoImplement clflush.
Julian Seward [Sat, 7 Jan 2006 22:58:54 +0000 (22:58 +0000)] 
Implement clflush.

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

19 years agoppc: deal with L flag properly for different sync forms.
Cerion Armour-Brown [Thu, 5 Jan 2006 13:11:59 +0000 (13:11 +0000)] 
ppc: deal with L flag properly for different sync forms.

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

19 years agoppc: re-enable mtfsb1 instruction.
Cerion Armour-Brown [Wed, 4 Jan 2006 10:53:00 +0000 (10:53 +0000)] 
ppc: re-enable mtfsb1 instruction.

Note: Only the rounding mode field of the FPSCR is supported.
 - Reads from any other bits return zero.
 - Writes to any other bits are ignored.  Writes to 'exception control' bits or the 'non-ieee mode' bit results in an emulation warning.

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

19 years agoFix magic-sequence spotting in 64-bit mode.
Julian Seward [Tue, 3 Jan 2006 18:41:00 +0000 (18:41 +0000)] 
Fix magic-sequence spotting in 64-bit mode.

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

19 years agoAdd missing function.
Julian Seward [Tue, 3 Jan 2006 18:40:18 +0000 (18:40 +0000)] 
Add missing function.

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

19 years agoppc64 altivec:
Cerion Armour-Brown [Mon, 2 Jan 2006 15:15:45 +0000 (15:15 +0000)] 
ppc64 altivec:
 - frontend: fix stvehx, stvewx
 - backend:  fix Iop_32HLto64 (mask off hi32 bits of src regs)

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

19 years agoHandle ppc64's function ptr's for toIR.c's dirtyhelper calls.
Cerion Armour-Brown [Mon, 2 Jan 2006 14:41:50 +0000 (14:41 +0000)] 
Handle ppc64's function ptr's for toIR.c's dirtyhelper calls.

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

19 years agoHandle ppc64's function ptr's in bb_to_IR::do_self_check.
Cerion Armour-Brown [Mon, 2 Jan 2006 14:09:16 +0000 (14:09 +0000)] 
Handle ppc64's function ptr's in bb_to_IR::do_self_check.

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

19 years agoppc64 fixes:
Cerion Armour-Brown [Mon, 2 Jan 2006 13:35:51 +0000 (13:35 +0000)] 
ppc64 fixes:
 - branch: compare full 64bits of CTR reg to zero.
 - stwcx.: store only lo32 bits of r_src to EA in 64bit mode.

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

19 years agoppc64: handle 32HLto64, 64HLtoV128
Cerion Armour-Brown [Mon, 2 Jan 2006 12:28:17 +0000 (12:28 +0000)] 
ppc64: handle 32HLto64, 64HLtoV128

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

19 years agoppc64: handle V128to64, V128HIto64.
Julian Seward [Mon, 2 Jan 2006 00:35:24 +0000 (00:35 +0000)] 
ppc64: handle V128to64, V128HIto64.

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

19 years agox86 counterpart to r1521: For SSE scalar comparison operations where
Julian Seward [Sun, 1 Jan 2006 17:15:19 +0000 (17:15 +0000)] 
x86 counterpart to r1521: For SSE scalar comparison operations where
one operand is in memory, do not read more memory than needed.

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

19 years agoFor SSE scalar comparison operations where one operand is in memory,
Julian Seward [Sun, 1 Jan 2006 13:17:38 +0000 (13:17 +0000)] 
For SSE scalar comparison operations where one operand is in memory,
do not read more memory than needed.

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

19 years agoApparently "sync" has an undocumented relative called "lwsync". Sigh.
Julian Seward [Fri, 30 Dec 2005 15:04:29 +0000 (15:04 +0000)] 
Apparently "sync" has an undocumented relative called "lwsync".  Sigh.

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

19 years agoHandle dcbz in 64-bit mode.
Julian Seward [Fri, 30 Dec 2005 03:39:14 +0000 (03:39 +0000)] 
Handle dcbz in 64-bit mode.

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

19 years agoPerformance improvements for flag handling.
Julian Seward [Mon, 26 Dec 2005 19:33:55 +0000 (19:33 +0000)] 
Performance improvements for flag handling.

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

19 years agoComment-only fix
Julian Seward [Mon, 26 Dec 2005 19:33:24 +0000 (19:33 +0000)] 
Comment-only fix

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

19 years agoComment only changes - misc refs to ppc32 changed to ppc.
Cerion Armour-Brown [Sat, 24 Dec 2005 13:14:11 +0000 (13:14 +0000)] 
Comment only changes - misc refs to ppc32 changed to ppc.

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

19 years agoPut mode64 in ISelEnv, removing global variable.
Cerion Armour-Brown [Sat, 24 Dec 2005 12:39:47 +0000 (12:39 +0000)] 
Put mode64 in ISelEnv, removing global variable.

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

19 years agoFix AltiVec load/store on ppc64 - was only considering lo32 bits of address.
Cerion Armour-Brown [Sat, 24 Dec 2005 12:32:10 +0000 (12:32 +0000)] 
Fix AltiVec load/store on ppc64 - was only considering lo32 bits of address.

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

19 years agoHandle 64HLto128 in 64-bit mode.
Julian Seward [Fri, 23 Dec 2005 12:46:16 +0000 (12:46 +0000)] 
Handle 64HLto128 in 64-bit mode.

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

19 years agorenamed VEX dirs guest-ppc32/ -> guest-ppc/, host-ppc32/ -> host-ppc/
Cerion Armour-Brown [Fri, 23 Dec 2005 11:43:01 +0000 (11:43 +0000)] 
renamed VEX dirs guest-ppc32/ -> guest-ppc/, host-ppc32/ -> host-ppc/
and adjusted all references to them

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

19 years agoUpdate comment.
Julian Seward [Fri, 23 Dec 2005 01:48:23 +0000 (01:48 +0000)] 
Update comment.

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

19 years agoDeal with backend case of 1Sto64
Cerion Armour-Brown [Fri, 23 Dec 2005 01:06:35 +0000 (01:06 +0000)] 
Deal with backend case of 1Sto64

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

19 years agoChanged naming convention from 'PPC32' to 'PPC' for all VEX code common to both PPC32...
Cerion Armour-Brown [Fri, 23 Dec 2005 00:55:09 +0000 (00:55 +0000)] 
Changed naming convention from 'PPC32' to 'PPC' for all VEX code common to both PPC32 and PPC64.
And tidied up a fair bit while i was at it.

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

19 years agoImplemented almost all of the remaining 64bit-mode insns.
Cerion Armour-Brown [Thu, 22 Dec 2005 14:32:35 +0000 (14:32 +0000)] 
Implemented almost all of the remaining 64bit-mode insns.

Currently:
Not yet implemented: td(i)
Implemented, not tested: ldarx, stdcx.

All common-mode int & fp insns in 64bit-mode tested.
Altivec insns in 64bit-mode still to be tested.

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

19 years agosmall fixes for ppc64 layout stuff
Julian Seward [Thu, 22 Dec 2005 03:01:17 +0000 (03:01 +0000)] 
small fixes for ppc64 layout stuff

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

19 years agoStrict-aliasing fix needed to make gcc-4.1.0 happy.
Julian Seward [Sun, 18 Dec 2005 03:07:11 +0000 (03:07 +0000)] 
Strict-aliasing fix needed to make gcc-4.1.0 happy.

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

19 years agoFix typos.
Cerion Armour-Brown [Sat, 17 Dec 2005 11:28:53 +0000 (11:28 +0000)] 
Fix typos.

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

19 years agoFix switchback.c to reflect changes to call of LibVEX_Translate()
Cerion Armour-Brown [Fri, 16 Dec 2005 13:49:00 +0000 (13:49 +0000)] 
Fix switchback.c to reflect changes to call of LibVEX_Translate()
Fix test_ppc_jm1.c to reflect direct linking
 - main -> __main etc
 - vex_printf -> vexxx_printf etc

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

19 years agoFixed up front and backend for 32bit mul,div,cmp,shift in mode64
Cerion Armour-Brown [Fri, 16 Dec 2005 13:40:18 +0000 (13:40 +0000)] 
Fixed up front and backend for 32bit mul,div,cmp,shift in mode64
Backend:
 - separated shifts from other alu ops
 - gave {shift, mul, div, cmp} ops a bool to indicate 32|64bit insn
 - fixed and implemented more mode64 cases

Also improved some IR by moving imm's to right arg of binop - backend assumes this.

All integer ppc32 insns now pass switchback tests in 64bit mode.
(ppc64-only insns not yet fully tested)

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

19 years agoppc32/64 backend: take r29 out of circulation so the Valgrind
Julian Seward [Fri, 16 Dec 2005 01:06:42 +0000 (01:06 +0000)] 
ppc32/64 backend: take r29 out of circulation so the Valgrind
dispatcher can use it.

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

19 years agoMake suitable changes for ppc32/ppc64 following recent x86/amd64
Julian Seward [Thu, 15 Dec 2005 21:33:50 +0000 (21:33 +0000)] 
Make suitable changes for ppc32/ppc64 following recent x86/amd64
dispatch changes.  Note, this doesn't change the generated code at
all.

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

19 years agoModify amd64 backend to use jump-jump scheme rather than call-return
Julian Seward [Thu, 15 Dec 2005 15:45:20 +0000 (15:45 +0000)] 
Modify amd64 backend to use jump-jump scheme rather than call-return
scheme.

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

19 years ago- x86 back end: change code generation convention, so that instead of
Julian Seward [Thu, 15 Dec 2005 14:02:34 +0000 (14:02 +0000)] 
- x86 back end: change code generation convention, so that instead of
  dispatchers CALLing generated code which later RETs, dispatchers
  jump to generated code and it jumps back to the dispatcher.  This
  removes two memory references per translation run and by itself
  gives a measureable performance improvement on P4.  As a result,
  there is new plumbing so that the caller of LibVEX_Translate can
  supply the address of the dispatcher to jump back to.

  This probably breaks all other targets.  Do not update.

- Administrative cleanup: LibVEX_Translate has an excessive
  number of arguments.  Remove them all and instead add a struct
  by which the arguments are supplied.  Add further comments
  about the meaning of some fields.

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

19 years agoStop gcc complaining.
Julian Seward [Thu, 15 Dec 2005 13:58:07 +0000 (13:58 +0000)] 
Stop gcc complaining.

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

19 years agoEnable fsqrt
Cerion Armour-Brown [Wed, 14 Dec 2005 22:00:53 +0000 (22:00 +0000)] 
Enable fsqrt
Document store fp single-precision problem

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

19 years agoMore svn:ignores for VEX.
Cerion Armour-Brown [Wed, 14 Dec 2005 10:22:25 +0000 (10:22 +0000)] 
More svn:ignores for VEX.

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

19 years agoSwitchbacker updates
Cerion Armour-Brown [Tue, 13 Dec 2005 21:30:48 +0000 (21:30 +0000)] 
Switchbacker updates
 - no longer using home-grown linker - simply compiling and linking switchback.c with test_xxx.c
 - updated to handle ppc64 (along with it's weirdo function descriptors...)
 - have to be careful not to use exported functions from libvex_arch_linux.a, hence vex_printf -> vexxx_printf in test_xxx.c

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

19 years agoFix vex_printf padding.
Cerion Armour-Brown [Tue, 13 Dec 2005 20:23:36 +0000 (20:23 +0000)] 
Fix vex_printf padding.

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

19 years agoImplemented backend for ppc64, sharing ppc32 backend.
Cerion Armour-Brown [Tue, 13 Dec 2005 20:21:11 +0000 (20:21 +0000)] 
Implemented backend for ppc64, sharing ppc32 backend.
 - all immediates now use ULongs
 - some change in register usage conventions

Implemented most insns for mode64, plus most ppc64-only instructions
 - new Iop_DivU/S64

Fixed couple of bugs in backend:
 - iselIntExpr_RI must sign-extend immediates
 - hdefs.c::Iop_Mul16/32: set syned = False

Currently runs several test programs succesfully via the switchbacker (bzip, emfloat), but still dies with real progs.

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

19 years agoAdded 'Bool mode64' to the various backend functions, to distinguish 32/64bit arch's.
Cerion Armour-Brown [Tue, 13 Dec 2005 12:02:26 +0000 (12:02 +0000)] 
Added 'Bool mode64' to the various backend functions, to distinguish 32/64bit arch's.
This will be needed for the ppc32/64 backend.

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

19 years agofix padding for VexGuestPPC64State
Cerion Armour-Brown [Tue, 6 Dec 2005 19:11:02 +0000 (19:11 +0000)] 
fix padding for VexGuestPPC64State

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

19 years agoRe-enabled ppc32 frontend floating point load/store single precision insns:
Cerion Armour-Brown [Fri, 2 Dec 2005 16:03:46 +0000 (16:03 +0000)] 
Re-enabled ppc32 frontend floating point load/store single precision insns:
 - lfsu, stfsu, stfsux

Note: fp store single precision insns are being rounded twice, giving a loss of precision... this needs some thinking to solve properly...

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

19 years agoFixed a couple of mode32 bugs introduced by mode64
Cerion Armour-Brown [Wed, 30 Nov 2005 19:55:22 +0000 (19:55 +0000)] 
Fixed a couple of mode32 bugs introduced by mode64
Adapted more code to handle mode64
New irops: Iop_CmpORD64S/U

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

19 years agoFix %lr handling for bcctr and bclr.
Julian Seward [Tue, 29 Nov 2005 18:19:11 +0000 (18:19 +0000)] 
Fix %lr handling for bcctr and bclr.

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

19 years agoSet mode64 from the given guest subarch.
Julian Seward [Tue, 29 Nov 2005 14:47:04 +0000 (14:47 +0000)] 
Set mode64 from the given guest subarch.

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

19 years agoMissed this in commit of vex: r1475 (ppc64 first pass)
Cerion Armour-Brown [Tue, 29 Nov 2005 13:48:52 +0000 (13:48 +0000)] 
Missed this in commit of vex: r1475 (ppc64 first pass)

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

19 years agoFirst pass at VEX support of ppc64.
Cerion Armour-Brown [Tue, 29 Nov 2005 13:27:20 +0000 (13:27 +0000)] 
First pass at VEX support of ppc64.

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

19 years agoModify the tree builder to use a fixed-size binding environment rather
Julian Seward [Mon, 28 Nov 2005 13:39:37 +0000 (13:39 +0000)] 
Modify the tree builder to use a fixed-size binding environment rather
than one that is potentially proportional to the length of the input
BB.  This changes its complexity from quadratic to linear (in the
length of the BB) and gives a noticable increase in the overall speed
of vex.  The tradeoff is that it can no longer guarantee to build
maximal trees, but in practice in only rarely fails to do so (about 1
in 100 bbs) and so the resulting degradation in code quality is
completely insignificant (unmeasurable).

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

19 years ago3rd go at making args match format string.
Julian Seward [Mon, 28 Nov 2005 13:34:19 +0000 (13:34 +0000)] 
3rd go at making args match format string.

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

19 years ago64-bit format string fix
Julian Seward [Fri, 25 Nov 2005 04:28:46 +0000 (04:28 +0000)] 
64-bit format string fix

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

19 years agoBe paranoid about the alignment of the storage arrays.
Julian Seward [Fri, 25 Nov 2005 02:47:00 +0000 (02:47 +0000)] 
Be paranoid about the alignment of the storage arrays.

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

19 years agoUse a very fast in-line allocator. This improves its performance by
Julian Seward [Wed, 23 Nov 2005 04:25:07 +0000 (04:25 +0000)] 
Use a very fast in-line allocator.  This improves its performance by
up to 10% on a P4.

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

19 years agoCompile vex at -O2. This improves its performance by about 15%
Julian Seward [Wed, 23 Nov 2005 03:54:48 +0000 (03:54 +0000)] 
Compile vex at -O2.  This improves its performance by about 15%
on a PIII running SuSE 10 (gcc 4.0.2).

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

19 years agoDo float-to-bit-image conversion in a way which does not break ANSI C
Julian Seward [Wed, 23 Nov 2005 03:53:45 +0000 (03:53 +0000)] 
Do float-to-bit-image conversion in a way which does not break ANSI C
aliasing rules.

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

19 years agogcc-2.96 build fixes
Julian Seward [Fri, 18 Nov 2005 22:18:23 +0000 (22:18 +0000)] 
gcc-2.96 build fixes

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

19 years agoCleaned up access to 'special purpose' registers.
Cerion Armour-Brown [Fri, 18 Nov 2005 20:57:41 +0000 (20:57 +0000)] 
Cleaned up access to 'special purpose' registers.

Added todo/limitations comments for AltiVec.

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

19 years agoTrack valgrind r5196, wrt Non-Java mode
Cerion Armour-Brown [Fri, 18 Nov 2005 20:45:51 +0000 (20:45 +0000)] 
Track valgrind r5196, wrt Non-Java mode

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

19 years agoCleaned up toIR.c somewhat
Cerion Armour-Brown [Fri, 18 Nov 2005 18:25:12 +0000 (18:25 +0000)] 
Cleaned up toIR.c somewhat
 - cleaner extraction of instruction fields, consistent variable names, spaces for tabs, comments++

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

19 years agoImplemented most of the remaining altivec fp ops:
Cerion Armour-Brown [Wed, 16 Nov 2005 18:02:58 +0000 (18:02 +0000)] 
Implemented most of the remaining altivec fp ops:
rounds (vrfi*), converts (vctu/sxs, vcfu/sx)

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

19 years agoYet more irops, for fp vector conversion/rounding.
Cerion Armour-Brown [Wed, 16 Nov 2005 17:21:10 +0000 (17:21 +0000)] 
Yet more irops, for fp vector conversion/rounding.

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

19 years agoImplement SSE2 'clflush'.
Julian Seward [Tue, 15 Nov 2005 11:16:30 +0000 (11:16 +0000)] 
Implement SSE2 'clflush'.

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

19 years agodelete unused multiply primops
Julian Seward [Tue, 15 Nov 2005 10:21:19 +0000 (10:21 +0000)] 
delete unused multiply primops

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

19 years agogcc4 picked up a typo.
Cerion Armour-Brown [Mon, 14 Nov 2005 03:32:23 +0000 (03:32 +0000)] 
gcc4 picked up a typo.

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

19 years agoMore av insns: vmaddfp, vnmsubfp
Cerion Armour-Brown [Mon, 14 Nov 2005 02:37:44 +0000 (02:37 +0000)] 
More av insns: vmaddfp, vnmsubfp

Rough 'n ready IR used - results will be rounded along the way, not just at the end of the calculations, giving some error.

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

19 years agoFrontend
Cerion Armour-Brown [Mon, 14 Nov 2005 00:44:47 +0000 (00:44 +0000)] 
Frontend
--------
Added a bunch of altivec float insns:
vaddfp, vsubfp, vmaxfp, vminfp,
vrefp, vrsqrtefp
vcmpgefp, vcmpgtfp, vcmpbfp

Made use of fact that ppc backend for compare insns return
zero'd lanes if either of the corresponding args is a nan.
 - perhaps better to have an irop Iop_isNan32Fx4, but seems unecessary work until we get into running non-native code through vex.
 - better still, tighten down the spec for compare irops wrt nan

Backend
-------
Separated av float ops to own insn group - they're only ever type 32x4
Added av float unary insns
Added av float cmp insns - for irops that don't map directly to native insns, native behaviour wrt nan's is followed, requiring lane value==nan comparisons for each argument vector.

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

19 years agoNew irops: Iop_CmpGT32Fx4, Iop_CmpGE32Fx4
Cerion Armour-Brown [Mon, 14 Nov 2005 00:35:59 +0000 (00:35 +0000)] 
New irops: Iop_CmpGT32Fx4, Iop_CmpGE32Fx4

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

19 years agoMore profiling-induced speedups.
Julian Seward [Sun, 13 Nov 2005 20:30:24 +0000 (20:30 +0000)] 
More profiling-induced speedups.

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

19 years agoAdd some flag-specialisation cases that profiling showed the need for.
Julian Seward [Sun, 13 Nov 2005 19:51:04 +0000 (19:51 +0000)] 
Add some flag-specialisation cases that profiling showed the need for.

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

19 years agoRevise the PPC32 subarchitecture kinds, so as to facilitated
Julian Seward [Sun, 13 Nov 2005 00:53:05 +0000 (00:53 +0000)] 
Revise the PPC32 subarchitecture kinds, so as to facilitated
supporting CPUs that have neither Altivec nor FPU.

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

19 years agoAlways mark blrl as a return.
Julian Seward [Sat, 12 Nov 2005 12:56:31 +0000 (12:56 +0000)] 
Always mark blrl as a return.

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