Changeset: c847cd226a6e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c847cd226a6e Modified Files: Branch: default Log Message:
merged undo of changeset 36471:3573f0c1b6d5 from Jun2010 diffs (truncated from 1132 to 300 lines): diff -r 9f6b5a106ed9 -r c847cd226a6e MonetDB5/src/modules/kernel/aggr_be_avg.mx --- a/MonetDB5/src/modules/kernel/aggr_be_avg.mx Thu Jul 01 20:09:29 2010 +0200 +++ b/MonetDB5/src/modules/kernel/aggr_be_avg.mx Thu Jul 01 20:13:45 2010 +0200 @@ -48,7 +48,7 @@ @1: 0 1 0 0 use sums-array? @2: 0 0 0 1 do BATprepareHash? @3: BUNfndVOID CHKrange SCANfndOID HASHfnd_oid lookup - @4: (oid)(bnhsb+p) bnh[p]-min bnh[p]-min bnh[p]-min e/bn-head-access + @4: var loc loc loc e/bn-head-access @5: "BUNhloc(b,p)" for (oid) b-head-type, b-head access "&bhsb; bhsb++" for (void) b-head-type @@ -133,20 +133,9 @@ if (@1) { if (sums) { /* sums in sums-array */ - int bn_use = USE_TAIL; - ssize_t bnhsb = 0; - oid *bnh = 0; - if (BAThdense(bn)) { - bnhsb = (ssize_t) bn->hseqbase - BUNfirst(bn) - min; - (void) bnh; - } else { - (void) bnhsb; - bnh = (oid*)Hloc(bn,0); - bn_use |= USE_HEAD; - } - BATaccessBegin(bn,bn_use,MMAP_SEQUENTIAL); + BATaccessBegin(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL); BATloop(bn, p, q) { - oid h = @4; + oid h = (*(oid*) b...@4(bni,p)) - min; dbl *dst = (dbl*) b...@7(bni, p); if (cnt[h] == 0 || sums[h] == dbl_nil) { *dst = dbl_nil; @@ -154,7 +143,7 @@ *dst = (dbl) (sums[h]/cnt[h]); } } - BATaccessEnd(bn,bn_use,MMAP_SEQUENTIAL); + BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL); GDKfree(sums); } } else { @@ -226,41 +215,41 @@ if (BAThdense(e)) { /* void lookup */ if (BAThdense(b)) { - @:aggrX3_avg(0,0,BUNfndVOID,(oid)(bnhsb+p),&bhsb;bhsb++,@1,@2,b...@2(bni,r),r-off)@ + @:aggrX3_avg(0,0,BUNfndVOID,var,&bhsb;bhsb++,@1,@2,b...@2(bni,r),r-off)@ } else { - @:aggrX3_avg(0,0,BUNfndVOID,(oid)(bnhsb+p),BUNhloc(bi,p),@1,@2,b...@2(bni,r),r-off)@ + @:aggrX3_avg(0,0,BUNfndVOID,var,BUNhloc(bi,p),@1,@2,b...@2(bni,r),r-off)@ } /* e->htype == TYPE_oid */ } else if (range <= SMALL_AGGR_MAX) { /* array lookup */ slots = range; if (BAThdense(b)) { - @:aggrX3_avg(1,0,CHKrange,bnh[p]-min,&bhsb;bhsb++,@1,@2,&sums[(*(oid*)h)-min],(*(oid*)h)-min)@ + @:aggrX3_avg(1,0,CHKrange,loc,&bhsb;bhsb++,@1,@2,&sums[(*(oid*)h)-min],(*(oid*)h)-min)@ } else { - @:aggrX3_avg(1,0,CHKrange,bnh[p]-min,BUNhloc(bi,p),@1,@2,&sums[(*(oid*)h)-min],(*(oid*)h)-min)@ + @:aggrX3_avg(1,0,CHKrange,loc,BUNhloc(bi,p),@1,@2,&sums[(*(oid*)h)-min],(*(oid*)h)-min)@ } } else if (BATcount(e) <= SCAN_AGGR_MAX) { /* scan lookup */ SCAN_aggr_init; if (BAThdense(b)) { - @:aggrX3_avg(0,0,SCANfndOID,bnh[p]-min,&bhsb;bhsb++,@1,@2,b...@2(bni,r),r-off)@ + @:aggrX3_avg(0,0,SCANfndOID,loc,&bhsb;bhsb++,@1,@2,b...@2(bni,r),r-off)@ } else { - @:aggrX3_avg(0,0,SCANfndOID,bnh[p]-min,BUNhloc(bi,p),@1,@2,b...@2(bni,r),r-off)@ + @:aggrX3_avg(0,0,SCANfndOID,loc,BUNhloc(bi,p),@1,@2,b...@2(bni,r),r-off)@ } } else if (BAThordered(e)&1) { /* merge lookup */ MERGE_aggr_init; if (BAThdense(b)) { - @:aggrX3_avg(0,0,MERGEfndOID,bnh[p]-min,&bhsb;bhsb++,@1,@2,b...@2(bni,r),r-off)@ + @:aggrX3_avg(0,0,MERGEfndOID,loc,&bhsb;bhsb++,@1,@2,b...@2(bni,r),r-off)@ } else { - @:aggrX3_avg(0,0,MERGEfndOID,bnh[p]-min,BUNhloc(bi,p),@1,@2,b...@2(bni,r),r-off)@ + @:aggrX3_avg(0,0,MERGEfndOID,loc,BUNhloc(bi,p),@1,@2,b...@2(bni,r),r-off)@ } } else { /* hash lookup */ if (BAThdense(b)) { - @:aggrX3_avg(0,1,HASHfnd_oid,bnh[p]-min,&bhsb;bhsb++,@1,@2,b...@2(bni,r),r-off)@ + @:aggrX3_avg(0,1,HASHfnd_oid,loc,&bhsb;bhsb++,@1,@2,b...@2(bni,r),r-off)@ } else { - @:aggrX3_avg(0,1,HASHfnd_oid,bnh[p]-min,BUNhloc(bi,p),@1,@2,b...@2(bni,r),r-off)@ + @:aggrX3_avg(0,1,HASHfnd_oid,loc,BUNhloc(bi,p),@1,@2,b...@2(bni,r),r-off)@ } } diff -r 9f6b5a106ed9 -r c847cd226a6e MonetDB5/src/modules/kernel/aggr_be_count.mx --- a/MonetDB5/src/modules/kernel/aggr_be_count.mx Thu Jul 01 20:09:29 2010 +0200 +++ b/MonetDB5/src/modules/kernel/aggr_be_count.mx Thu Jul 01 20:13:45 2010 +0200 @@ -48,7 +48,7 @@ @1: 0 1 0 0 use cnt-array? @2: 0 0 0 1 do BATprepareHash? @3: BUNfndVOID CHKrange SCANfndOID HASHfnd_oid lookup - @4: (oid)(bnhsb+p) bnh[p]-min bnh[p]-min bnh[p]-min e/bn-head-access + @4: var loc loc loc e/bn-head-access @5: "BUNhloc(b,p)" for (oid) b-head-type, b-head access "&bhsb; bhsb++" for (void) b-head-type @@ -127,23 +127,12 @@ } if (@1 && cnt) { /* copy cnt array to final result */ - int bn_use = USE_TAIL; - ssize_t bnhsb = 0; - oid *bnh = 0; - if (BAThdense(bn)) { - bnhsb = (ssize_t) bn->hseqbase - BUNfirst(bn) - min; - (void) bnh; - } else { - (void) bnhsb; - bnh = (oid*)Hloc(bn,0); - bn_use |= USE_HEAD; - } - BATaccessBegin(bn,bn_use,MMAP_SEQUENTIAL); + BATaccessBegin(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL); BATloop(bn, p, q) { - oid h = @4; + oid h = (*(oid*) b...@4(bni,p)) - min; *(wrd*)BUNtloc(bni, p) = cnt[h]; } - BATaccessEnd(bn,bn_use,MMAP_SEQUENTIAL); + BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL); GDKfree(cnt); } @c @@ -223,40 +212,40 @@ if (BAThdense(e)) { /* void lookup */ if (BAThdense(b)) { - @:aggrX3_count(0,0,BUNfndVOID,(oid)(bnhsb+p),&bhsb;bhsb++,BUNtloc(bni,r))@ + @:aggrX3_count(0,0,BUNfndVOID,var,&bhsb;bhsb++,BUNtloc(bni,r))@ } else { - @:aggrX3_count(0,0,BUNfndVOID,(oid)(bnhsb+p),BUNhloc(bi,p),BUNtloc(bni,r))@ + @:aggrX3_count(0,0,BUNfndVOID,var,BUNhloc(bi,p),BUNtloc(bni,r))@ } /* e->htype == TYPE_oid */ } else if (range <= SMALL_AGGR_MAX) { /* array lookup */ if (BAThdense(b)) { - @:aggrX3_count(1,0,CHKrange,bnh[p]-min,&bhsb;bhsb++,&cnt[(*(oid*)h)-min])@ + @:aggrX3_count(1,0,CHKrange,loc,&bhsb;bhsb++,&cnt[(*(oid*)h)-min])@ } else { - @:aggrX3_count(1,0,CHKrange,bnh[p]-min,BUNhloc(bi,p),&cnt[(*(oid*)h)-min])@ + @:aggrX3_count(1,0,CHKrange,loc,BUNhloc(bi,p),&cnt[(*(oid*)h)-min])@ } } else if (BATcount(e) <= SCAN_AGGR_MAX) { /* scan lookup */ SCAN_aggr_init; if (BAThdense(b)) { - @:aggrX3_count(0,0,SCANfndOID,bnh[p]-min,&bhsb;bhsb++,BUNtloc(bni,r))@ + @:aggrX3_count(0,0,SCANfndOID,loc,&bhsb;bhsb++,BUNtloc(bni,r))@ } else { - @:aggrX3_count(0,0,SCANfndOID,bnh[p]-min,BUNhloc(bi,p),BUNtloc(bni,r))@ + @:aggrX3_count(0,0,SCANfndOID,loc,BUNhloc(bi,p),BUNtloc(bni,r))@ } } else if (BAThordered(e)&1) { /* merge lookup */ MERGE_aggr_init; if (BAThdense(b)) { - @:aggrX3_count(0,0,MERGEfndOID,bnh[p]-min,&bhsb;bhsb++,BUNtloc(bni,r))@ + @:aggrX3_count(0,0,MERGEfndOID,loc,&bhsb;bhsb++,BUNtloc(bni,r))@ } else { - @:aggrX3_count(0,0,MERGEfndOID,bnh[p]-min,BUNhloc(bi,p),BUNtloc(bni,r))@ + @:aggrX3_count(0,0,MERGEfndOID,loc,BUNhloc(bi,p),BUNtloc(bni,r))@ } } else { /* hash lookup */ if (BAThdense(b)) { - @:aggrX3_count(0,1,HASHfnd_oid,bnh[p]-min,&bhsb;bhsb++,BUNtloc(bni,r))@ + @:aggrX3_count(0,1,HASHfnd_oid,loc,&bhsb;bhsb++,BUNtloc(bni,r))@ } else { - @:aggrX3_count(0,1,HASHfnd_oid,bnh[p]-min,BUNhloc(bi,p),BUNtloc(bni,r))@ + @:aggrX3_count(0,1,HASHfnd_oid,loc,BUNhloc(bi,p),BUNtloc(bni,r))@ } } diff -r 9f6b5a106ed9 -r c847cd226a6e MonetDB5/src/modules/kernel/aggr_be_minmax.mx --- a/MonetDB5/src/modules/kernel/aggr_be_minmax.mx Thu Jul 01 20:09:29 2010 +0200 +++ b/MonetDB5/src/modules/kernel/aggr_be_minmax.mx Thu Jul 01 20:13:45 2010 +0200 @@ -48,7 +48,7 @@ @1: </> </> </> </> compare operator: <(min) or >(max) @2: 0 0 0 1 do BATprepareHash? @3: BUNfndVOID CHKrange SCANfndOID HASHfnd_oid lookup - @4: (oid)(bnhsb+r) bnh[r]-min bnh[r]-min bnh[r]-min e/bn-head-access + @4: var loc loc loc e/bn-head-access @5: "BUNhloc(b,p)" for (oid) b-head-type, b-head access "&bhsb; bhsb++" for (void) b-head-type @@ -57,7 +57,7 @@ @7: "loc" for fixsized b/bn-tail-type, b/bn-tail-access "var" for varsized b/bn-tail-type - @8: r-off (*(oid*)h)-min index in extremes array + @8: r-off (*(oid*)h)-min index in extremes array @9: max/min initial result value */ @= aggrX3_minmax_ptr @@ -111,27 +111,16 @@ } if (b_use) BATaccessEnd(b,b_use,MMAP_SEQUENTIAL); -{ /* insert the extreme values into the result */ - int bn_use = USE_TAIL; - ssize_t bnhsb = 0; - oid *bnh = 0; - if (BAThdense(bn)) { - bnhsb = (ssize_t) bn->hseqbase - BUNfirst(bn) - min; - (void) bnh; - } else { - (void) bnhsb; - bnh = (oid*)Hloc(bn,0); - bn_use |= USE_HEAD; - } - BATaccessBegin(bn,bn_use,MMAP_SEQUENTIAL); + BATaccessBegin(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL); BATloop(bn, r, q) { - ptr val = extrem...@4]; + oid *h = (oid*)b...@4(bni,r); + ptr val = extrem...@8]; + (void) h; /* silence compiler about unused variable */ /* trick: using a void head-type, only the tail are (over)written */ ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), val?val:nil); } - BATaccessEnd(bn,bn_use,MMAP_SEQUENTIAL); -} + BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL); @c /* aggrX3_minmax_oid e-void-head e-oid-head e-oid-head e-oid-head @@ -140,7 +129,7 @@ @1: </> </> </> </> compare operator: <(min) or >(max) @2: 0 0 0 1 do BATprepareHash? @3: BUNfndVOID CHKrange SCANfndOID HASHfnd_oid lookup - @4: (oid)(bnhsb+r) bnh[r]-min bnh[r]-min bnh[r]-min e/bn-head-access + @4: var loc loc loc e/bn-head-access @5: "BUNhloc(b,p)" for (oid) b-head-type, b-head access "&bhsb; bhsb++" for (void) b-head-type @@ -149,7 +138,7 @@ @7: "loc" for fixsized b/bn-tail-type, b/bn-tail-access "var" for varsized b/bn-tail-type - @8: r-off (*(oid*)h)-min index in extremes array + @8: r-off (*(oid*)h)-min index in extremes array @9: max/min initial result value */ @= aggrX3_minmax_oid @@ -213,28 +202,16 @@ } if (b_use) BATaccessEnd(b,b_use,MMAP_SEQUENTIAL); -{ /* insert the extreme values into the result */ - int bn_use = USE_TAIL; - ssize_t bnhsb = 0; - oid *bnh = 0; - if (BAThdense(bn)) { - bnhsb = (ssize_t) bn->hseqbase - BUNfirst(bn) - min; - (void) bnh; - } else { - (void) bnhsb; - bnh = (oid*)Hloc(bn,0); - bn_use |= USE_HEAD; - } - BATaccessBegin(bn,bn_use,MMAP_SEQUENTIAL); + BATaccessBegin(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL); BATloop(bn, r, q) { - oid h = @4; - oid val = hit[h] ? extremes[h] : *(oid*)nil; + oid *h = (oid*)b...@4(bni,r); + oid val = h...@8] ? extrem...@8] : *(oid*)nil; + (void) h; /* silence compiler about unused variable */ /* trick: using a void head-type, only the tail are (over)written */ ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), &val); } - BATaccessEnd(bn,bn_use,MMAP_SEQUENTIAL); -} + BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL); @c /* extreme_typed @@ -295,41 +272,41 @@ if (BAThdense(e)) { /* void lookup */ if (BAThdense(b)) { - @:aggrx3_minm...@5(@2,0,BUNfndVOID,(oid)(bnhsb+r),&bhsb; bhsb++,@3,@4,r-off,@6)@ + @:aggrx3_minm...@5(@2,0,BUNfndVOID,var,&bhsb; bhsb++,@3,@4,r-off,@6)@ } else { - @:aggrx3_minm...@5(@2,0,BUNfndVOID,(oid)(bnhsb+r),BUNhloc(bi,p),@3,@4,r-off,@6)@ _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list