Skip to content

Commit

Permalink
gcc compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryHRich committed Jan 10, 2025
1 parent a54dd2a commit 7f2279b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions jsrc/va2.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ static NOINLINE I intforD(J jt, D d){D q;I z; // noinline because it uses so ma
// we know that AN=1 in a and w, which are FL/INT/B01 types. af is larger arg rank (=rank of result)
// obsolete I awip=2*SGNTO0(AC(a))+SGNTO0(AC(w)); awip=(awip&(I)jtinplace)+4*((I)jtinplace&3); // abandoned flags from aw; make (assignable),(inplaceable) flags
// obsolete z=jtssingleton(jt,a,w,af+((I)FAV(self)->lu2.lc<<RANKTX)+(awip<<16)+((3*(at>>INTX)+(wt>>INTX))<<20)); // create portmanteau parm reg
A INLINE jtssingleton(J jt,A a,A w,I af,I at, I wt,A self){
static A INLINE jtssingleton(J jt,A a,A w,I af,I at, I wt,A self){
// obsolete A INLINE jtssingleton(J jt, A a,A w,I ipcaserank){A z;I aiv;void *zv;
I awip=2*SGNTO0(AC(a))+SGNTO0(AC(w)); // collect inplaceable status for a and w
I opcode=(I)FAV(self)->lu2.lc; // fetch operation#
void *av=voidAV(a), *wv=voidAV(w); // point to the argument values
FPREFIP(I); I zomb=2*(a==jt->zombieval)+(w==jt->zombieval); // save jt as an I, clear low bits, see if either arg is
I jtinplace=(I)jt; jt=(J)(intptr_t)((I)jt&~JTFLAGMSK); I zomb=2*(a==jt->zombieval)+(w==jt->zombieval); // save jt as an I, clear low bits, see if either arg is being assigned
I caseno=(opcode&0x7f)-VA2CBW1111; caseno=caseno<0?0:caseno; caseno=SSINGCASE(caseno,SSINGENC(at,wt)); // case # for eventual switch. Lump all Booleans at 0
A z=0; void *zv; // pointer to result location
// if the operation is a rank-0 comparison that can return num[result], don't bother with inplacing. Inplacing would be
// a potential gain if the result can itself be inplaced, but it is a certain loser when deciding where the result is
if((opcode>>7)>af)goto nozv; // true if 0x80 (comparison op) and af=0
awip&=jtinplace; z=awip&JTINPLACEA?a:z; z=awip&JTINPLACEW?w:z; // block is contextually inplaceable and inplaceable by count= abandoned. Give priority to w
// While z is settling, see if we can inplace an assignment. That is always a good idea, though rare
if(unlikely(zomb&jtinplace)){ // one of the args is being reassigned
if(unlikely(zomb&=jtinplace)){ // one of the args is being reassigned
if(likely((AFLAG(jt->zombieval)&AFVIRTUAL+AFUNINCORPABLE)+(af^AR(jt->zombieval))==0)){z=jt->zombieval; goto getzv;} // mustn't modify VIRTUAL or INCORPABLE, and reassigned value must have the higher rank
// obsolete if(likely(af==AR(jt->zombieval))){z=jt->zombieval; goto getzv;} // the
// obsolete }
}
// obsolete awip&=jtinplace; z=awip&JTINPLACEA?a:z; z=awip&JTINPLACEW?w:z; // block is contextually inplaceable and inplaceable by count= abandoned. Give priority to w
#if 0 // obsolete
// if the operation is a rank-0 comparison that can return num[result], don't bother with inplacing. Inplacing would be
// a potential gain if the result can itself be inplaced, but it is a certain loser when deciding where the result is
Expand All @@ -70,7 +70,7 @@ A INLINE jtssingleton(J jt,A a,A w,I af,I at, I wt,A self){
// see if the block is inplaceable in the ordinary way - start loading the z value if it is
// obsolete z=(AC(a)&SGNIF(ipcaserank,24+JTINPLACEAX))<0?a:z; z=(AC(w)&SGNIF(ipcaserank,24+JTINPLACEWX))<0?w:z; // block is contextually inplaceable
z=ipcaserank&0x20000?a:z; z=ipcaserank&0x10000?w:z; // block is contextually inplaceable. Give priority to w
// While z is settling, see if we can inplace an assignment. That is always a good idea, though rare
// While z is settling, see if we can inplace an assignment. That is always a good idea (since it results in IP assignment), though rare
// obsolete if(unlikely(((B)(a==jt->zombieval)&((B)(ipcaserank>>(24+JTINPLACEAX))))+((B)(w==jt->zombieval)&((B)(ipcaserank>>(24+JTINPLACEWX)))))){
if(unlikely((2*(a==jt->zombieval)+(w==jt->zombieval))&(ipcaserank>>18))){
if(likely(!(AFLAG(jt->zombieval)&AFVIRTUAL+AFUNINCORPABLE))){
Expand All @@ -79,8 +79,12 @@ A INLINE jtssingleton(J jt,A a,A w,I af,I at, I wt,A self){
}
#endif
// obsolete if(z&&likely(!(AFLAG(z)&AFUNINCORPABLE+AFRO)))if(likely(af==AR(z)))goto getzv; // not disallowed and correct rank, take it
if(z&&likely((AFLAG(z)&AFUNINCORPABLE+AFRO)+(af^AR(z))==0))goto getzv; // not disallowed and correct rank, inplace to it
// no inplacing, allocate the result, usually an atom. If not atom, make the shape all 1s
// See if we can inplace. We let some chances get away because they aren't worth testing for. There are two main possibilities: assignment (checked above)
// and abandoned arg (checked presently). If either passes, it must further be not VIRTUAL if assigned (lest it overwrite the backer of a virtual x/y arg)
// and not AFRO if bare; and never UNINCORPABLE since we may change the type and we don't want callers to bear the burden of checking that. It is possible that
// one arg would be inplaceable as an assignment and the other as abandoned, but we pick one and live with it.
if(awip&=jtinplace){z=awip&JTINPLACEW?w:a; if(likely((AFLAG(z)&AFUNINCORPABLE+AFRO)+(af^AR(z))==0))goto getzv;} // block is abandoned inplaceable; not disallowed and correct rank, inplace to it
// fall through: no inplacing, allocate the result, usually an atom. If not atom, make the shape all 1s
if(likely(af==0)){GAT0(z,FL,1,0); zv=voidAV0(z);}else{GATV1(z,FL,1,af); zv=voidAV(z);} // not voidAVn so that af is not needed
goto nozv;
getzv:; // here when we are operating inplace on z
Expand Down

0 comments on commit 7f2279b

Please sign in to comment.