Commit Graph

1475 Commits

Author SHA1 Message Date
Cerion Armour-Brown
1efe44baeb 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
2005-12-23 00:55:09 +00:00
Cerion Armour-Brown
ad4ed6862c 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
2005-12-22 14:32:35 +00:00
Julian Seward
1754c8cdda small fixes for ppc64 layout stuff
git-svn-id: svn://svn.valgrind.org/vex/trunk@1502
2005-12-22 03:01:17 +00:00
Julian Seward
beb01dab8b Strict-aliasing fix needed to make gcc-4.1.0 happy.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1501
2005-12-18 03:07:11 +00:00
Cerion Armour-Brown
9be0daea39 Fix typos.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1500
2005-12-17 11:28:53 +00:00
Cerion Armour-Brown
c036d8fee8 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
2005-12-16 13:49:00 +00:00
Cerion Armour-Brown
9bd3c04467 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
2005-12-16 13:40:18 +00:00
Julian Seward
12dde4a14a 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
2005-12-16 01:06:42 +00:00
Julian Seward
8a3317bad1 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
2005-12-15 21:33:50 +00:00
Julian Seward
664f3b0f1f Modify amd64 backend to use jump-jump scheme rather than call-return
scheme.



git-svn-id: svn://svn.valgrind.org/vex/trunk@1495
2005-12-15 15:45:20 +00:00
Julian Seward
1dd039af9a - 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
2005-12-15 14:02:34 +00:00
Julian Seward
60be81eec1 Stop gcc complaining.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1493
2005-12-15 13:58:07 +00:00
Cerion Armour-Brown
ee154ccea4 Enable fsqrt
Document store fp single-precision problem



git-svn-id: svn://svn.valgrind.org/vex/trunk@1492
2005-12-14 22:00:53 +00:00
Cerion Armour-Brown
cd4ab2ee04 More svn:ignores for VEX.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1491
2005-12-14 10:22:25 +00:00
Cerion Armour-Brown
e4b0a05930 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
2005-12-13 21:30:48 +00:00
Cerion Armour-Brown
0d108ec99b Fix vex_printf padding.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1489
2005-12-13 20:23:36 +00:00
Cerion Armour-Brown
818033bda7 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
2005-12-13 20:21:11 +00:00
Cerion Armour-Brown
da47ea3ce4 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
2005-12-13 12:02:26 +00:00
Cerion Armour-Brown
2b4b860d22 fix padding for VexGuestPPC64State
git-svn-id: svn://svn.valgrind.org/vex/trunk@1484
2005-12-06 19:11:02 +00:00
Cerion Armour-Brown
6ff80ca1a1 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
2005-12-02 16:03:46 +00:00
Cerion Armour-Brown
4e37f03c71 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
2005-11-30 19:55:22 +00:00
Julian Seward
c28032e22a Fix %lr handling for bcctr and bclr.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1478
2005-11-29 18:19:11 +00:00
Julian Seward
d71ed5c43c Set mode64 from the given guest subarch.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1477
2005-11-29 14:47:04 +00:00
Cerion Armour-Brown
6371599e21 Missed this in commit of vex: r1475 (ppc64 first pass)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1476
2005-11-29 13:48:52 +00:00
Cerion Armour-Brown
61388cd995 First pass at VEX support of ppc64.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1475
2005-11-29 13:27:20 +00:00
Julian Seward
304013a7b8 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
2005-11-28 13:39:37 +00:00
Julian Seward
4c75139bb3 3rd go at making args match format string.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1473
2005-11-28 13:34:19 +00:00
Julian Seward
af4dc60569 64-bit format string fix
git-svn-id: svn://svn.valgrind.org/vex/trunk@1471
2005-11-25 04:28:46 +00:00
Julian Seward
a28b26db0e Be paranoid about the alignment of the storage arrays.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1470
2005-11-25 02:47:00 +00:00
Julian Seward
aed3293365 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
2005-11-23 04:25:07 +00:00
Julian Seward
79c788971d 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
2005-11-23 03:54:48 +00:00
Julian Seward
0820b0511a 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
2005-11-23 03:53:45 +00:00
Julian Seward
90186e5176 gcc-2.96 build fixes
git-svn-id: svn://svn.valgrind.org/vex/trunk@1466
2005-11-18 22:18:23 +00:00
Cerion Armour-Brown
c83786cdb1 Cleaned up access to 'special purpose' registers.
Added todo/limitations comments for AltiVec.




git-svn-id: svn://svn.valgrind.org/vex/trunk@1465
2005-11-18 20:57:41 +00:00
Cerion Armour-Brown
fabc8369bf Track valgrind r5196, wrt Non-Java mode
git-svn-id: svn://svn.valgrind.org/vex/trunk@1464
2005-11-18 20:45:51 +00:00
Cerion Armour-Brown
e6f7767c72 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
2005-11-18 18:25:12 +00:00
Cerion Armour-Brown
5996cdab13 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
2005-11-16 18:02:58 +00:00
Cerion Armour-Brown
73d7b6b986 Yet more irops, for fp vector conversion/rounding.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1461
2005-11-16 17:21:10 +00:00
Julian Seward
33803b9d78 Implement SSE2 'clflush'.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1460
2005-11-15 11:16:30 +00:00
Julian Seward
8f452dd572 delete unused multiply primops
git-svn-id: svn://svn.valgrind.org/vex/trunk@1459
2005-11-15 10:21:19 +00:00
Cerion Armour-Brown
d9bdd356ef gcc4 picked up a typo.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1458
2005-11-14 03:32:23 +00:00
Cerion Armour-Brown
7925e4424f 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
2005-11-14 02:37:44 +00:00
Cerion Armour-Brown
34080ba454 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
2005-11-14 00:44:47 +00:00
Cerion Armour-Brown
6725abe8df New irops: Iop_CmpGT32Fx4, Iop_CmpGE32Fx4
git-svn-id: svn://svn.valgrind.org/vex/trunk@1455
2005-11-14 00:35:59 +00:00
Julian Seward
056d78e6c2 More profiling-induced speedups.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1454
2005-11-13 20:30:24 +00:00
Julian Seward
a1bbc2bb52 Add some flag-specialisation cases that profiling showed the need for.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1453
2005-11-13 19:51:04 +00:00
Julian Seward
14bb11d1b6 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
2005-11-13 00:53:05 +00:00
Julian Seward
4ee4d8d05f Always mark blrl as a return.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1451
2005-11-12 12:56:31 +00:00
Julian Seward
32239e792b Add "make -j N" kludge to Vex too.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1450
2005-11-11 18:37:10 +00:00
Julian Seward
8b32baa475 Handle instrumentation artefacts arising from memchecking Altivec
code.  Also, rename a few primops and add another folding rule.



git-svn-id: svn://svn.valgrind.org/vex/trunk@1449
2005-11-10 18:10:58 +00:00