Skip to content

Commit 71bac60

Browse files
committed
Removing C_LE
1 parent 6942771 commit 71bac60

File tree

12 files changed

+25
-90
lines changed

12 files changed

+25
-90
lines changed

jsrc/js.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
/* */
44
/* SYS_ and friends */
55

6-
#ifndef C_LE // littleendian/bigendian
7-
#define C_LE 1
8-
#endif
9-
106
#ifndef C_NA // noasm/asm
117
#define C_NA 1
128
#endif

jsrc/vcompsc.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,25 +109,25 @@
109109
R sc(n); \
110110
}
111111

112-
#define SUMB(f,T0,T1,F) \
113-
static F2(f){I an,*av,n,p,r1,wn,*wv,z=0;UI t,x; \
114-
an=AN(a); av=AV(a); \
115-
wn=AN(w); wv=AV(w); n=1; n=AR(a)?an:n; n=AR(w)?wn:n; \
116-
p=n>>LGSZI; r1=n&(SZI-1); \
117-
if (!AR(a)){ \
118-
ASSIGNX(av); \
112+
#define SUMB(f,T0,T1,F) \
113+
static F2(f){I an,*av,n,p,r1,wn,*wv,z=0;UI t,x; \
114+
an=AN(a); av=AV(a); \
115+
wn=AN(w); wv=AV(w); n=1; n=AR(a)?an:n; n=AR(w)?wn:n; \
116+
p=n>>LGSZI; r1=n&(SZI-1); \
117+
if (!AR(a)){ \
118+
ASSIGNX(av); \
119119
while((p-=255)>0){t=0; DQ(255, t+=F(x, *wv++);); ADDBYTESINI(t); z+=t;} \
120-
t=0; DQ(p+255, t+=F(x, *wv++);); ADDBYTESINI(t); z+=t; x=F(x, *wv); \
121-
}else if(!AR(w)){ \
122-
ASSIGNX(wv); \
120+
t=0; DQ(p+255, t+=F(x, *wv++);); ADDBYTESINI(t); z+=t; x=F(x, *wv); \
121+
}else if(!AR(w)){ \
122+
ASSIGNX(wv); \
123123
while((p-=255)>0){t=0; DQ(255, t+=F(*av++,x );); ADDBYTESINI(t); z+=t;} \
124-
t=0; DQ(p+255, t+=F(*av++,x );); ADDBYTESINI(t); z+=t; x=F(*av,x ); \
125-
}else{ \
124+
t=0; DQ(p+255, t+=F(*av++,x );); ADDBYTESINI(t); z+=t; x=F(*av,x ); \
125+
}else{ \
126126
while((p-=255)>0){t=0; DQ(255, t+=F(*av++,*wv++);); ADDBYTESINI(t); z+=t;} \
127-
t=0; DQ(p+255, t+=F(*av++,*wv++);); ADDBYTESINI(t); z+=t; x=F(*av,*wv); \
128-
} \
129-
x &= ((I)1<<(r1<<LGBB))-1; ADDBYTESINI(x); z+=x; /* C_LE */ \
130-
R sc(z); \
127+
t=0; DQ(p+255, t+=F(*av++,*wv++);); ADDBYTESINI(t); z+=t; x=F(*av,*wv); \
128+
} \
129+
x &= ((I)1<<(r1<<LGBB))-1; ADDBYTESINI(x); z+=x; \
130+
R sc(z); \
131131
}
132132

133133
INDB( i0eqBB,B,B,NE ) INDF( i0eqBI,B,I,ANE ) INDF0( i0eqBD,B,D,TNEXD,NEXD0) /* = */

jsrc/ve.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ A jtintmod2(J jt,A w,I mod){A z;B *v;I n,q,r,*u;UI m=0; // init m for warning
442442
// the rest is boolean result
443443
n=AN(w); v=BAV(w); // littleendian only
444444
GATV(z,B01,n,AR(w),AS(w)); RZ(n); // loops below can't handle empty
445-
u=AV(z); q=(n-1)>>(LGSZI/C_LE); r=((n-1)&(SZI-1))+1; // there is always a remnant
445+
u=AV(z); q=(n-1)>>(LGSZI); r=((n-1)&(SZI-1))+1; // there is always a remnant
446446
I mask=mod==2?VALIDBOOLEAN:0; // if mod is 1, all results will be 0; otherwise boolean result
447447
DQ(q, DQ(SZI, m=(m>>8)+((UI)*v<<((SZI-1)*8)); v+=SZI;); *u++=m&mask;)
448448
DQ(r, m=(m>>8)+((UI)*v<<((SZI-1)*8)); v+=SZI;); // 1-8 bytes

jsrc/vg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ static GF(jtgrc){A x;B b,q,up;I e,i,p,ps,*xv,yv[256];UC*vv,*wv;
662662
if((UI)ai>lgn)R grx(m,ai,n,w,zv); // TUNE
663663
ai<<=((AT(w)>>C2TX)&1);
664664
p=B01&AT(w)?2:256; ps=p*SZI; wv=UAV(w); up=SGNTO0(jt->workareas.compare.complt);
665-
q=C2T&AT(w) && C_LE;
665+
q=C2T&AT(w);
666666
if(1<ai){GATV0(x,INT,n,1); xv=AV(x);}
667667
for(i=0;i<m;++i){
668668
b=(B)(ai&1); if(q){e=-3; vv=wv+ai-2;}else{e=-1; vv=wv+ai-1;}

jsrc/vg.h

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,14 @@ extern I grcol2(I,I,US*,I,I*,I*,const I,US*,I);
4040
extern void jtmsort(J,I,void**,void**);
4141

4242
// Convert 2 Booleans to a code 0-3
43-
#if C_LE
4443
#define IND2(x) {US xx = (x); ii = ((xx<<9)|xx)>>8;}
45-
#else
46-
#define IND2(x) {US xx = (x); ii = 0x3&((xx>>7)|xx);}
47-
#endif
4844

4945
// Convert 4 Booleans to a code 0-15
50-
#if C_LE
5146
#define IND4(x) {UINT xx = (x); xx|=xx<<9; xx|=xx<<18; ii = xx>>24;} // first byte (bit 0) is the MSB when a word is loaded
52-
#else
53-
#define IND4(x) {UINT xx = (x); ii = 0xf&((xx>>21)|(xx>>14)|(xx>>7)|xx);}
54-
#endif
5547

5648
// endian constants for 16-bit radix sorts
57-
#define FPLSBWDX (C_LE?0:3)
58-
#define FPMSBWDX (C_LE?3:0)
59-
#define INTLSBWDX (C_LE?0:(SZI/2-1))
60-
#define INTMSBWDX (C_LE?(SZI/2-1):0)
61-
#define WDINC (C_LE?1:-1)
49+
#define FPLSBWDX (0)
50+
#define FPMSBWDX (3)
51+
#define INTLSBWDX (0)
52+
#define INTMSBWDX (SZI/2-1)
53+
#define WDINC (1)

jsrc/vgranking.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,12 @@ F1(jtranking){A y,z;C*wv;I icn,i,k,m,n,t,wcr,wf,wn,wr,*ws,wt,*zv;CR rng;TTYPE *y
118118
case sizeof(C4):
119119
RANKINGLOOP(C4); break;
120120
case sizeof(C): RANKINGLOOP(UC); break;
121-
#if C_LE
122121
case sizeof(S):
123122
if(wt&IS1BYTE){I c,d,s,t;US*v;TTYPE *u;
124123
v=(US*)wv; DQ(n, ++yu[*v++];);
125124
s=0; DO(256, c=0; d=i; DQ(256, u=yv+(c+d); c+=256; if(*u){t=*u; *u=(TTYPE)s; s+=t;}););
126125
v=(US*)wv; DQ(n, *zv++=yu[*v++]++;);
127126
}else RANKINGLOOP(US);
128-
#else
129-
case sizeof(S): RANKINGLOOP(US);
130-
#endif
131127
}
132128
wv+=n*k;
133129
}

jsrc/vgsort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static SF(jtsortc2){A y,z;B up;I i,p,*yv;US j,k,*wv,*v;
214214
DO(p, yv[i]=0;);
215215
for(i=0;i<m;++i){
216216
DQ(n, ++yv[*wv++];);
217-
if(C2T&AT(w)||!C_LE){
217+
if(C2T&AT(w)){
218218
if(up){j=0; DQ(p, DQ(yv[j], *v++=j;); yv[j]=0; ++j;);}
219219
else {j=(US)(p-1); DQ(p, DQ(yv[j], *v++=j;); yv[j]=0; --j;);}
220220
}else{

jsrc/vi.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,8 @@
1616
/* ThinkC MAC 6888x 0 1 _ _ 2 3 4 5 6 7 8 9 */
1717
/* normal 0 1 2 3 4 5 6 7 ... */
1818

19-
#if C_LE
2019
#define MSW 1 /* most significant word */
2120
#define LSW 0 /* least significant word */
22-
#else
23-
#define MSW 0
24-
#define LSW 1
25-
#endif
2621

2722
// create a mask of bits in which a difference is considered significant for floating-point purposes.
2823
// we calculate this using pi as a reference: find pi +- ct, and see which bits are different. Everything
@@ -55,28 +50,14 @@ static UI hicnz( I k,UC*v){UI HASHINIT(z);UC c; DQ(k, c=*v++; if(c&&c!
5550

5651
static UI hicx(J jt,I k,UC*v){UI HASHINIT(z);I*u=jt->hiv; DQ(jt->hin, HASHSTEP(z,v[*u++]); ); R z;}
5752

58-
#if C_LE
5953
UI hic2( I k,UC*v){UI HASHINIT(z); DQ(k>>1, HASHSTEP(z,v[0]);
6054
if(*(v+1)){HASHSTEP(z,v[1]);} v+=2;); R z;}
61-
#else
62-
UI hic2( I k,UC*v){UI HASHINIT(z); ++v; DQ(k>>1, HASHSTEP(z,v[0]);
63-
if(*(v-1)){HASHSTEP(z,v[-1]);} v+=2;); R z;}
64-
#endif
6555

66-
#if C_LE
6756
UI hic4( I k,UC*v){UI HASHINIT(z); DQ(k>>2, HASHSTEP(z,v[0]);
6857
if(*(v+2)||*(v+3)){HASHSTEP(z,v[1]);
6958
HASHSTEP(z,v[2]);
7059
HASHSTEP(z,v[3]);}
7160
else if(*(v+1)){HASHSTEP(z,v[1]);} v+=4;); R z;}
72-
#else
73-
UI hic4( I k,UC*v){UI HASHINIT(z); v+=3; DQ(k>>2, HASHSTEP(z,v[0]);
74-
if(*(v-2)||*(v-3)){HASHSTEP(z,v[-1]);
75-
HASHSTEP(z,v[-2]);
76-
HASHSTEP(z,v[-3]);}
77-
else if(*(v-1)){HASHSTEP(z,v[-1]);} v+=4;); R z;}
78-
#endif
79-
8061

8162
// Hash a single unsigned INT
8263
#define hicw(v) (10495464745870458733U**(UI*)(v))

jsrc/viix.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ F2(jticap2){A*av,*wv,z;C*uu,*vv;I ar,*as,at,b,c,ck,cm,ge,gt,j,k,m,n,p,q,r,t,wr,*
142142
case TT(B01X, FLX ): BSLOOP(C, D ); break;
143143
case TT(LITX, C2TX ): BSLOOP(UC,US); break;
144144
case TT(LITX, C4TX ): BSLOOP(UC,C4); break;
145-
#if C_LE
146145
case TT(LITX, LITX ): BSLOOP(UC,UC); break;
147-
#else
148-
case TT(LITX, LITX ): if(1&c){BSLOOP(UC,UC); break;}else c>>=1; /* fall thru */
149-
#endif
150146
case TT(C2TX, C2TX ): BSLOOP(US,US); break;
151147
case TT(C2TX, C4TX ): BSLOOP(US,C4); break;
152148
case TT(C2TX, LITX ): BSLOOP(US,UC); break;

jsrc/vu.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ A jttoc1(J jt,B h,A w){A z;C*wv,*zv;I n;C4*w4;
1818
w4=C4AV(w);
1919
ASSERT(!n||(C2T+C4T)&AT(w),EVDOMAIN); // must be empty or unicode
2020
GATV(z,LIT,n,AR(w),AS(w)); zv=CAV(z); // allocate ASCII area with same data shape
21-
#if C_LE
2221
if(C2T&AT(w))
2322
{
2423
if(h)DQ(n, *zv++=*wv++; wv++;) else DQ(n, *zv++=*wv++; ASSERT(!*wv++,EVDOMAIN);)
@@ -29,16 +28,6 @@ A jttoc1(J jt,B h,A w){A z;C*wv,*zv;I n;C4*w4;
2928
}
3029
// copy the low byte of the data (if there is any). if b==0, verify high byte is 0
3130
// where low and high are depends on endianness
32-
#else
33-
if(C2T&AT(w))
34-
{
35-
if(h)DQ(n, wv++; *zv++=*wv++;) else DQ(n, ASSERT(!*wv++,EVDOMAIN); *zv++=*wv++;)
36-
}
37-
else
38-
{
39-
if(h)DQ(n, *zv++=(UC)*w4++; ) else DQ(n, *zv++=(UC)*w4++; ASSERT(*(w4-1)<256UL,EVDOMAIN);)
40-
}
41-
#endif
4231
RETF(z);
4332
} /* convert 2-byte or 4-byte chars to 1-byte chars; 0==h iff high order byte(s) must be 0 */
4433

@@ -48,7 +37,6 @@ static F1(jttoc2){A z;C*wv,*zv;I n;C4*w4;US*z2;
4837
n=AN(w); wv=CAV(w); w4=C4AV(w);
4938
ASSERT(!n||(LIT+C4T)&AT(w),EVDOMAIN);
5039
GATV(z,C2T,n,AR(w),AS(w)); zv=CAV(z); z2=USAV(z);
51-
#if C_LE
5240
if(LIT&AT(w))
5341
{
5442
DQ(n, *zv++=*wv++; *zv++=0;);
@@ -57,16 +45,6 @@ static F1(jttoc2){A z;C*wv,*zv;I n;C4*w4;US*z2;
5745
{
5846
DQ(n, *z2++=(US)*w4++;);
5947
}
60-
#else
61-
if(LIT&AT(w))
62-
{
63-
DQ(n, *zv++=0; *zv++=*wv++;);
64-
}
65-
else
66-
{
67-
DQ(n, *z2++=(US)*w4++;);
68-
}
69-
#endif
7048
R z;
7149
} /* convert 1-byte chars or 4-byte chars(discard high order half) to 2-byte chars */
7250

0 commit comments

Comments
 (0)