Commit Graph

506 Commits

Author SHA1 Message Date
Julian Seward
eaafedd89c More fiddling in an attempt to make it work properly (so far
unsuccessful):

* in clean helper calls, take notice of exclusion-mask (mcx_mask)
  specifying which args to ignore.  Seems to have no effect.

* Add Paul-Mackerras-style expensive-add.  Seems to have no effect.

* When doing a shadow PUT, do not complain if uninitialised data
  is written to guest state areas which are marked in the layout info
  as 'always defined'.  This seems to help reduce the false positive
  rate, because (in guest x86) the CC_AUX field of the flags thunk
  is sometimes given an undefined value (old C flag) when setting
  the thunk after inc/dec.  Since we assume that no compiler would
  examine the C flag after inc/dec unless it knew the C flag before it
  was defined (inc/dec do not change C), this is assumed to be safe.



git-svn-id: svn://svn.valgrind.org/vex/trunk@506
2004-11-06 12:27:15 +00:00
Julian Seward
ad46569acf x86 guest: update description of which guest state bits are always
defined.



git-svn-id: svn://svn.valgrind.org/vex/trunk@505
2004-11-06 12:21:23 +00:00
Julian Seward
3249babbf3 IRCallee: add a mcx_mask field, through which front ends can pass
hints to Memcheck about which arguments in a helper call should be
ignored when it comes to computing lazy approximations of definedness
through that function.  Not sure if this mechanism needs to remain,
but for the time being ...



git-svn-id: svn://svn.valgrind.org/vex/trunk@504
2004-11-06 12:17:57 +00:00
Julian Seward
893f78e844 Further integration of baseblock stuff for shadow state. Get rid of
tons of now-irrelevant baseblock fields and offsets.  The layout
defined in coregrind/x86/state.c is now more or less (completely?)
target-independent: vex-defined guest state, vex-defined shadow guest
state, and vex-specified spill area.



git-svn-id: svn://svn.valgrind.org/vex/trunk@503
2004-11-06 12:14:43 +00:00
Julian Seward
a669c9c9e2 And-identity folding rule.
git-svn-id: svn://svn.valgrind.org/vex/trunk@502
2004-11-06 12:10:04 +00:00
Julian Seward
c8d35453a9 Track Vex API changes.
git-svn-id: svn://svn.valgrind.org/vex/trunk@501
2004-11-06 12:08:25 +00:00
Julian Seward
b6cbb527d5 x86 guest: un-break handling of eflags after inc/dec.
git-svn-id: svn://svn.valgrind.org/vex/trunk@500
2004-11-05 20:22:03 +00:00
Julian Seward
c7985f010b Debug printing wibble.
git-svn-id: svn://svn.valgrind.org/vex/trunk@499
2004-11-05 20:21:27 +00:00
Julian Seward
a4d61234a4 Make the 1.0.4 testbed work again.
git-svn-id: svn://svn.valgrind.org/vex/trunk@498
2004-11-05 20:14:54 +00:00
Julian Seward
1c2becc3b4 Oops, forgot to commit this earlier.
git-svn-id: svn://svn.valgrind.org/vex/trunk@497
2004-11-05 19:53:22 +00:00
Julian Seward
4001342f62 Major overhaul of x86 guest eflags handling, so as to make one
specific word of the thunk (CC_RES) have all data dependencies on
result of the flag setting operation.  The delayed-flag mechanism is
thusly modified so as to prevent Memcheck from giving false positives.



git-svn-id: svn://svn.valgrind.org/vex/trunk@496
2004-11-05 19:49:09 +00:00
Julian Seward
5cbf58bb7a Start adding floating point stuff to memcheck.
git-svn-id: svn://svn.valgrind.org/vex/trunk@495
2004-11-05 01:56:14 +00:00
Julian Seward
eb9bd3ab50 Add new primop 1Sto16.
git-svn-id: svn://svn.valgrind.org/vex/trunk@494
2004-11-05 01:55:46 +00:00
Julian Seward
c9a0018729 Fill in a few more cases.
git-svn-id: svn://svn.valgrind.org/vex/trunk@493
2004-11-04 20:27:37 +00:00
Julian Seward
5048dbe3ad Various plumbing to allow the optimiser (really, just a subset) to be
run post-instrumentation.



