mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 19:12:25 +00:00
Pass set size to __IN, remove uSET Ctype, optimize __IN size test.
This commit is contained in:
parent
68c105b48c
commit
b8496c3736
3 changed files with 13 additions and 9 deletions
|
|
@ -624,8 +624,11 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
||||||
IF (subclass IN {OPT.ash, OPT.lsh, OPT.rot}) & (r^.class = OPT.Nconst) & (r^.conval^.intval < 0) THEN
|
IF (subclass IN {OPT.ash, OPT.lsh, OPT.rot}) & (r^.class = OPT.Nconst) & (r^.conval^.intval < 0) THEN
|
||||||
OPM.WriteInt(-r^.conval^.intval)
|
OPM.WriteInt(-r^.conval^.intval)
|
||||||
ELSE expr(r, MinPrec)
|
ELSE expr(r, MinPrec)
|
||||||
END ;
|
END;
|
||||||
IF subclass IN {OPT.lsh, OPT.rot} THEN OPM.WriteString(Comma); OPM.WriteInt(l.typ.size*8) END;
|
IF subclass IN {OPS.in, OPT.lsh, OPT.rot} THEN
|
||||||
|
OPM.WriteString(Comma);
|
||||||
|
IF subclass = OPS.in THEN OPM.WriteInt(r.typ.size*8) ELSE OPM.WriteInt(l.typ.size*8) END
|
||||||
|
END;
|
||||||
OPM.Write(CloseParen)
|
OPM.Write(CloseParen)
|
||||||
| OPS.eql
|
| OPS.eql
|
||||||
.. OPS.geq: IF l^.typ^.form IN {OPT.String, OPT.Comp} THEN
|
.. OPS.geq: IF l^.typ^.form IN {OPT.String, OPT.Comp} THEN
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,6 @@ typedef float REAL;
|
||||||
typedef double LONGREAL;
|
typedef double LONGREAL;
|
||||||
typedef void* SYSTEM_PTR;
|
typedef void* SYSTEM_PTR;
|
||||||
|
|
||||||
#define uSET SET
|
|
||||||
|
|
||||||
|
|
||||||
// 'address' is a synonym for an int of pointer size
|
// 'address' is a synonym for an int of pointer size
|
||||||
|
|
@ -200,7 +199,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){
|
||||||
static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);}
|
static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);}
|
||||||
#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n))
|
#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n))
|
||||||
|
|
||||||
#define __BIT(x, n) (*(uint64*)(x)>>(n)&1)
|
|
||||||
#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n)
|
#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -230,10 +228,13 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;}
|
||||||
#define __CAP(ch) ((CHAR)((ch)&0x5f))
|
#define __CAP(ch) ((CHAR)((ch)&0x5f))
|
||||||
#define __ODD(x) ((x)&1)
|
#define __ODD(x) ((x)&1)
|
||||||
|
|
||||||
#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1))
|
//#define __IN(x, s, size) ((x)>=0 && (x)<size && ((((uint##size)(s))>>(x))&1))
|
||||||
|
|
||||||
|
#define __IN(x, s, size) (((unsigned int)(x))<size && ((((uint##size)(s))>>(x))&1))
|
||||||
#define __SETOF(x) ((SET)1<<(x))
|
#define __SETOF(x) ((SET)1<<(x))
|
||||||
#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h)))
|
#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h)))
|
||||||
#define __MASK(x, m) ((x)&~(m))
|
#define __MASK(x, m) ((x)&~(m))
|
||||||
|
#define __BIT(x, n) (*(uint64*)(x)>>(n)&1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
12 Sep 2016 17:01:41
|
13 Sep 2016 20:12:45
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue