123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- #define Zi static unsigned
- #define Ze static float
- #define Zu static u // ubcieE [paieEtnNs][ax] [rax][ucieE] w[ucieE] //clang -Os -oa a.c -lm
- typedef unsigned long(*_)(),u;Zi lt[]={3,0,0,2,2,3,3},O,T;Zu Q=128,U[26],ys();Ze pi=3.1415927;
- static char b[64];Zu __attribute((naked))ut(){asm(".quad 0xd53be04031420aeb,0xc148310fd65f03c0,0xc3d0094820e2");}
- #define ty x(y,tx)
- #define xx *(u*)x
- #define txx y(xx,ty)
- #define q(z) ux=z;Q(x)
- #define T0(z) _x(R(0,nx,i(nx,ru=z)))
- #define r1(n,z) R(1,n,i(n,sr[i]=z))
- #define r3(n,z) R(3,n,i(n,ri=z))
- #define r4(n,z) R(4,n,i(n,re=z))
- #define r5(n,z) R(5,n,i(n,rE=_(z)))
- #define T(t,c,h,e,E) _x(R(t,nx,C4(t-2,i(nx,sr[i]=c),i(nx,ri=h),i(nx,re=e),i(nx,rE=E))))
- #define t(t,i,e,E) c4(t-2,tc(i),ti(i),te(e),tE(E))
- #define ue(t,z) _(x=t>ax?Ua(t,x):x;z)
- #define uE(t,z) _(x=t>tx?Ut(t,x):x;z)
- #define uu(e) _(if(aa!=ax){if(aa<ax)a=Ua(ax,a);else x=Ua(aa,x);}e)
- #define UU(e) _a(it=aa?:ta;if(t!=tx){if(t<tx)a=aa?Ua(tx,a):Ut(tx,a);else x=Ut(t,x);}e)
- #define _(e) ({e;})
- #define f(g,e) u(g,e,ux)
- #define i(n,e) {unsigned $n=n;ii=0;for(;i<$n;++i){e;}}
- #define l(a,e) _(typeof(e)e_=e;(a)<e_?(a):e_)
- #define m(a,e) _(typeof(e)e_=e;(a)>e_?(a):e_)
- #define r(a,e) _(typeof(a)r=a;e;r)
- #define u(g,e,x...) Zu g(x){return _(e);}
- #define x(a,e) _(typeof(a)x=a;e)
- #define y(a,e) _(typeof(a)y=a;e)
- #define F(g,e) u(g,e,ua,ux)
- #define G(g,e) u(g,e,uf,ua,ux)
- #define Q(e) if(Q==(e))return Q;
- #define N(e) i(nx,e)
- #define P(b,e) if(b)return _(e);
- #define W(z) while(z)
- #define ii unsigned i
- #define in unsigned n
- #define ss char*s
- #define us(g,e) u(g,e,ss)
- #define ns(g,e) u(g,e,in,ss)
- #define _a(e) r(_(e),_r(a))
- #define _x(e) r(_(e),_r(x))
- #define _ax(e) _a(_x(e))
- #define n3(z) ((7+(z))>>3)
- #define ex (*(float*)&x)
- #define Ex (*(Float*)&x)
- #define ax l(5,x>>51)
- #define pax (px||ax)
- #define xc sx[i]
- #define sx ((char*)x)
- #define px (31>x)
- #define xE ((Float*)x)[i]
- #define aE x(a,ax?Ex:xE)
- #define Ea x(a,Ex)
- #define ci (lx?xi:sx[i])
- #define ix (unsigned)x
- #define lx lt[tx]
- #define Nx (nx<<lx)
- #define tx sx[-5]
- #define xr ((unsigned*)x)[-2]
- #define nx ((unsigned*)x)[-1]
- #define xi ((unsigned*)x)[i]
- #define xe ((float*)x)[i]
- #define xu ((u*)x)[i]
- #define iu(g,e) u(g,e,ii,ux)
- #define nu(g,e) u(g,e,in,ux)
- #define tu(g,e) u(g,e,it,ux)
- #define Qs(e,s) if(e)return err((u)__func__,(u)s);
- #define Qz(e) Qs(e,"nyi")
- #define Qr(e) Qs(e,"rank")
- #define Qt(e) Qs(e,"type")
- #define Qd(e) Qs(e,"domain")
- #define QZ Qz(1)0
- #define oo w((u)"oo\n")
- #define uf u f
- #define ua u a
- #define ux u x
- #define st char*t
- #define it unsigned t
- #define EE Float E
- #define ee float e
- #define nxu ((unsigned*)xu)[-1]
- #define sxu ((char*)xu)
- #define si s[i]
- #define sr x(r,sx)
- #define nr x(r,nx)
- #define Nr x(r,Nx)
- #define ai x(a,ax?ix:xi)
- #define ae x(a,ax?ex:xe)
- #define ea x(a,ex)
- #define sa x(a,sx)
- #define la x(a,lx)
- #define pa x(a,px)
- #define aa x(a,ax)
- #define ia x(a,ix)
- #define na x(a,nx)
- #define ta x(a,tx)
- #define Na x(a,Nx)
- #define c4(z,a,b,c,d) _(unsigned o=z;!o?a:1==o?b:2==o?c:_(d))
- #define C4(z,a,b,c,d) unsigned o=z;if(!o)_(a);else if(1==o)_(b);else if(2==o)_(c);else _(d);
- #define Z_ static _
- #define Zs static char*
- #define ZE static Float
- #define l2(z) (64-bu(clzl)(z))
- #define R1(z) _x(r1(nx,z))
- #define R3(z) _x(r3(nx,z))
- #define R4(z) _x(r4(nx,z))
- #define R5(z) _x(r5(nx,z))
- #define tb(z) (1l<<51|(z))
- #define tc(z) (2l<<51|(char)(z))
- #define ti(z) (3l<<51|(unsigned)(z))
- #define te(z) (4l<<51|_(float _=z;*(unsigned*)&_))
- #define ru ((u*)r)[i]
- #define ri ((unsigned*)r)[i]
- #define re ((float*)r)[i]
- #define rE ((Float*)r)[i]
- #define wu(z) r((u)(z),nw(sprintf(b,"%lx\n",r),b))
- #define wi(z) r((int)(z),nw(sprintf(b,"%d\n",r),b))
- #define we(z) r((float)(z),nw(sprintf(b,"%g\n",r),b))
- #define wE(z) r((Float)(z),float*a=&r;nw(sprintf(b,"%g:%g\n",*a,a[1]),b))
- #define bu(o) __builtin_##o
- us(sl,ii=0;W(si)++i;i)ns(is,i(sl(s),P(n==si,i+1))0)
- #if __arm64
- static void __builtin_ia32_ldmxcsr(int x){asm("msr fpcr,%0"::"r"(3l<<23));}
- #endif
- #include<complex.h>
|