Skip to content

Commit

Permalink
Init result.h for 32-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryHRich committed Nov 24, 2024
1 parent edb114a commit f826bf9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jsrc/ab.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ B jtbitwisecharamp(J jt,UC*t,I n,UC*wv,UC*zv){UC i,j,s[256];
ado AH2A(1,2*(256/SZI)+0,AV(ds(CALP)),&p,s,jt); if(memcmpne(s,t,256L))R 0; // see if the table we are given exactly matches the function we inferred. If not, abort
ado AH2A(1,2*((n+SZI-1)>>LGSZI)+0,wv,&p,zv,jt); // if we found the function, apply it wordwise, overwriting result
R 1;
}
} // scaf this isn't worth the test since the user could have just bitwise


static AHDRRFN* bwinsC[16]={(AHDRRFN*)bw0000insC,(AHDRRFN*)bw0001insC,(AHDRRFN*)bw0010insC,(AHDRRFN*)bw0011insC, (AHDRRFN*)bw0100insC,(AHDRRFN*)bw0101insC,(AHDRRFN*)bw0110insC,(AHDRRFN*)bw0111insC,
Expand Down
4 changes: 2 additions & 2 deletions jsrc/cu.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ static DF1(jtunderai1){A fs=FAV(self)->fgh[0]; A x,y,z;B b;I j,n,*u,*v;UC f[256]
dfv1(x,iota(v2(128L, 2L)),fs); b=x&&256==AN(x)&&NUMERIC&AT(x); // try f i. 128 2; does it return 256 numbers?
if(b){dfv1(y,iota(v2( 8L,32L)),fs); b=y&&256==AN(y)&&NUMERIC&AT(y);} // if so, try f i. 8 32; does it return 256 numbers?
if(b){x=vi(x); y=vi(y); b=x&&y;} // verify both results integer, set b if so
if(b){u=AV(x); v=AV(y); DO(256, j=*u++; if(j==*v++&&BETWEENO(j,-255,256))f[i]=(UC)(j&255); else{b=0; break;});} // verify both results the same & in bounds
if(b){u=AV(x); v=AV(y); DO(256, j=*u++; if(j==*v++&&BETWEENO(j,-256,256))f[i]=(UC)(j&255); else{b=0; break;});} // verify both results the same & in bounds
if(jt->jerr)RESETERR;
}
if(!b)R from(dfv1(z,indexof(ds(CALP),w),fs),ds(CALP)); // if not boolean-like result or not literal, revert to long way
n=AN(w);
I zr=AR(w); GATV(z,LIT,n,AR(w),AS(w)); zv=UAVn(zr,z); wv=UAV(w); // allocate result
if(!bitwisecharamp(f,n,wv,zv))DQ(n, *zv++=f[*wv++];); // if f is a known logic function, do it wordwise; otherwise do it here, bytewise
RETF(z);
} /* f&.(a.&i.) w */
} /* f&.(a.&i.) w */ // scaf remove charamp

// structural under, i. e. u&.v when v is a special noninvertible form that we recognize. Currently only , and m&{ are recognized
static DF1(jtsunder){F1PREFIP;PROLOG(777);
Expand Down
2 changes: 2 additions & 0 deletions jsrc/result.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ do{
#if PYXES
// If the returned result is a pyx, we can't look into it to get its type/len. We could see if the pyx has been resolved, but we don't
if(likely((diff=(AT(z)&PYX))==0)) // if the result is a pyx, which can't be inspected, set diff to non0 (which makes the item count invalid) and skip the shape test
#else
diff=0; // if no pyxes, init to no change
#endif
{ // this brace may be part of the previous line!
// not a pyx - we can count the items
Expand Down

0 comments on commit f826bf9

Please sign in to comment.