diff --git a/jsrc/j.h b/jsrc/j.h index c7348f858..934239833 100644 --- a/jsrc/j.h +++ b/jsrc/j.h @@ -1960,7 +1960,7 @@ static inline __attribute__((__always_inline__)) float64x2_t vec_and_pd(float64x #define PRISTXFER(z,w) AFLAGORLOCAL(z,PRISTFROMW(w)) PRISTCOMMON(w) // transfer pristinity of w to z, destroying w #define PRISTXFERF(z,w) AFLAGORLOCAL(z,PRISTFROMW(w)) PRISTCLRF(w) // use w bit of jtinplace -#define PRISTXFERAF(z,a) AFLAGORLOCAL(z,PRISTFROMA(w)) PRISTCLRF(a) // use a bit of jtinplace +#define PRISTXFERAF(z,a) AFLAGORLOCAL(z,PRISTFROMA(a)) PRISTCLRF(a) // use a bit of jtinplace // same, but with an added condition (in bit 0) #define PRISTXFERFIF(z,w,cond)AFLAGORLOCAL(z,AFLAG(w)&(((cond)&SGNTO0(AC(w))&((I)jtinplace>>JTINPLACEWX))<1+wr))RCA(a); // if w's rank is smaller than that of a cell of a, nothing can be removed, return a if(unlikely(MIN(ai,wi)==0)&&(ar!=0))RCA(a); // if either arg has no items, there's nothing to remove, return a, unless atom must become a list - if(ar==wr+1){ // is just 1 cell of y? + if((ar^1)+wr==0){ // taking a single atom from a list? +// if # y speedup if(ar==wr+1){ // is just 1 cell of y? // if y has rank 1 less than x, execute as ((x ~: y) # x) if y is atomic or ((x ~.@-:"yr) # x) if y is an array. Inplace x. Use IRS and leave comparison tolerance as set J jtipx=(J)(((I)jtinplace&~(JTINPLACEA+JTINPLACEW))+(((I)jtinplace>>1)&JTINPLACEW)); // move input inplace-x flag to inplace-w - if(wr==0){RZ(x=jtrepeat(jtipx,ne(a,w),a)) // ((x ~: y) # x), inplaceable on the # + RZ(x=jtrepeat(jtipx,ne(a,w),a)) // ((x ~: y) # x), inplaceable on the # +#if 0 // until x # y has a fast-copy for strings of 1s this isn't so fast + if(wr==0){ }else{IRS2(a,w,0,wr,wr,jtnotmatch,x); RZ(x=jtrepeat(jtipx,x,a)) // ((x ~.@-:"yr) # x), inplaceable on the # } +#endif }else{ // if w's rank is larger than that of a cell of a, reheader w to look like a list of such cells if(unlikely((-wr&-(r^wr))<0)){RZ(x=virtual(w,0,r)); AN(x)=wn; s=AS(x); ws=AS(w); k=ar>wr?0:1+wr-r; I s0; PRODX(s0,k,ws,1) s[0]=s0; MCISH(1+s,k+ws,r-1);} // use fauxvirtual here @@ -1287,7 +1291,7 @@ DF2(jtintersect){A x=w;I ar,at,k,r,*s,wr,*ws; POPCCT RZ(x); // obsolete PRISTXFERAF(x,a) - if(unlikely(at&BOX)){PRISTCLRF(a) PRISTCLRF(w)} // result is non-pristine, and both a and w also + if(unlikely(at&BOX))PRISTXFERAF(x,a) // the boxes in w cannot get to the result, even though their values participate; so pristinity depends entirely on a RETF(x); } diff --git a/jsrc/vrep.c b/jsrc/vrep.c index f8d0cfa2d..035639540 100644 --- a/jsrc/vrep.c +++ b/jsrc/vrep.c @@ -123,6 +123,7 @@ static REPF(jtrepbdx){A z;I c,k,m,p; I bitstack; // the bits packed together if(n>=2*BSIZE){ // n>=64, bitpipe0 has the bits to process (and if n>=128 bitpipe1 is in flight). + // scaf if all 64 bits are 1s, copy full cachelines to the output. They will be misaligned, alas bitstack=(I)(UI4)_mm256_movemask_epi8(_mm256_cmpeq_epi8(bitpipe00,i1)) |((I)(UI4)_mm256_movemask_epi8(_mm256_cmpeq_epi8(bitpipe01,i1))< ckprist 0 1 1 ] 5 NB. scaf ~. ckprist 0 1 0 0 ] 5 ~. ckprist 0 1 0 0 ] 4 5 '<"0 i. 3' -. ckprist 0 1 2 0 ] 5 -'<"0 i. 3' ([-.-.) ckprist 0 0 ] 5 +'<"0 i. 3' ([-.-.) ckprist (0 , IF64 , 2 0) ] 5 NB. In 32-bit ([-.-.) is not recognized as a compound and it is not seen that a is marked inplaceable for the rightmost -. but it can't get its result to the final output |. ckprist 0 1 0 0 ] 5 |.!.a: ckprist 0 0 0 0 ] 5 '3' |. ckprist 0 1 0 0 ] 5