Skip to content

Commit

Permalink
9!:65 enable/disable boxed sparse
Browse files Browse the repository at this point in the history
  • Loading branch information
bilam committed Nov 17, 2024
1 parent d0f8191 commit 10cf9f8
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 37 deletions.
5 changes: 5 additions & 0 deletions jsrc/cu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#include "j.h"
#include "ve.h"

#ifdef BOXEDSPARSE
extern UC fboxedsparse;
#endif

static A jteverysp(J jt,A w,A fs){A*wv,x,z,*zv;P*wp,*zp;
ARGCHK1(w);
Expand Down Expand Up @@ -124,6 +127,8 @@ A jtevery(J jt, A w, A fs){A * RESTRICT wv,x,z,* RESTRICT zv;
}
#ifndef BOXEDSPARSE
ASSERT(!ISSPARSE(AT(x)),EVNONCE);
#else
ASSERT(fboxedsparse||!ISSPARSE(AT(x)),EVNONCE);
#endif
// Store result & advance to next cell
*zv++=x;
Expand Down
3 changes: 3 additions & 0 deletions jsrc/j.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ uint64_t g_cpuFeatures2; // fsgsbase
int numberOfCores; // number of cpu cores
UC hwaes=0; // hardware aes support
UC hwfma=0; // blis cpu tuning
#ifdef BOXEDSPARSE
UC fboxedsparse=1; // enable boxed sparse
#endif
I fortesting=0; // used for measurements
// globals end

Expand Down
1 change: 1 addition & 0 deletions jsrc/je.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extern F1(jtbehead);
extern F1(jtbinrep1);
// extern F1(jtbitadv);
extern F1(jtbox);
extern F1(jtboxedsparse);
extern F1(jtboxopen);
extern F1(jtboxq);
extern F1(jtboxs);
Expand Down
6 changes: 5 additions & 1 deletion jsrc/v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#include "vcomp.h"
#include "ve.h"

#ifdef BOXEDSPARSE
extern UC fboxedsparse;
#endif

#ifdef MMSC_VER
#pragma warning(disable: 4244)
#endif
Expand Down Expand Up @@ -405,7 +409,7 @@ static B jtmatchsub(J jt,A a,A w,B* RESTRICT x,I af,I wf,I m,I n,I b1){C*av,*wv;
if(unlikely(t&FUNC))R (!eqf(a,w))^(x==0?1:b1); // true value, but switch if return is not 'match'
if(unlikely(t&NAME))R (!eqname(a,w))^(x==0?1:b1); // true value, but switch if return is not 'match'
#ifdef BOXEDSPARSE
if(unlikely(ISSPARSE(at|wt)))R num(1)==matchs(a,w);
if(fboxedsparse) if(unlikely(ISSPARSE(at|wt)))R num(1)==matchs(a,w);
#endif
// If the types mismatch, convert as needed to the common (unsafe) type calculated earlier
if(at!=wt) {
Expand Down
10 changes: 9 additions & 1 deletion jsrc/vo.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#define ZZDEFN
#include "result.h"

#ifdef BOXEDSPARSE
extern UC fboxedsparse;
#endif

I level(J jt,A w){A*wv;I d,j;
ARGCHK1(w);
if((-AN(w)&-(AT(w)&BOX))>=0)R 0;
Expand All @@ -31,6 +35,8 @@ F1(jtbox){A y,z,*zv;C*wv;I f,k,m,n,r,wr,*ws;
F1PREFIP;ARGCHK1(w);I wt=AT(w); FLAGT waf=AFLAG(w);
#ifndef BOXEDSPARSE
ASSERTF(!ISSPARSE(wt),EVNONCE,"can't box sparse arrays");
#else
ASSERTF(fboxedsparse||!ISSPARSE(wt),EVNONCE,"can't box sparse arrays");
#endif
wr=AR(w); r=(RANKT)jt->ranks; r=wr<r?wr:r; f=wr-r; // no RESETRANK because we call no primitives
if(likely(!f)){
Expand All @@ -54,7 +60,7 @@ F1(jtbox){A y,z,*zv;C*wv;I f,k,m,n,r,wr,*ws;
} else {
// <"r
#ifdef BOXEDSPARSE
ASSERTF(!ISSPARSE(wt),EVNONCE,"can't box sparse arrays"); // <"r not implemented
ASSERTF(fboxedsparse||!ISSPARSE(wt),EVNONCE,"can't box sparse arrays"); // <"r not implemented
#endif
ws=AS(w);
CPROD(AN(w),n,f,ws); CPROD(AN(w),m,r,f+ws);
Expand Down Expand Up @@ -125,6 +131,8 @@ F2PREFIP;ARGCHK2(a,w);
#endif
#ifndef BOXEDSPARSE
ASSERTF(!ISSPARSE(AT(a)|AT(w)),EVNONCE,"can't box sparse arrays");
#else
ASSERTF(fboxedsparse||!ISSPARSE(AT(a)|AT(w)),EVNONCE,"can't box sparse arrays");
#endif
I optype=FAV(self)->localuse.lu1.linkvb; // flag: sign set if (,<) or ,&< or (;<) which will always box w; bit 0 set if (,<)
optype|=((I)jtinplace&JTWILLBEOPENED)<<(BOXX-JTWILLBEOPENEDX); // fold in BOX flag that tells us to allow virtual boxed results
Expand Down
69 changes: 35 additions & 34 deletions jsrc/x.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ void jtforeigninit(J jt){UI i;
MN(4,0) XPRIM(VERB, jtnc, 0, VASGSAFE,VF2NONE,0, RMAX,RMAX);
MN(6,0) XPRIM(VERB, jtts0, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(6,1) XPRIM(VERB, jttss, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(6,14) XPRIM(VERB, jtinttoe, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(6,15) XPRIM(VERB, jtetoint, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(6,14) XPRIM(VERB, jtinttoe, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(6,15) XPRIM(VERB, jtetoint, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(6,16) XPRIM(VERB, jtetoiso8601,jtetoiso8601, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(6,17) XPRIM(VERB, jtiso8601toe,jtiso8601toe, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(6,18) XPRIM(VERB, jtstringtoe,jtstringtoe, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
Expand All @@ -138,10 +138,10 @@ void jtforeigninit(J jt){UI i;
MN(18,5) XPRIM(VERB, jtlocname, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(128,2) XPRIM(VERB, 0, jtapplystr, VFLAGNONE,VF2NONE,RMAX,1, RMAX);
MN(128,5) XPRIM(VERB, jtisnan, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(128,9) XPRIM(VERB, jtmvmsparse, 0, VASGSAFE,VF2WILLOPEN1,RMAX, RMAX,RMAX);
MN(128,9) XPRIM(VERB, jtmvmsparse, 0, VASGSAFE,VF2WILLOPEN1,RMAX, RMAX,RMAX);
MN(128,11) XPRIM(VERB, 0, jtlrtrim, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(128,12) XPRIM(VERB, 0, jtekupdate, VASGSAFE|VJTFLGOK2,VF2WILLOPEN2A,RMAX,RMAX,RMAX);
MN(128,13) XPRIM(VERB, jtfindspr, 0, VASGSAFE|VJTFLGOK2,VF2WILLOPEN2A,RMAX,RMAX,RMAX);
MN(128,12) XPRIM(VERB, 0, jtekupdate, VASGSAFE|VJTFLGOK2,VF2WILLOPEN2A,RMAX,RMAX,RMAX);
MN(128,13) XPRIM(VERB, jtfindspr, 0, VASGSAFE|VJTFLGOK2,VF2WILLOPEN2A,RMAX,RMAX,RMAX);

// infrequently-used fns follow

Expand Down Expand Up @@ -197,15 +197,15 @@ void jtforeigninit(J jt){UI i;
MN(4,3) XPRIM(VERB, jtsnl, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(4,4) XPRIM(VERB, jtscind, 0, VASGSAFE,VF2NONE,0, RMAX,RMAX);
MN(4,5) XPRIM(VERB, jtnch, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(4,6) XPRIM(VERB, jtscriptstring, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(4,7) XPRIM(VERB, jtscriptnum, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(4,6) XPRIM(VERB, jtscriptstring, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(4,7) XPRIM(VERB, jtscriptnum, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(4,8) XPRIM(ADV, jtcreatecachedref,jtvalenceerr, VASGSAFE,VF2NONE,0L, 0L, 0L );
MN(4,55) XPRIM(VERB, jtex, 0, VASGSAFE,VF2NONE,0, RMAX,RMAX);
MN(5,0) XPRIM(ADV, jtfxx,jtvalenceerr, VASGSAFE,VF2NONE,0L, 0L, 0L );
MN(5,1) XPRIM(VERB, jtarx, 0, VASGSAFE,VF2NONE,0, RMAX,RMAX);
MN(5,2) XPRIM(VERB, jtdrx, 0, VASGSAFE,VF2NONE,0, RMAX,RMAX);
MN(5,4) XPRIM(VERB, jttrx, 0, VASGSAFE,VF2NONE,0, RMAX,RMAX);
MN(5,5) XPRIM(VERB, jtlrx1, jtlrx2, VASGSAFE,VF2NONE,0, RMAX,RMAX);
MN(5,5) XPRIM(VERB, jtlrx1, jtlrx2, VASGSAFE,VF2NONE,0, RMAX,RMAX);
MN(5,6) XPRIM(VERB, jtprx, 0, VASGSAFE,VF2NONE,0, RMAX,RMAX);
MN(5,7) XPRIM(VERB, 0, jtxrx, VASGSAFE,VF2NONE,RMAX,0, 0 ); // explicit defn info
MN(6,2) XPRIM(VERB, jttsit1, jttsit2, VFLAGNONE,VF2NONE,1, 0, 1 );
Expand Down Expand Up @@ -256,8 +256,8 @@ void jtforeigninit(J jt){UI i;
MN(9,27) XPRIM(VERB, jtieps, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,28) XPRIM(VERB, jtiepdoq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,29) XPRIM(VERB, jtiepdos, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,32) XPRIM(VERB, jtecmtriesq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,33) XPRIM(VERB, jtecmtriess, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,32) XPRIM(VERB, jtecmtriesq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,33) XPRIM(VERB, jtecmtriess, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,34) XPRIM(VERB, jtassertq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,35) XPRIM(VERB, jtasserts, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,36) XPRIM(VERB, jtoutparmq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
Expand All @@ -274,19 +274,20 @@ void jtforeigninit(J jt){UI i;
MN(9,47) XPRIM(VERB, jtbreakfns, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,52) XPRIM(VERB, jtasgzombq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,53) XPRIM(VERB, jtasgzombs, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,54) XPRIM(VERB, jtdeprecxq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,55) XPRIM(VERB, jtdeprecxs, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,54) XPRIM(VERB, jtdeprecxq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,55) XPRIM(VERB, jtdeprecxs, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
#if MEMHISTO
MN(9,54) XPRIM(VERB, jtmemhistoq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,55) XPRIM(VERB, jtmemhistos, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,62) XPRIM(VERB, jtmemhashq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,63) XPRIM(VERB, jtmemhashs, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,54) XPRIM(VERB, jtmemhistoq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,55) XPRIM(VERB, jtmemhistos, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,62) XPRIM(VERB, jtmemhashq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,63) XPRIM(VERB, jtmemhashs, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
#endif
MN(9,56) XPRIM(VERB, jtcpufeature, jtcpufeature2, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,57) XPRIM(VERB, jtaudittdisab, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,57) XPRIM(VERB, jtaudittdisab, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,58) XPRIM(VERB, jtgemmtune, jtgemmtune2, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,59) XPRIM(VERB, jtemsglevel, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,66) XPRIM(VERB, jtcheckcompfeatures, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,59) XPRIM(VERB, jtemsglevel, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,65) XPRIM(VERB, jtboxedsparse, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,66) XPRIM(VERB, jtcheckcompfeatures, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,0) XPRIM(VERB, jtdbc, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,1) XPRIM(VERB, jtdbstack, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,2) XPRIM(VERB, jtdbstopq, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
Expand All @@ -298,7 +299,7 @@ void jtforeigninit(J jt){UI i;
MN(13,8) XPRIM(VERB, jtdbsig1, jtdbsig2, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,9) XPRIM(VERB, jtdbrr1, jtdbrr2, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,10) XPRIM(VERB, 0,0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX); // still in stdlib
MN(13,11) XPRIM(VERB, jtdberr, jtdberr2, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,11) XPRIM(VERB, jtdberr, jtdberr2, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,12) XPRIM(VERB, jtdbetx, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,13) XPRIM(VERB, jtdbcall, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,14) XPRIM(VERB, jtdbtrapq, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
Expand All @@ -311,7 +312,7 @@ void jtforeigninit(J jt){UI i;
MN(13,21) XPRIM(VERB, jtdbstepinto1,jtdbstepinto2,VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,22) XPRIM(VERB, jtdbstepout1, jtdbstepout2, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,23) XPRIM(VERB, jtdbpasss, jtdbpasss, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,24) XPRIM(VERB, jtdbisolatestk, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,24) XPRIM(VERB, jtdbisolatestk, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(15,5) XPRIM(VERB, jtcdf, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(15,7) XPRIM(VERB, jtdllsymset, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(15,8) XPRIM(VERB, jtgh15, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
Expand All @@ -334,42 +335,42 @@ void jtforeigninit(J jt){UI i;
MN(15,23) XPRIM(VERB, jtcdq, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(18,0) XPRIM(VERB, jtlocnc, 0, VFLAGNONE,VF2NONE,0, RMAX,RMAX);
MN(18,1) XPRIM(VERB, jtlocnl1, jtlocnl2, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(18,55) XPRIM(VERB, jtlocexmark, jtlocexmark, VFLAGNONE,VF2NONE,0, RMAX,RMAX);
MN(18,55) XPRIM(VERB, jtlocexmark, jtlocexmark, VFLAGNONE,VF2NONE,0, RMAX,RMAX);
MN(128,0) XPRIM(VERB, jtqr, 0, VASGSAFE,VF2NONE,2, RMAX,RMAX);
MN(128,1) XPRIM(VERB, jtrinv, 0, VASGSAFE,VF2NONE,2, RMAX,RMAX);
MN(128,3) XPRIM(VERB, jtcrc1, jtcrc2, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(128,4) XPRIM(VERB, jtrngraw, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(128,6) XPRIM(VERB, jtshasum1, jtshasum2, VASGSAFE,VF2NONE,1,1,RMAX);
MN(128,7) XPRIM(VERB, 0, jtaes2, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(128,8) XPRIM(VERB, jtqhash12, jtqhash12, VASGSAFE|VJTFLGOK1|VJTFLGOK2,VF2NONE,RMAX,RMAX,RMAX);
MN(128,10) XPRIM(VERB, jtludecomp, jtludecomp, VASGSAFE,VF2NONE,RMAX, RMAX,RMAX);
MN(18,6) XPRIM(VERB, jtresetbloom, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(128,10) XPRIM(VERB, jtludecomp, jtludecomp, VASGSAFE,VF2NONE,RMAX, RMAX,RMAX);
MN(18,6) XPRIM(VERB, jtresetbloom, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
#if 0 // obsolete but not dead
MN(18,7) XPRIM(VERB, jtsetpermanent, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(18,7) XPRIM(VERB, jtsetpermanent, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
#endif

MN(0,-1) XPRIM(VERB, jtskipinscript, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(0,-1) XPRIM(VERB, jtskipinscript, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(5,-1) XPRIM(VERB, 0, jtoutstr, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,-1) XPRIM(VERB, jtleakblockread, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,-2) XPRIM(VERB, jtleakblockreset, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,-1) XPRIM(VERB, jtleakblockread, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,-2) XPRIM(VERB, jtleakblockreset, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(9,-3) XPRIM(VERB, jtshowinplacing1, jtshowinplacing2, VASGSAFE|VJTFLGOK1|VJTFLGOK2,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-1) XPRIM(VERB, 0, jtfindrange, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-2) XPRIM(VERB, 0, jtfindrange4, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-3) XPRIM(VERB, 0, jtfindrange2, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-4) XPRIM(VERB, jthdrinfo, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-4) XPRIM(VERB, jthdrinfo, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-5) XPRIM(VERB, 0, jtauditpyx, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-6) XPRIM(VERB, jtstackfault, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-6) XPRIM(VERB, jtstackfault, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
#if PYXES
MN(13,-7) XPRIM(VERB, jtnulljob, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
#endif
MN(13,-8) XPRIM(VERB, jtcheckfreepool, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-9) XPRIM(VERB, jtsetgetrecurstate, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-10) XPRIM(VERB, jtcallJDo, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-9) XPRIM(VERB, jtsetgetrecurstate, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(13,-10) XPRIM(VERB, jtcallJDo, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(15,6) XPRIM(VERB, jtdllsymget, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);
MN(18,-1) XPRIM(VERB, jtlocmap, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(18,-2) XPRIM(VERB, jtsympool, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(18,-3) XPRIM(VERB, jtlocnlz1, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(18,-4) XPRIM(VERB, jtlochdr, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(18,-3) XPRIM(VERB, jtlocnlz1, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
MN(18,-4) XPRIM(VERB, jtlochdr, 0, VFLAGNONE,VF2NONE,RMAX,RMAX,RMAX);
// MN(128,110) XPRIM(VERB, jttest1, 0, VASGSAFE,VF2NONE,RMAX,RMAX,RMAX);

// TUNE printf("avg # probes=%7.3f\n",(double)totprobes/(double)totslots);
Expand Down
25 changes: 24 additions & 1 deletion jsrc/xa.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ extern uint64_t g_cpuFeatures;
extern uint64_t g_cpuFeatures2;
extern int numberOfCores;

#ifdef BOXEDSPARSE
extern UC fboxedsparse;
#endif

#include <string.h>
#ifdef _WIN32
#define strncasecmp _strnicmp
Expand Down Expand Up @@ -313,7 +317,7 @@ F1(jtstackfault){C stackbyte,buf[80],*stackptr=&stackbyte;
R 0;
}

// 9!:56 undocumented
// 9!:56
// query/override cpu feature
F1(jtcpufeature){
ARGCHK1(w);
Expand Down Expand Up @@ -688,6 +692,25 @@ F2(jtgemmtune2){I j,k;
R sc(1);
}

// 9!:65 undocumented
// set boxed sparse array capacity 0 disable 1 enable

// 9!:65 0/1
F1(jtboxedsparse){I k;
#ifndef BOXEDSPARSE
ASSERT(0,ENONCE);
#else
ARGCHK1(w);
ASSERT(AT(w)&(B01+INT),EVDOMAIN);
ASSERT(1==AN(w),EVLENGTH);
ASSERT(1>=AR(w),EVRANK);
RE(k=i0(w)); // get arg
ASSERT(k==0||k==1,EVDOMAIN);
fboxedsparse=k;
R mtv;
#endif
}

// enable/disable tstack auditing, since some testcases run too long with it enabled
// bit 0 is set to disable, bit 1 is a one-shot to ask for an audit
// result is old value
Expand Down

0 comments on commit 10cf9f8

Please sign in to comment.