You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(6) |
2
(4) |
3
(12) |
4
(14) |
5
(6) |
|
6
(1) |
7
(10) |
8
(4) |
9
(1) |
10
(2) |
11
(7) |
12
(1) |
|
13
(3) |
14
(8) |
15
(5) |
16
(6) |
17
(1) |
18
(11) |
19
(5) |
|
20
(2) |
21
(7) |
22
(3) |
23
(1) |
24
|
25
(4) |
26
(1) |
|
27
(1) |
28
|
29
(1) |
30
(7) |
|
|
|
|
From: Bart V. A. <bar...@gm...> - 2009-09-05 07:18:08
|
Nightly build on georgia-tech-cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) Started at 2009-09-05 02:15:57 EDT Ended at 2009-09-05 03:17:43 EDT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 447 tests, 43 stderr failures, 8 stdout failures, 0 post failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cases-full (stderr) memcheck/tests/leak-cases-summary (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/wrap8 (stderr) none/tests/empty-exe (stderr) none/tests/linux/mremap (stderr) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-vmx (stdout) none/tests/ppc32/round (stdout) none/tests/ppc32/test_gx (stdout) none/tests/ppc64/jm-fp (stdout) none/tests/ppc64/jm-vmx (stdout) none/tests/ppc64/round (stdout) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) none/tests/shell_zerolength (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc06_two_races_xml (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) exp-ptrcheck/tests/bad_percentify (stderr) exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/fp (stderr) exp-ptrcheck/tests/globalerr (stderr) exp-ptrcheck/tests/hackedbz2 (stderr) exp-ptrcheck/tests/hp_bounds (stderr) exp-ptrcheck/tests/hp_dangle (stderr) exp-ptrcheck/tests/hsg (stderr) exp-ptrcheck/tests/justify (stderr) exp-ptrcheck/tests/partial_bad (stderr) exp-ptrcheck/tests/partial_good (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) exp-ptrcheck/tests/realloc (stderr) exp-ptrcheck/tests/stackerr (stderr) exp-ptrcheck/tests/strcpy (stderr) exp-ptrcheck/tests/supp (stderr) exp-ptrcheck/tests/tricky (stderr) exp-ptrcheck/tests/unaligned (stderr) exp-ptrcheck/tests/zero (stderr) |
|
From: Tom H. <th...@cy...> - 2009-09-05 02:49:17
|
Nightly build on lloyd ( x86_64, Fedora 7 ) Started at 2009-09-05 03:05:03 BST Ended at 2009-09-05 03:48:58 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 530 tests, 1 stderr failure, 0 stdout failures, 0 post failures == helgrind/tests/tc06_two_races_xml (stderr) |
|
From: Tom H. <th...@cy...> - 2009-09-05 02:49:14
|
Nightly build on vauxhall ( x86_64, Fedora 11 ) Started at 2009-09-05 03:20:05 BST Ended at 2009-09-05 03:48:57 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 540 tests, 8 stderr failures, 0 stdout failures, 0 post failures == memcheck/tests/linux/stack_switch (stderr) memcheck/tests/long_namespace_xml (stderr) helgrind/tests/pth_spinlock (stderr) helgrind/tests/tc06_two_races_xml (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc23_bogus_condwait (stderr) drd/tests/qt4_semaphore (stderr) exp-ptrcheck/tests/bad_percentify (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 540 tests, 7 stderr failures, 0 stdout failures, 0 post failures == memcheck/tests/linux/stack_switch (stderr) memcheck/tests/long_namespace_xml (stderr) helgrind/tests/tc06_two_races_xml (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc23_bogus_condwait (stderr) drd/tests/qt4_mutex (stderr) exp-ptrcheck/tests/bad_percentify (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Sat Sep 5 03:34:34 2009 --- new.short Sat Sep 5 03:48:57 2009 *************** *** 8,12 **** ! == 540 tests, 7 stderr failures, 0 stdout failures, 0 post failures == memcheck/tests/linux/stack_switch (stderr) memcheck/tests/long_namespace_xml (stderr) helgrind/tests/tc06_two_races_xml (stderr) --- 8,13 ---- ! == 540 tests, 8 stderr failures, 0 stdout failures, 0 post failures == memcheck/tests/linux/stack_switch (stderr) memcheck/tests/long_namespace_xml (stderr) + helgrind/tests/pth_spinlock (stderr) helgrind/tests/tc06_two_races_xml (stderr) *************** *** 14,16 **** helgrind/tests/tc23_bogus_condwait (stderr) ! drd/tests/qt4_mutex (stderr) exp-ptrcheck/tests/bad_percentify (stderr) --- 15,17 ---- helgrind/tests/tc23_bogus_condwait (stderr) ! drd/tests/qt4_semaphore (stderr) exp-ptrcheck/tests/bad_percentify (stderr) |
|
From: Tom H. <th...@cy...> - 2009-09-05 02:31:34
|
Nightly build on mg ( x86_64, Fedora 9 ) Started at 2009-09-05 03:10:05 BST Ended at 2009-09-05 03:31:15 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 537 tests, 1 stderr failure, 0 stdout failures, 0 post failures == helgrind/tests/tc06_two_races_xml (stderr) |
|
From: <sv...@va...> - 2009-09-05 00:04:07
|
Author: sewardj
Date: 2009-09-05 01:03:52 +0100 (Sat, 05 Sep 2009)
New Revision: 1919
Log:
Update ("cand1" committed for real use in immediately preceding r1918).
Modified:
trunk/useful/smchash.c
Modified: trunk/useful/smchash.c
===================================================================
--- trunk/useful/smchash.c 2009-09-05 00:03:07 UTC (rev 1918)
+++ trunk/useful/smchash.c 2009-09-05 00:03:52 UTC (rev 1919)
@@ -40,12 +40,12 @@
assert(!ferror(f));
r= fscanf(f, "GuestBytes %llx %d ", &gb->ga, &gb->nbytes);
- printf("r = %d\n", r);
+ if (0) printf("r = %d\n", r);
assert(r == 2);
assert(gb->ga != 0);
assert(gb->nbytes > 0);
- assert(gb->nbytes < 500); // let's say
+ assert(gb->nbytes < 5000); // let's say
Int nToAlloc = gb->nbytes + (gb->ga & 3);
@@ -78,7 +78,7 @@
{
while (!feof(f)) {
GuestBytes* gb = read_one(f);
- printf("got %llu %d\n", gb->ga, gb->nbytes);
+ if (0) printf("got %llu %d\n", gb->ga, gb->nbytes);
fn( gb, opaque );
free(gb->bytes);
free(gb);
@@ -145,16 +145,91 @@
}
return sum;
}
+
+static UInt cand1 ( GuestBytes* gb )
+{
+ UWord addr = (UWord)gb->actual;
+ UWord len = gb->nbytes;
+ UInt sum1 = 0, sum2 = 0;
+ /* pull up to 4-alignment */
+ while ((addr & 3) != 0 && len >= 1) {
+ UChar* p = (UChar*)addr;
+ sum1 = (sum1 << 8) | (UInt)p[0];
+ addr++;
+ len--;
+ }
+ /* vectorised + unrolled */
+ while (len >= 16) {
+ UInt* p = (UInt*)addr;
+ UInt w;
+ w = p[0]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[1]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[2]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[3]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ addr += 16;
+ len -= 16;
+ sum1 ^= sum2;
+ }
+ /* vectorised fixup */
+ while (len >= 4) {
+ UInt* p = (UInt*)addr;
+ UInt w = p[0];
+ sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ addr += 4;
+ len -= 4;
+ sum1 ^= sum2;
+ }
+ /* scalar fixup */
+ while (len >= 1) {
+ UChar* p = (UChar*)addr;
+ UInt w = (UInt)p[0];
+ sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ addr++;
+ len--;
+ }
+ return sum1 + sum2;
+}
+static UInt adler32 ( GuestBytes* gb )
+{
+ UWord addr = (UWord)gb->actual;
+ UWord len = gb->nbytes;
+ UInt s1 = 1;
+ UInt s2 = 0;
+ UChar* buf = (UChar*)addr;
+ while (len >= 4) {
+ s1 += buf[0];
+ s2 += s1;
+ s1 += buf[1];
+ s2 += s1;
+ s1 += buf[2];
+ s2 += s1;
+ s1 += buf[3];
+ s2 += s1;
+ buf += 4;
+ len -= 4;
+ }
+ while (len > 0) {
+ s1 += buf[0];
+ s2 += s1;
+ len--;
+ buf++;
+ }
+ return (s2 << 16) + s1;
+}
+
+
//////////////////////////////////////////////////////////
UInt (*theFn)(GuestBytes*) =
//hash_const_zero;
//hash_sum;
- //hash_rol;
- cand0;
+//hash_rol;
+//cand0;
+ cand1;
+ //adler32;
Int cmp_UInt_ps ( UInt* p1, UInt* p2 ) {
if (*p1 < *p2) return -1;
@@ -162,36 +237,75 @@
return 0;
}
+Int nSetBits ( UInt w )
+{
+ Int i, j;
+ j = 0;
+ for (i = 0; i < 32; i++)
+ if (w & (1<<i))
+ j++;
+ return j;
+}
+
+Int toc_nblocks = 0;
+Int toc_nblocks_with_zero = 0;
+double toc_sum_of_avgs = 0.0;
+
+void invertBit ( UChar* b, UInt ix, UInt bix ) {
+ b[ix] ^= (1 << bix);
+}
+
void try_onebit_changes( GuestBytes* gb, void* opaque )
{
+ toc_nblocks++;
/* collect up the hash values for all one bit changes of the key,
- and also that for the unmodified key. Then sort and see if we
- have any dups. */
+ and also that for the unmodified key. Then compute the number
+ of changed bits for all of them. */
UInt hashIx = 0;
- UInt nHashes = 1 + 8 * gb->nbytes;
+ UInt nHashes = 8 * gb->nbytes;
UInt* hashes = malloc( nHashes * sizeof(UInt) );
UInt byteIx, bitIx;
UInt hInit, hFinal, hRunning;
+ Int dist, totDist = 0, nNoDist = 0;
assert(hashes);
hInit = theFn( gb );
- hashes[hashIx++] = hInit;
for (byteIx = 0; byteIx < gb->nbytes; byteIx++) {
for (bitIx = 0; bitIx < 8; bitIx++) {
- gb->actual[byteIx] ^= (1 << bitIx);
+
+ invertBit(gb->actual, byteIx, bitIx);
+ //invertBit(gb->actual, byteIx, bitIx ^ 4);
+
hRunning = theFn( gb );
+
+ dist = nSetBits(hRunning ^ hInit);
+ totDist += dist;
+ if (dist == 0) nNoDist++;
+
hashes[hashIx++] = hRunning;
- gb->actual[byteIx] ^= (1 << bitIx);
- printf(" %02d.%d %08x\n", byteIx, bitIx, hRunning);
+
+ invertBit(gb->actual, byteIx, bitIx);
+ //invertBit(gb->actual, byteIx, bitIx ^ 4);
+
+ if (0) printf(" %02d.%d %08x %d\n",
+ byteIx, bitIx, hRunning ^ hInit, dist);
}
}
hFinal = theFn( gb );
assert(hFinal == hInit);
assert(hashIx == nHashes);
- qsort( hashes, nHashes, sizeof(UInt), cmp_UInt_ps );
+ if (nNoDist > 0)
+ printf("%4d measurements, %5.2f avg dist, %2d zeroes\n",
+ (Int)nHashes, (double)totDist / (double)nHashes, nNoDist);
+ else
+ printf("%4d measurements, %5.2f avg dist\n",
+ (Int)nHashes, (double)totDist / (double)nHashes);
+ if (nNoDist > 0)
+ toc_nblocks_with_zero++;
+ toc_sum_of_avgs += (double)totDist / (double)nHashes;
free(hashes);
}
@@ -202,6 +316,8 @@
{
FILE* f = stdin;
apply_to_all(f, try_onebit_changes, NULL);
+ printf("\n%d blocks, %d with a zero, %5.2f avg avg\n\n",
+ toc_nblocks, toc_nblocks_with_zero, toc_sum_of_avgs / (double)toc_nblocks );
return 0;
}
|
|
From: <sv...@va...> - 2009-09-05 00:03:23
|
Author: sewardj
Date: 2009-09-05 01:03:07 +0100 (Sat, 05 Sep 2009)
New Revision: 1918
Log:
Use a much faster hash function to do the self-modifying-code checks.
This reduces the extra overhead of --smc-check=all when running
Memcheck from about 75% to about 45%.
Modified:
trunk/priv/guest_generic_bb_to_IR.c
Modified: trunk/priv/guest_generic_bb_to_IR.c
===================================================================
--- trunk/priv/guest_generic_bb_to_IR.c 2009-08-31 08:53:26 UTC (rev 1917)
+++ trunk/priv/guest_generic_bb_to_IR.c 2009-09-05 00:03:07 UTC (rev 1918)
@@ -53,8 +53,10 @@
/* Forwards .. */
-__attribute((regparm(2)))
-static UInt genericg_compute_adler32 ( HWord addr, HWord len );
+__attribute__((regparm(2)))
+static UInt genericg_compute_checksum_4al_4plus ( HWord addr, HWord len );
+__attribute__((regparm(2)))
+static UInt genericg_compute_checksum_generic ( HWord addr, HWord len );
/* Small helpers */
static Bool const_False ( void* callback_opaque, Addr64 a ) {
@@ -264,7 +266,7 @@
}
/* If dis_instr_fn terminated the BB at this point, check it
- also filled in the irsb->next field. */
+ also filled in the irsb->next field. */
if (dres.whatNext == Dis_StopHere) {
vassert(irsb->next != NULL);
if (debug_print) {
@@ -279,9 +281,9 @@
/* Update the VexGuestExtents we are constructing. */
/* If vex_control.guest_max_insns is required to be < 100 and
- each insn is at max 20 bytes long, this limit of 5000 then
- seems reasonable since the max possible extent length will be
- 100 * 20 == 2000. */
+ each insn is at max 20 bytes long, this limit of 5000 then
+ seems reasonable since the max possible extent length will be
+ 100 * 20 == 2000. */
vassert(vge->len[vge->n_used-1] < 5000);
vge->len[vge->n_used-1]
= toUShort(toUInt( vge->len[vge->n_used-1] + dres.len ));
@@ -342,66 +344,76 @@
a self-checking preamble may need to be created. */
if (do_self_check) {
- UInt len2check, adler32;
+ UInt len2check, expected32;
IRTemp tistart_tmp, tilen_tmp;
- HWord p_adler_helper;
+ UInt (*checksum_fn)(HWord, HWord) __attribute__((regparm(2)));
+ HWord checksum_fn_entry;
vassert(vge->n_used == 1);
len2check = vge->len[0];
- if (len2check == 0)
- len2check = 1;
- adler32 = genericg_compute_adler32( (HWord)guest_code, len2check );
+ /* stay sane */
+ vassert(len2check >= 0 && len2check < 1000/*arbitrary*/);
- /* Set TISTART and TILEN. These will describe to the despatcher
- the area of guest code to invalidate should we exit with a
- self-check failure. */
+ if (len2check >= 4 && 0 == (((HWord)guest_code) & 3)) {
+ checksum_fn = genericg_compute_checksum_4al_4plus;
+ } else {
+ checksum_fn = genericg_compute_checksum_generic;
+ }
- tistart_tmp = newIRTemp(irsb->tyenv, guest_word_type);
- tilen_tmp = newIRTemp(irsb->tyenv, guest_word_type);
+ expected32 = checksum_fn( (HWord)guest_code, len2check );
- irsb->stmts[selfcheck_idx+0]
- = IRStmt_WrTmp(tistart_tmp, IRExpr_Const(guest_IP_bbstart_IRConst) );
+ /* Set TISTART and TILEN. These will describe to the despatcher
+ the area of guest code to invalidate should we exit with a
+ self-check failure. */
- irsb->stmts[selfcheck_idx+1]
- = IRStmt_WrTmp(tilen_tmp,
- guest_word_type==Ity_I32
- ? IRExpr_Const(IRConst_U32(len2check))
- : IRExpr_Const(IRConst_U64(len2check))
- );
+ tistart_tmp = newIRTemp(irsb->tyenv, guest_word_type);
+ tilen_tmp = newIRTemp(irsb->tyenv, guest_word_type);
- irsb->stmts[selfcheck_idx+2]
- = IRStmt_Put( offB_TISTART, IRExpr_RdTmp(tistart_tmp) );
+ irsb->stmts[selfcheck_idx+0]
+ = IRStmt_WrTmp(tistart_tmp, IRExpr_Const(guest_IP_bbstart_IRConst) );
- irsb->stmts[selfcheck_idx+3]
- = IRStmt_Put( offB_TILEN, IRExpr_RdTmp(tilen_tmp) );
+ irsb->stmts[selfcheck_idx+1]
+ = IRStmt_WrTmp(tilen_tmp,
+ guest_word_type==Ity_I32
+ ? IRExpr_Const(IRConst_U32(len2check))
+ : IRExpr_Const(IRConst_U64(len2check))
+ );
- if (abiinfo_both->host_ppc_calls_use_fndescrs) {
- HWord* fndescr = (HWord*)&genericg_compute_adler32;
- p_adler_helper = fndescr[0];
- } else {
- p_adler_helper = (HWord)&genericg_compute_adler32;
- }
+ irsb->stmts[selfcheck_idx+2]
+ = IRStmt_Put( offB_TISTART, IRExpr_RdTmp(tistart_tmp) );
- irsb->stmts[selfcheck_idx+4]
- = IRStmt_Exit(
- IRExpr_Binop(
- Iop_CmpNE32,
- mkIRExprCCall(
- Ity_I32,
- 2/*regparms*/,
- "genericg_compute_adler32",
- (void*)p_adler_helper,
- mkIRExprVec_2(
- mkIRExpr_HWord( (HWord)guest_code ),
- mkIRExpr_HWord( (HWord)len2check )
- )
- ),
- IRExpr_Const(IRConst_U32(adler32))
- ),
- Ijk_TInval,
- guest_IP_bbstart_IRConst
- );
+ irsb->stmts[selfcheck_idx+3]
+ = IRStmt_Put( offB_TILEN, IRExpr_RdTmp(tilen_tmp) );
+
+ if (abiinfo_both->host_ppc_calls_use_fndescrs) {
+ HWord* fndescr = (HWord*)checksum_fn;
+ checksum_fn_entry = fndescr[0];
+ } else {
+ checksum_fn_entry = (HWord)checksum_fn;
+ }
+
+ irsb->stmts[selfcheck_idx+4]
+ = IRStmt_Exit(
+ IRExpr_Binop(
+ Iop_CmpNE32,
+ mkIRExprCCall(
+ Ity_I32,
+ 2/*regparms*/,
+ checksum_fn == genericg_compute_checksum_4al_4plus
+ ? "genericg_compute_checksum_4al_4plus"
+ : "genericg_compute_checksum_generic",
+ (void*)checksum_fn_entry,
+ mkIRExprVec_2(
+ mkIRExpr_HWord( (HWord)guest_code ),
+ mkIRExpr_HWord( (HWord)len2check )
+ )
+ ),
+ IRExpr_Const(IRConst_U32(expected32))
+ ),
+ Ijk_TInval,
+ guest_IP_bbstart_IRConst
+ );
}
return irsb;
@@ -415,40 +427,99 @@
/* CLEAN HELPER */
/* CALLED FROM GENERATED CODE */
-/* Compute the Adler32 checksum of host memory at [addr
- .. addr+len-1]. This presumably holds guest code. Note this is
- not a proper implementation of Adler32 in that it fails to mod the
- counts with 65521 every 5552 bytes, but we really never expect to
- get anywhere near that many bytes to deal with. This fn is called
- once for every use of a self-checking translation, so it needs to
- be as fast as possible. */
+/* Compute a checksum of host memory at [addr .. addr+len-1], as fast
+ as possible. The _4al_4plus version is assured that the request is
+ for 4-aligned memory and for a block of 4 or more long, whilst the
+ _generic version must be able to handle any alignment, and lengths
+ down to zero too. This fn is called once for every use of a
+ self-checking translation, so it needs to be as fast as
+ possible. */
+
+static inline UInt ROL32 ( UInt w, Int n ) {
+ w = (w << n) | (w >> (32-n));
+ return w;
+}
+
__attribute((regparm(2)))
-static UInt genericg_compute_adler32 ( HWord addr, HWord len )
+static UInt genericg_compute_checksum_generic ( HWord addr, HWord len )
{
- UInt s1 = 1;
- UInt s2 = 0;
- UChar* buf = (UChar*)addr;
+ UInt sum1 = 0, sum2 = 0;
+ /* pull up to 4-alignment */
+ while ((addr & 3) != 0 && len >= 1) {
+ UChar* p = (UChar*)addr;
+ sum1 = (sum1 << 8) | (UInt)p[0];
+ addr++;
+ len--;
+ }
+ /* vectorised + unrolled */
+ while (len >= 16) {
+ UInt* p = (UInt*)addr;
+ UInt w;
+ w = p[0]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[1]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[2]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[3]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ addr += 16;
+ len -= 16;
+ sum1 ^= sum2;
+ }
+ /* vectorised fixup */
while (len >= 4) {
- s1 += buf[0];
- s2 += s1;
- s1 += buf[1];
- s2 += s1;
- s1 += buf[2];
- s2 += s1;
- s1 += buf[3];
- s2 += s1;
- buf += 4;
- len -= 4;
+ UInt* p = (UInt*)addr;
+ UInt w = p[0];
+ sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ addr += 4;
+ len -= 4;
+ sum1 ^= sum2;
}
- while (len > 0) {
- s1 += buf[0];
- s2 += s1;
+ /* scalar fixup */
+ while (len >= 1) {
+ UChar* p = (UChar*)addr;
+ UInt w = (UInt)p[0];
+ sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ addr++;
len--;
- buf++;
}
- return (s2 << 16) + s1;
+ return sum1 + sum2;
}
+__attribute((regparm(2)))
+static UInt genericg_compute_checksum_4al_4plus ( HWord addr, HWord len )
+{
+ UInt sum1 = 0, sum2 = 0;
+ /* vassert(0 == (addr & 3)); */
+ /* vassert(len >= 4); */
+ /* vectorised + unrolled */
+ while (len >= 16) {
+ UInt* p = (UInt*)addr;
+ UInt w;
+ w = p[0]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[1]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[2]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[3]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ addr += 16;
+ len -= 16;
+ sum1 ^= sum2;
+ }
+ /* vectorised fixup */
+ while (len >= 4) {
+ UInt* p = (UInt*)addr;
+ UInt w = p[0];
+ sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ addr += 4;
+ len -= 4;
+ sum1 ^= sum2;
+ }
+ /* scalar fixup */
+ while (len >= 1) {
+ UChar* p = (UChar*)addr;
+ UInt w = (UInt)p[0];
+ sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ addr++;
+ len--;
+ }
+ return sum1 + sum2;
+}
/*--------------------------------------------------------------------*/
/*--- end guest_generic_bb_to_IR.c ---*/
|