Skip to content

Commit 9ccc3fb

Browse files
committed
Merge branch 'master' of jsoftware.com:jsource
2 parents fe13619 + 97faa3c commit 9ccc3fb

19 files changed

Lines changed: 186 additions & 177 deletions

File tree

jsrc/as.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static DF2(jtofxinv){A f,fs,z;C c;I t;V*v;
354354
fs=FAV(self)->fgh[0]; f=FAV(fs)->fgh[0]; v=FAV(f); c=v->id; t=AT(w); // self = f/\. fs = f/ f = f v = verb info for f
355355
if(!(c==CPLUS||c==CBDOT&&t&INT||((c&-2)==CEQ)&&t&B01))R outfix(a,w,self); // if not +/\. or m b./\. or =/\. or ~:/\.
356356
A z0,z1; z=irs2(df1(z0,w,fs),df2(z1,a,w,bslash(fs)),c==CPLUS?ds(CMINUS):f, RMAX,-1L,jtatomic2);
357-
if(jt->jerr==EVNAN){RESETERR; R outfix(a,w,self);}else R z;
357+
if(jt->jerr==EVDOMAIN){RESETERR; R outfix(a,w,self);}else R z;
358358
} /* a f/\. w where f has an "undo" */
359359

360360
static DF2(jtofxassoc){A f,i,j,p,s,x,z;C id,*zv;I c,d,k,kc,m,r,t;V*v;VA2 adocv;

jsrc/cpuinfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ enum {
110110
ARM_HWCAP2_SME_F32F32 = (1 << 29),
111111
ARM_HWCAP2_SME_FA64 = (1 << 30),
112112
ARM_HWCAP2_WFXT = (1UL << 31),
113+
#if defined(_WIN64)||defined(__LP64__)
113114
ARM_HWCAP2_EBF16 = (1UL << 32),
114115
ARM_HWCAP2_SVE_EBF16 = (1UL << 33),
116+
#endif
115117
};
116118

117119
#elif defined(__x86_64__)||defined(__i386__)||defined(_M_X64)||defined(_M_IX86)

jsrc/d.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ noeformat: ;
326326
}
327327
}
328328
// some errors are distinguished internally to make eformat easier. We revert them to the normal message after eformatting
329-
e=e==EVINHOMO?EVDOMAIN:e; e=e==EVINDEXDUP?EVINDEX:e; e=e==EVEMPTYT?EVCTRL:e; e=e==EVEMPTYDD?EVCTRL:e; // revert internal numbers to external codes after formatting
329+
e=e==EVINHOMO?EVDOMAIN:e; e=e==EVNAN?EVDOMAIN:e; e=e==EVINDEXDUP?EVINDEX:e; e=e==EVEMPTYT?EVCTRL:e; e=e==EVEMPTYDD?EVCTRL:e; // revert internal numbers to external codes after formatting
330330

331331
jt->jerr=jt->jerr1=e; // save reverted value
332332
jt->emsgstate|=EMSGSTATEFORMATTED; // indicate formatting attempted even if we skipped it

jsrc/i.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ static B jtevinit(JS jjt){A q,*v;JJ jt=MTHREAD(jjt);
103103
v[EVLENGTH ]=INCORPNA(cstr("length error" ));
104104
v[EVLIMIT ]=INCORPNA(cstr("limit error" ));
105105
v[EVLOCALE ]=INCORPNA(cstr("locale error" ));
106-
v[EVNAN ]=INCORPNA(cstr("NaN error" ));
107106
v[EVNONCE ]=INCORPNA(cstr("nonce error" ));
108107
v[EVNONNOUN]=INCORPNA(cstr("noun result was required" ));
109108
v[EVSPARSE ]=INCORPNA(cstr("non-unique sparse elements" ));
@@ -121,6 +120,7 @@ static B jtevinit(JS jjt){A q,*v;JJ jt=MTHREAD(jjt);
121120
v[EVTIME ]=INCORPNA(cstr("time limit" ));
122121
v[EVVALENCE]=INCORPNA(cstr("valence error" ));
123122
v[EVVALUE ]=INCORPNA(cstr("value error" ));
123+
v[EVNAN ]=v[EVDOMAIN];ras(v[EVNAN]);
124124
v[EVINHOMO ]=v[EVDOMAIN];ras(v[EVINHOMO]);
125125
v[EVINDEXDUP ]=v[EVINDEX];ras(v[EVINDEXDUP]);
126126
v[EVEMPTYT ]=v[EVCTRL];ras(v[EVEMPTYT]);

jsrc/va2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ DF2(jtsumattymes1){
11271127
}
11281128
#endif
11291129
NAN1;
1130-
}
1130+
}
11311131
RETF(z);
11321132
}
11331133

