Skip to content

Commit

Permalink
Version to beta-25
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryHRich committed Nov 23, 2024
1 parent e62eafe commit 98109ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions jsrc/ab.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ DF2(jtbitwisechar){A fs=FAV(self)->fgh[0]; A gs=FAV(self)->fgh[1]; A p,z;I b;I j
B jtbitwisecharamp(J jt,UC*t,I n,UC*wv,UC*zv){UC i,j,s[256];
if(n==0)R 1; // Can't handle empty
i=t[0]; j=t[255]; // by spot-checking a few spots, see if the table might represent AND, ], OR, XOR, NAND
I p=i; AHDR2FN* ado=0; // init the inferred char-arg p, and the inferred function
p=i==0?j:p; ado=i==0?(AHDR2FN*)bw0001II:ado; p=i==255?j:p; ado=i==255?(AHDR2FN*)bw1011II:ado;
ado=i==j?(AHDR2FN*)bw0011II:ado; ado=j==255?(AHDR2FN*)bw0111II:ado; ado=j==255-i?(AHDR2FN*)bw0110II:ado; ado=j==0?(AHDR2FN*)bw0010II:ado; // make the inference
AHDR2FN* ado=0; // init the inferred char-arg p, and the inferred function
ado=i==255?(AHDR2FN*)bw1011II:ado; I p=j; ado=j==0?(AHDR2FN*)bw0010II:ado; p=j==0?i:p; ado=j==255-i?(AHDR2FN*)bw0110II:ado; p=j==255-i?i:p;
ado=j==255?(AHDR2FN*)bw0111II:ado; p=j==255?i:p; ado=i==j?(AHDR2FN*)bw0011II:ado; p=i==j?i:p; ado=i==0?(AHDR2FN*)bw0001II:ado; p=i==0?j:p; // make the inference
// obsolete if (i==0 ){c=j; ado=(AHDR2FN*)bw0001II;}
// obsolete else if(j==i ){c=i; ado=(AHDR2FN*)bw0011II;}
// obsolete else if(j==255 ){c=i; ado=(AHDR2FN*)bw0111II;}
Expand All @@ -223,7 +223,7 @@ B jtbitwisecharamp(J jt,UC*t,I n,UC*wv,UC*zv){UC i,j,s[256];
p=(p<<BB)|p; p=(p<<(2*BB))|p; p=(p<<((SZI/2)*BB))|p; // replicate character to word-width
// obsolete pv=(UC*)&p; DO(SZI, pv[i]=c;); // scaf slow
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
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;
}

Expand Down
16 changes: 8 additions & 8 deletions jsrc/cu.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,17 @@ static DF2(jtunderh20){R jtrank2ex0(jt,a,w,self,jtunderh2);} // pass inplaceabi

static DF1(jtunderai1){A fs=FAV(self)->fgh[0]; A x,y,z;B b;I j,n,*u,*v;UC f[256],*wv,*zv;
ARGCHK1(w);
if(b=LIT&AT(w)&&256<AN(w)){ // long w. run on all bytecodes, as i. 128 2 and i. 8 32
dfv1(x,iota(v2(128L, 2L)),fs); b=x&&256==AN(x)&&NUMERIC&AT(x);
if(b){dfv1(y,iota(v2( 8L,32L)),fs); b=y&&256==AN(y)&&NUMERIC&AT(y);}
if(b){x=vi(x); y=vi(y); b=x&&y;}
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(b=LIT&AT(w)&&256<AN(w)){ // b=long literal w. run on all bytecodes, as i. 128 2 and i. 8 32
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(jt->jerr)RESETERR;
}
if(!b)R from(dfv1(z,indexof(ds(CALP),w),fs),ds(CALP));
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);
if(!bitwisecharamp(f,n,wv,zv))DQ(n, *zv++=f[*wv++];);
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 */

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// set version info for github build
// a new distribution is made when the version is updated
#define jversion "9.6.0-beta24"
#define jversion "9.6.0-beta25"

0 comments on commit 98109ae

Please sign in to comment.