git-svn-id: svn://svn.valgrind.org/vex/trunk@492
2004-11-04 19:44:48 +00:00
Julian Seward
8355f0e4b9 Silence compiler warning.
git-svn-id: svn://svn.valgrind.org/vex/trunk@491
2004-11-04 19:43:51 +00:00
Julian Seward
76383e054a Various folding rules to clean up the IR made by Memcheck.
git-svn-id: svn://svn.valgrind.org/vex/trunk@490
2004-11-04 19:42:59 +00:00
Julian Seward
8d928776b7 Do a few more cases.
git-svn-id: svn://svn.valgrind.org/vex/trunk@489
2004-11-04 19:41:09 +00:00
Julian Seward
34f615321e x86 back end: clear up confusion over which registers carry which
arguments in regparm(2) calls.  This makes memcheck work much better.



git-svn-id: svn://svn.valgrind.org/vex/trunk@488
2004-11-04 18:25:33 +00:00
Julian Seward
81cedb427d Fix compile warnings.
git-svn-id: svn://svn.valgrind.org/vex/trunk@487
2004-11-04 16:59:37 +00:00
Julian Seward
27e1401165 Add a couple more primops needed by Memcheck.
git-svn-id: svn://svn.valgrind.org/vex/trunk@486
2004-11-04 16:57:50 +00:00
Julian Seward
891cf3482a Fix enough stuff to make 'ls' work.
git-svn-id: svn://svn.valgrind.org/vex/trunk@485
2004-11-04 16:56:29 +00:00
Julian Seward
ca184594e2 Fill in a whole bunch more cases.
git-svn-id: svn://svn.valgrind.org/vex/trunk@484
2004-11-04 15:21:04 +00:00
Julian Seward
e51b03ec3e Fill in a few more Memcheck-supporting cases.
git-svn-id: svn://svn.valgrind.org/vex/trunk@483
2004-11-04 15:20:15 +00:00
Julian Seward
e8e3446fe6 Make the x86 back end capable of generating conditional calls.
NOTE, the argument marshalling for regparm'd calls is observed to
be wrong.  Arguments are computed directly into the real registers,
thus trashing themselves if a regparm-call should be contained in
an argument to another regparm-call.



git-svn-id: svn://svn.valgrind.org/vex/trunk@482
2004-11-03 15:24:42 +00:00
Julian Seward
9396ff3f75 Fix many more cases.
git-svn-id: svn://svn.valgrind.org/vex/trunk@481
2004-11-03 15:22:25 +00:00
Julian Seward
0d2178b218 First pass at Memcheck.
git-svn-id: svn://svn.valgrind.org/vex/trunk@480
2004-11-03 09:10:30 +00:00
Julian Seward
3e8307459f remove pointless #define
git-svn-id: svn://svn.valgrind.org/vex/trunk@479
2004-11-03 09:10:08 +00:00
Julian Seward
e5aed678c7 Changes to support Memcheck:
* Pass host word type to instrumentation functions
* irdefs.c: add beginnings of proper sanity checking for flatness
* refine guest-state-layout stuff
* new primop Iop_1Sto32



git-svn-id: svn://svn.valgrind.org/vex/trunk@478
2004-11-03 09:08:33 +00:00
Julian Seward
6364a2179d Rewrite and concisify addrcheck's instrumentation function, and fill
in missing cases.  I think addrcheck should be able to run anything at
all now.



git-svn-id: svn://svn.valgrind.org/vex/trunk@477
2004-11-02 11:16:02 +00:00
Julian Seward
2224034d35 Make these compile again following renaming of some types/fields.
git-svn-id: svn://svn.valgrind.org/vex/trunk@476
2004-11-02 01:39:06 +00:00
Julian Seward
267d60f7de Give dirty helper calls a guard field (IRExpr* of type Ity_Bit) which
gates whether or not the call really happens.  Push this through
iropt.  Has no effect at the instruction selectors yet.



git-svn-id: svn://svn.valgrind.org/vex/trunk@475
2004-11-02 01:34:15 +00:00
Julian Seward
62af4cea3b Rename some types and data fields in a more logical way. No change of
functionality.



git-svn-id: svn://svn.valgrind.org/vex/trunk@474
2004-11-02 00:26:55 +00:00
Julian Seward
c183104958 Enhance sanity checking pertaining to IRCallees -- make sure
# regparms <= # actual args :-) Also, properly check clean helper calls.