jsrc/vbang.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static Z jtzgps(J jt,Z z){R zdiv(z1,zhorner(terms,coeff,z));}
3535

3636
D jtdgamma(J jt,D x){B b;D t;
3737
t=1.0; b=x==jfloor(x);
38-
if(b&&0>=x){ASSERT(x>x-1,EVLIMIT); R x==2*jfloor(x/2)?inf:infm;}
38+
if(b&&0>=x){ASSERT(x!=-inf,EVNAN); R x==2*jfloor(x/2)?inf:infm;}
3939
if(0<=x) while(1<x){t*=--x; if(t==inf)R inf;}
4040
else {while(0>x){t*=x++; if(t==inf)R 0.0;} t=1.0/t;}
4141
R b?t:t*dgps(x);

jsrc/vx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ F2(jtxroota){A z; GAT0(z,XNUM,1L,0L); XAV(z)[0]=rifvsdebug(xroot(XAV(a)[0],XAV(w
363363

364364
XF1(jtxfact){I n;
365365
n=AV(w)[0];
366-
if(n==XPINF||n==XNINF)R vci(XPINF);
366+
ASSERT(n!=XNINF,EVNAN);
367+
if(n==XPINF)R vci(XPINF);
367368
RE(n=xint(w));
368369
if(0>n)R rifvsdebug(vci(n&1?XPINF:XNINF));
369370
R rifvsdebug(xev1(apv(n,1L,1L),"*/"));

jsrc/xa.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,10 @@ F1(jtcpufeature){
395395
else if(!strcasecmp(CAV(w),"SME_F32F32" )) R sc(!!(getCpuFeatures2()&ARM_HWCAP2_SME_F32F32 ));
396396
else if(!strcasecmp(CAV(w),"SME_FA64" )) R sc(!!(getCpuFeatures2()&ARM_HWCAP2_SME_FA64 ));
397397
else if(!strcasecmp(CAV(w),"WFXT" )) R sc(!!(getCpuFeatures2()&ARM_HWCAP2_WFXT ));
398+
#if defined(_WIN64)||defined(__LP64__)
398399
else if(!strcasecmp(CAV(w),"EBF16" )) R sc(!!(getCpuFeatures2()&ARM_HWCAP2_EBF16 ));
399400
else if(!strcasecmp(CAV(w),"SVE_EBF16" )) R sc(!!(getCpuFeatures2()&ARM_HWCAP2_SVE_EBF16 ));
401+
#endif
400402
else R sc(0);
401403
#elif defined(__x86_64__)||defined(__i386__)||defined(_M_X64)||defined(_M_IX86)
402404
if (!strcasecmp(CAV(w),"SSSE3" )) R sc(!!(getCpuFeatures()&CPU_X86_FEATURE_SSSE3 ));
@@ -497,8 +499,10 @@ F2(jtcpufeature2){I k;
497499
else if(!strcasecmp(CAV(w),"SME_F32F32" )) g_cpuFeatures2 |= ARM_HWCAP2_SME_F32F32 ;
498500
else if(!strcasecmp(CAV(w),"SME_FA64" )) g_cpuFeatures2 |= ARM_HWCAP2_SME_FA64 ;
499501
else if(!strcasecmp(CAV(w),"WFXT" )) g_cpuFeatures2 |= ARM_HWCAP2_WFXT ;
502+
#if defined(_WIN64)||defined(__LP64__)
500503
else if(!strcasecmp(CAV(w),"EBF16" )) g_cpuFeatures2 |= ARM_HWCAP2_EBF16 ;
501504
else if(!strcasecmp(CAV(w),"SVE_EBF16" )) g_cpuFeatures2 |= ARM_HWCAP2_SVE_EBF16 ;
505+
#endif
502506

503507
#elif defined(__x86_64__)||defined(__i386__)||defined(_M_X64)||defined(_M_IX86)
504508
if (!strcasecmp(CAV(w),"SSSE3" )) g_cpuFeatures |= CPU_X86_FEATURE_SSSE3 ;
@@ -585,8 +589,10 @@ F2(jtcpufeature2){I k;
585589
else if(!strcasecmp(CAV(w),"SME_F32F32" )) g_cpuFeatures2 &= ~ARM_HWCAP2_SME_F32F32 ;
586590
else if(!strcasecmp(CAV(w),"SME_FA64" )) g_cpuFeatures2 &= ~ARM_HWCAP2_SME_FA64 ;
587591
else if(!strcasecmp(CAV(w),"WFXT" )) g_cpuFeatures2 &= ~ARM_HWCAP2_WFXT ;
592+
#if defined(_WIN64)||defined(__LP64__)
588593
else if(!strcasecmp(CAV(w),"EBF16" )) g_cpuFeatures2 &= ~ARM_HWCAP2_EBF16 ;
589594
else if(!strcasecmp(CAV(w),"SVE_EBF16" )) g_cpuFeatures2 &= ~ARM_HWCAP2_SVE_EBF16 ;
595+
#endif
590596
#elif defined(__x86_64__)||defined(__i386__)||defined(_M_X64)||defined(_M_IX86)
591597
if (!strcasecmp(CAV(w),"SSSE3" )) g_cpuFeatures &= ~CPU_X86_FEATURE_SSSE3 ;
592598
else if(!strcasecmp(CAV(w),"POPCNT" )) g_cpuFeatures &= ~CPU_X86_FEATURE_POPCNT ;

test/g030.ijs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ _ __ -: >: _ __
9999
_ __ eq + _ __
100100
_ __ eq _ __ + _ __
101101

102-
'NaN error' -: _ + etx __
103-
'NaN error' -: __ + etx _
102+
'domain error' -: _ + etx __
103+
'domain error' -: __ + etx _
104104

105105
*./, _ = _ + ?2 3$2
106106
*./, _ = _ + _1e9+?2 3 4$2e9
@@ -150,12 +150,12 @@ NB. _ __ __ _ -: _ _ __ __ *. _ __ _ __
150150
NB. _. _. eq 0 *. _ __
151151
NB. _. _. eq _ __ *. 0
152152

153-
'NaN error' -: _ *. etx a=.?2 3$2
154-
'NaN error' -: _ *. etx a=._1e9+?2 3 4$2e9
155-
'NaN error' -: _ *. etx a=.o._1e9+?2 3 4$2e9
156-
'NaN error' -: __ *. etx a=.?2 3$2
157-
'NaN error' -: __ *. etx a=._1e9+?2 3 4$2e9
158-
'NaN error' -: __ *. etx a=.o._1e9+?2 3 4$2e9
153+
'domain error' -: _ *. etx a=.?2 3$2
154+
'domain error' -: _ *. etx a=._1e9+?2 3 4$2e9
155+
'domain error' -: _ *. etx a=.o._1e9+?2 3 4$2e9
156+
'domain error' -: __ *. etx a=.?2 3$2
157+
'domain error' -: __ *. etx a=._1e9+?2 3 4$2e9
158+
'domain error' -: __ *. etx a=.o._1e9+?2 3 4$2e9
159159

160160
-. 128!:5 (2 (0 0;0 1;1 0)} 6 6$0) * 1 (0 0;0 1;1 0)} 6 6$_ NB. used to leave NaNs at the end
161161
-. 128!:5 (1 (0 0;0 1;1 0)} 6 6$_) * (2 (0 0;0 1;1 0)} 6 6$0)
@@ -167,8 +167,8 @@ __ _ -: - _ __
167167

168168
_ __ eq _ __ - __ _
169169

170-
'NaN error' -: _ - etx _
171-
'NaN error' -: __ - etx __
170+
'domain error' -: _ - etx _
171+
'domain error' -: __ - etx __
172172

173173
*./, _ = _ - ?2 3$2
174174
*./, _ = _ - _1e9+?2 3 4$2e9

test/g031.ijs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ _. -: _.
2323

2424
8 -: (3!:0) _.
2525

26-
'NaN error' -: ex '_. ". ''circ'''
26+
'domain error' -: ex '_. ". ''circ'''
2727

2828

2929
NB. conversion of _0 to 0 in place --------------------------------------

0 commit comments

Comments
 (0)