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
(1) |
2
(2) |
3
|
4
(1) |
5
(6) |
6
|
|
7
(1) |
8
|
9
(1) |
10
(2) |
11
(6) |
12
(3) |
13
(3) |
|
14
|
15
(11) |
16
(8) |
17
(5) |
18
(5) |
19
(5) |
20
(3) |
|
21
(2) |
22
(4) |
23
(5) |
24
(4) |
25
|
26
|
27
|
|
28
(8) |
|
|
|
|
|
|
|
From: <sv...@va...> - 2010-02-18 23:01:37
|
Author: sewardj
Date: 2010-02-18 23:01:26 +0000 (Thu, 18 Feb 2010)
New Revision: 1960
Log:
Majorly improved implementation of self-checking for translations.
This reduces the overhead of --smc-check=all by a factor of between 2
and 3.
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 2010-01-17 15:47:01 UTC (rev 1959)
+++ trunk/priv/guest_generic_bb_to_IR.c 2010-02-18 23:01:26 UTC (rev 1960)
@@ -54,9 +54,31 @@
/* Forwards .. */
__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 );
+static UInt genericg_compute_checksum_4al ( HWord first_w32, HWord n_w32s );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_1 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_2 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_3 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_4 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_5 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_6 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_7 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_8 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_9 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_10 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_11 ( HWord first_w32 );
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_12 ( HWord first_w32 );
/* Small helpers */
static Bool const_False ( void* callback_opaque, Addr64 a ) {
@@ -364,13 +386,40 @@
done:
/* We're done. The only thing that might need attending to is that
- a self-checking preamble may need to be created. */
+ a self-checking preamble may need to be created.
+
+ The scheme is to compute a rather crude checksum of the code
+ we're making a translation of, and add to the IR a call to a
+ helper routine which recomputes the checksum every time the
+ translation is run, and requests a retranslation if it doesn't
+ match. This is obviously very expensive and considerable
+ efforts are made to speed it up:
+
+ * the checksum is computed from all the 32-bit words that
+ overlap the translated code. That means it could depend on up
+ to 3 bytes before and 3 bytes after which aren't part of the
+ translated area, and so if those change then we'll
+ unnecessarily have to discard and retranslate. This seems
+ like a pretty remote possibility and it seems as if the
+ benefit of not having to deal with the ends of the range at
+ byte precision far outweigh any possible extra translations
+ needed.
+
+ * there's a generic routine and 12 specialised cases, which
+ handle the cases of 1 through 12-word lengths respectively.
+ They seem to cover about 90% of the cases that occur in
+ practice.
+ */
if (do_self_check) {
UInt len2check, expected32;
IRTemp tistart_tmp, tilen_tmp;
- UInt (*checksum_fn)(HWord, HWord) __attribute__((regparm(2)));
- HWord checksum_fn_entry;
+ UInt (*fn_generic)(HWord, HWord) __attribute__((regparm(2)));
+ UInt (*fn_spec)(HWord) __attribute__((regparm(1)));
+ HChar* nm_generic;
+ HChar* nm_spec;
+ HWord fn_generic_entry = 0;
+ HWord fn_spec_entry = 0;
vassert(vge->n_used == 1);
len2check = vge->len[0];
@@ -378,65 +427,134 @@
/* stay sane */
vassert(len2check >= 0 && len2check < 1000/*arbitrary*/);
- if (len2check >= 4 && 0 == (((HWord)guest_code) & 3)) {
- checksum_fn = genericg_compute_checksum_4al_4plus;
- } else {
- checksum_fn = genericg_compute_checksum_generic;
- }
+ /* Skip the check if the translation involved zero bytes */
+ if (len2check > 0) {
+ HWord first_w32 = ((HWord)guest_code) & ~(HWord)3;
+ HWord last_w32 = (((HWord)guest_code) + len2check - 1) & ~(HWord)3;
+ vassert(first_w32 <= last_w32);
+ HWord w32_diff = last_w32 - first_w32;
+ vassert(0 == (w32_diff & 3));
+ HWord w32s_to_check = (w32_diff + 4) / 4;
+ vassert(w32s_to_check > 0 && w32s_to_check < 1004/*arbitrary*//4);
- expected32 = checksum_fn( (HWord)guest_code, len2check );
+ /* vex_printf("%lx %lx %ld\n", first_w32, last_w32, w32s_to_check); */
- /* 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. */
+ fn_generic = genericg_compute_checksum_4al;
+ nm_generic = "genericg_compute_checksum_4al";
+ fn_spec = NULL;
+ nm_spec = NULL;
- tistart_tmp = newIRTemp(irsb->tyenv, guest_word_type);
- tilen_tmp = newIRTemp(irsb->tyenv, guest_word_type);
+ switch (w32s_to_check) {
+ case 1: fn_spec = genericg_compute_checksum_4al_1;
+ nm_spec = "genericg_compute_checksum_4al_1"; break;
+ case 2: fn_spec = genericg_compute_checksum_4al_2;
+ nm_spec = "genericg_compute_checksum_4al_2"; break;
+ case 3: fn_spec = genericg_compute_checksum_4al_3;
+ nm_spec = "genericg_compute_checksum_4al_3"; break;
+ case 4: fn_spec = genericg_compute_checksum_4al_4;
+ nm_spec = "genericg_compute_checksum_4al_4"; break;
+ case 5: fn_spec = genericg_compute_checksum_4al_5;
+ nm_spec = "genericg_compute_checksum_4al_5"; break;
+ case 6: fn_spec = genericg_compute_checksum_4al_6;
+ nm_spec = "genericg_compute_checksum_4al_6"; break;
+ case 7: fn_spec = genericg_compute_checksum_4al_7;
+ nm_spec = "genericg_compute_checksum_4al_7"; break;
+ case 8: fn_spec = genericg_compute_checksum_4al_8;
+ nm_spec = "genericg_compute_checksum_4al_8"; break;
+ case 9: fn_spec = genericg_compute_checksum_4al_9;
+ nm_spec = "genericg_compute_checksum_4al_9"; break;
+ case 10: fn_spec = genericg_compute_checksum_4al_10;
+ nm_spec = "genericg_compute_checksum_4al_10"; break;
+ case 11: fn_spec = genericg_compute_checksum_4al_11;
+ nm_spec = "genericg_compute_checksum_4al_11"; break;
+ case 12: fn_spec = genericg_compute_checksum_4al_12;
+ nm_spec = "genericg_compute_checksum_4al_12"; break;
+ default: break;
+ }
- irsb->stmts[selfcheck_idx+0]
- = IRStmt_WrTmp(tistart_tmp, IRExpr_Const(guest_IP_bbstart_IRConst) );
+ expected32 = fn_generic( first_w32, w32s_to_check );
+ /* If we got a specialised version, check it produces the same
+ result as the generic version! */
+ if (fn_spec) {
+ vassert(nm_spec);
+ vassert(expected32 == fn_spec( first_w32 ));
+ } else {
+ vassert(!nm_spec);
+ }
- irsb->stmts[selfcheck_idx+1]
- = IRStmt_WrTmp(tilen_tmp,
- guest_word_type==Ity_I32
- ? IRExpr_Const(IRConst_U32(len2check))
- : IRExpr_Const(IRConst_U64(len2check))
- );
+ /* 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+2]
- = IRStmt_Put( offB_TISTART, IRExpr_RdTmp(tistart_tmp) );
+ tistart_tmp = newIRTemp(irsb->tyenv, guest_word_type);
+ tilen_tmp = newIRTemp(irsb->tyenv, guest_word_type);
- irsb->stmts[selfcheck_idx+3]
- = IRStmt_Put( offB_TILEN, IRExpr_RdTmp(tilen_tmp) );
+ irsb->stmts[selfcheck_idx+0]
+ = IRStmt_WrTmp(tistart_tmp, IRExpr_Const(guest_IP_bbstart_IRConst) );
- 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+1]
+ = IRStmt_WrTmp(tilen_tmp,
+ guest_word_type==Ity_I32
+ ? IRExpr_Const(IRConst_U32(len2check))
+ : IRExpr_Const(IRConst_U64(len2check))
+ );
- 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 )
- )
+ irsb->stmts[selfcheck_idx+2]
+ = IRStmt_Put( offB_TISTART, IRExpr_RdTmp(tistart_tmp) );
+
+ irsb->stmts[selfcheck_idx+3]
+ = IRStmt_Put( offB_TILEN, IRExpr_RdTmp(tilen_tmp) );
+
+ /* Generate the entry point descriptors */
+ if (abiinfo_both->host_ppc_calls_use_fndescrs) {
+ HWord* descr = (HWord*)fn_generic;
+ fn_generic_entry = descr[0];
+ if (fn_spec) {
+ descr = (HWord*)fn_spec;
+ fn_spec_entry = descr[0];
+ } else {
+ fn_spec_entry = (HWord)NULL;
+ }
+ } else {
+ fn_generic_entry = (HWord)fn_generic;
+ if (fn_spec) {
+ fn_spec_entry = (HWord)fn_spec;
+ } else {
+ fn_spec_entry = (HWord)NULL;
+ }
+ }
+
+ IRExpr* callexpr = NULL;
+ if (fn_spec) {
+ callexpr = mkIRExprCCall(
+ Ity_I32, 1/*regparms*/,
+ nm_spec, (void*)fn_spec_entry,
+ mkIRExprVec_1(
+ mkIRExpr_HWord( (HWord)first_w32 )
+ )
+ );
+ } else {
+ callexpr = mkIRExprCCall(
+ Ity_I32, 2/*regparms*/,
+ nm_generic, (void*)fn_generic_entry,
+ mkIRExprVec_2(
+ mkIRExpr_HWord( (HWord)first_w32 ),
+ mkIRExpr_HWord( (HWord)w32s_to_check )
+ )
+ );
+ }
+
+ irsb->stmts[selfcheck_idx+4]
+ = IRStmt_Exit(
+ IRExpr_Binop(
+ Iop_CmpNE32,
+ callexpr,
+ IRExpr_Const(IRConst_U32(expected32))
),
- IRExpr_Const(IRConst_U32(expected32))
- ),
- Ijk_TInval,
- guest_IP_bbstart_IRConst
- );
+ Ijk_TInval,
+ guest_IP_bbstart_IRConst
+ );
+ }
}
return irsb;
@@ -464,86 +582,252 @@
}
__attribute((regparm(2)))
-static UInt genericg_compute_checksum_generic ( HWord addr, HWord len )
+static UInt genericg_compute_checksum_4al ( HWord first_w32, HWord n_w32s )
{
- 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 sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ /* unrolled */
+ while (n_w32s >= 4) {
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;
+ p += 4;
+ n_w32s -= 4;
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;
+ while (n_w32s >= 1) {
+ UInt w;
+ w = p[0]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ p += 1;
+ n_w32s -= 1;
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;
}
-__attribute((regparm(2)))
-static UInt genericg_compute_checksum_4al_4plus ( HWord addr, HWord len )
+/* Specialised versions of the above function */
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_1 ( HWord first_w32 )
{
- 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--;
- }
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ UInt w;
+ w = p[0]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
return sum1 + sum2;
}
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_2 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ UInt w;
+ w = p[0]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[1]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_3 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ UInt w;
+ w = p[0]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[1]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[2]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_4 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ 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;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_5 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ 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;
+ sum1 ^= sum2;
+ w = p[4]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_6 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ 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;
+ sum1 ^= sum2;
+ w = p[4]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[5]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_7 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ 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;
+ sum1 ^= sum2;
+ w = p[4]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[5]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[6]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_8 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ 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;
+ sum1 ^= sum2;
+ w = p[4]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[5]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[6]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[7]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_9 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ 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;
+ sum1 ^= sum2;
+ w = p[4]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[5]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[6]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[7]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[8]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_10 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ 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;
+ sum1 ^= sum2;
+ w = p[4]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[5]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[6]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[7]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[8]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[9]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_11 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ 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;
+ sum1 ^= sum2;
+ w = p[4]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[5]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[6]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[7]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[8]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[9]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[10]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
+__attribute__((regparm(1)))
+static UInt genericg_compute_checksum_4al_12 ( HWord first_w32 )
+{
+ UInt sum1 = 0, sum2 = 0;
+ UInt* p = (UInt*)first_w32;
+ 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;
+ sum1 ^= sum2;
+ w = p[4]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[5]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[6]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[7]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ w = p[8]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[9]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[10]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ w = p[11]; sum1 = ROL32(sum1 ^ w, 31); sum2 += w;
+ sum1 ^= sum2;
+ return sum1 + sum2;
+}
+
/*--------------------------------------------------------------------*/
/*--- end guest_generic_bb_to_IR.c ---*/
/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2010-02-18 15:54:55
|
Author: tom
Date: 2010-02-18 15:54:45 +0000 (Thu, 18 Feb 2010)
New Revision: 11050
Log:
Fix up a few issues with OSS ioctls. Fixes #227325.
Modified:
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/include/vki/vki-linux.h
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2010-02-17 16:20:04 UTC (rev 11049)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2010-02-18 15:54:45 UTC (rev 11050)
@@ -4035,6 +4035,7 @@
case VKI_SNDCTL_SEQ_NRSYNTHS:
case VKI_SNDCTL_SEQ_NRMIDIS:
case VKI_SNDCTL_SEQ_GETTIME:
+ case VKI_SNDCTL_DSP_GETBLKSIZE:
case VKI_SNDCTL_DSP_GETFMTS:
case VKI_SNDCTL_DSP_GETTRIGGER:
case VKI_SNDCTL_DSP_GETODELAY:
@@ -4043,9 +4044,6 @@
case VKI_SOUND_PCM_READ_RATE:
case VKI_SOUND_PCM_READ_CHANNELS:
case VKI_SOUND_PCM_READ_BITS:
-#if !defined(VGA_ppc32) && !defined(VGA_ppc64)
- case (VKI_SOUND_PCM_READ_BITS|0x40000000): /* what the fuck ? */
-#endif
case VKI_SOUND_PCM_READ_FILTER:
PRE_MEM_WRITE( "ioctl(SNDCTL_XXX|SOUND_XXX (SIOR, int))",
ARG3, sizeof(int));
@@ -4053,11 +4051,11 @@
case VKI_SNDCTL_SEQ_CTRLRATE:
case VKI_SNDCTL_DSP_SPEED:
case VKI_SNDCTL_DSP_STEREO:
- case VKI_SNDCTL_DSP_GETBLKSIZE:
case VKI_SNDCTL_DSP_CHANNELS:
case VKI_SOUND_PCM_WRITE_FILTER:
case VKI_SNDCTL_DSP_SUBDIVIDE:
case VKI_SNDCTL_DSP_SETFRAGMENT:
+ case VKI_SNDCTL_DSP_SETFMT:
case VKI_SNDCTL_DSP_GETCHANNELMASK:
case VKI_SNDCTL_DSP_BIND_CHANNEL:
case VKI_SNDCTL_TMR_TIMEBASE:
@@ -5006,7 +5004,9 @@
case VKI_SNDCTL_SEQ_NRSYNTHS:
case VKI_SNDCTL_SEQ_NRMIDIS:
case VKI_SNDCTL_SEQ_GETTIME:
+ case VKI_SNDCTL_DSP_GETBLKSIZE:
case VKI_SNDCTL_DSP_GETFMTS:
+ case VKI_SNDCTL_DSP_SETFMT:
case VKI_SNDCTL_DSP_GETTRIGGER:
case VKI_SNDCTL_DSP_GETODELAY:
case VKI_SNDCTL_DSP_GETSPDIF:
@@ -5014,16 +5014,12 @@
case VKI_SOUND_PCM_READ_RATE:
case VKI_SOUND_PCM_READ_CHANNELS:
case VKI_SOUND_PCM_READ_BITS:
-#if !defined(VGA_ppc32) && !defined(VGA_ppc64)
- case (VKI_SOUND_PCM_READ_BITS|0x40000000): /* what the fuck ? */
-#endif
case VKI_SOUND_PCM_READ_FILTER:
POST_MEM_WRITE(ARG3, sizeof(int));
break;
case VKI_SNDCTL_SEQ_CTRLRATE:
case VKI_SNDCTL_DSP_SPEED:
case VKI_SNDCTL_DSP_STEREO:
- case VKI_SNDCTL_DSP_GETBLKSIZE:
case VKI_SNDCTL_DSP_CHANNELS:
case VKI_SOUND_PCM_WRITE_FILTER:
case VKI_SNDCTL_DSP_SUBDIVIDE:
Modified: trunk/include/vki/vki-linux.h
===================================================================
--- trunk/include/vki/vki-linux.h 2010-02-17 16:20:04 UTC (rev 11049)
+++ trunk/include/vki/vki-linux.h 2010-02-18 15:54:45 UTC (rev 11050)
@@ -1868,6 +1868,7 @@
#define VKI_SNDCTL_DSP_SETFRAGMENT _VKI_SIOWR('P',10, int)
#define VKI_SNDCTL_DSP_GETFMTS _VKI_SIOR ('P',11, int) /* Returns a mask */
+#define VKI_SNDCTL_DSP_SETFMT _VKI_SIOWR('P', 5, int) /* Selects ONE fmt */
typedef struct vki_audio_buf_info {
int fragments; /* # of available fragments (partially usend ones not counted) */
|
|
From: Konstantin S. <kon...@gm...> - 2010-02-18 09:32:00
|
Hi, Some of you have probably seen this already: http://cacm.acm.org/magazines/2010/2/69354-a-few-billion-lines-of-code-later/fulltext/ I've got real pleasure from reading it. Even though the article is about a static analysis tool, most of it applies to dynamic tools as well. I wonder if valgrind folks would be willing to write something like this about memcheck or other tools? --kcc |
|
From: Bart V. A. <bar...@gm...> - 2010-02-18 08:48:23
|
Nightly build on cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) Started at 2010-02-18 02:25:38 EST Ended at 2010-02-18 03:48:07 EST 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 == 449 tests, 43 stderr failures, 10 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/linux/timerfd-syscall (stdout) memcheck/tests/linux-syscalls-2007 (stderr) memcheck/tests/origin5-bz2 (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 (stdout) 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...> - 2010-02-18 03:36:20
|
Nightly build on mg ( x86_64, Fedora 9 ) Started at 2010-02-18 03:10:07 GMT Ended at 2010-02-18 03:36:06 GMT 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 == 538 tests, 1 stderr failure, 0 stdout failures, 0 post failures == helgrind/tests/tc06_two_races_xml (stderr) |