git-svn-id: svn://svn.valgrind.org/vex/trunk@473
2004-10-31 21:44:54 +00:00
Julian Seward
452ac839f5 Restore the core/tool interface to what it was, by removing the
findhelper routines.



git-svn-id: svn://svn.valgrind.org/vex/trunk@472
2004-10-31 20:10:04 +00:00
Julian Seward
bb68e40f0b Make this compile again.
git-svn-id: svn://svn.valgrind.org/vex/trunk@471
2004-10-31 20:09:29 +00:00
Julian Seward
6dfd8fd068 Use new functions for helper-call-construction.
git-svn-id: svn://svn.valgrind.org/vex/trunk@470
2004-10-31 20:04:05 +00:00
Julian Seward
84f8009e8d Modified/new convenience functions for constructing helper calls.
git-svn-id: svn://svn.valgrind.org/vex/trunk@469
2004-10-31 20:02:16 +00:00
Julian Seward
49f933388d -fomit-frame-pointer is helpul for addrcheck.
git-svn-id: svn://svn.valgrind.org/vex/trunk@468
2004-10-31 17:34:39 +00:00
Julian Seward
8454c3f50c Reinstate esp-update pass (now renamed sp-update). Does not work as
well as before, because IR's SSA-property makes it more difficult to
decide on a 'chosen one' virtual register to follow around, and so
sometimes misses out some pretty obvious cases.  ToDo: improve.



git-svn-id: svn://svn.valgrind.org/vex/trunk@467
2004-10-31 14:07:30 +00:00
Julian Seward
e61a70199e Add a mini-version of the addrcheck instrumenter so as to help refine
the reg-allocator in the presence of lots of helper calls.



git-svn-id: svn://svn.valgrind.org/vex/trunk@466
2004-10-30 22:25:40 +00:00
Julian Seward
f0edcddd8c Add code to do register preferencing (moves from vreg to rreg cause
the vreg to be preferenced to rreg).  However, this is disabled as it
usually makes things worse.



git-svn-id: svn://svn.valgrind.org/vex/trunk@465
2004-10-30 22:23:53 +00:00
Julian Seward
f0d3caead6 Fix bogus assertion in doHelperCall and generally tidy up. I think it
works, but could still be wrong and might need a rewrite.



git-svn-id: svn://svn.valgrind.org/vex/trunk@464
2004-10-30 22:20:02 +00:00
Julian Seward
c94d69a513 Make addrcheck work again, including regparm.
git-svn-id: svn://svn.valgrind.org/vex/trunk@463
2004-10-30 20:40:03 +00:00
Julian Seward
2024da422c Implement regparm (1 to 3) in the x86 back end.
git-svn-id: svn://svn.valgrind.org/vex/trunk@462
2004-10-30 20:39:01 +00:00
Julian Seward
6fda2b6b3c Instead of denoting helper call targets by their names, add a new type
IRCallee to carry the name (for printing), the actual address, and the
"regparm" number if relevant.  This gets rid of the need to pass
around helper-lookup callbacks all over the place, and also lays the
groundwork for a generic "regparm" mechanism for the back end.



git-svn-id: svn://svn.valgrind.org/vex/trunk@461
2004-10-30 19:03:02 +00:00
Julian Seward
c5fd5457e1 Add and use a new version of the register allocator, which is simpler
and produces much less spill code around real-reg live ranges
(a.k.a. calls to helper functions)



git-svn-id: svn://svn.valgrind.org/vex/trunk@460
2004-10-30 13:00:55 +00:00
Julian Seward
0bc0de74ce Debug printing wibble.
git-svn-id: svn://svn.valgrind.org/vex/trunk@459
2004-10-30 00:46:52 +00:00
Julian Seward
d17934c5ad Remove unused fields in VRegInfo, and change live-range numbers to 16
bits.  This reduces the amount of heap allocated by about 6% for
nulgrinding.



git-svn-id: svn://svn.valgrind.org/vex/trunk@458
2004-10-30 00:11:43 +00:00
Julian Seward
9fd6f5f131 Much-improved method for configuring test-driver program: copy
test_main.h.base to test_main.h, and edit.


git-svn-id: svn://svn.valgrind.org/vex/trunk@457
2004-10-29 23:42:36 +00:00