diff --git a/src/builtins/internal.c b/src/builtins/internal.c index 540220cf..15eaea27 100644 --- a/src/builtins/internal.c +++ b/src/builtins/internal.c @@ -8,7 +8,6 @@ B itype_c1(B t, B x) { r = m_str8l(format_type(v(x)->type)); } else { if (isF64(x)) r = m_str32(U"tagged f64"); - else if (isI32(x)) r = m_str32(U"tagged i32"); else if (isC32(x)) r = m_str32(U"tagged c32"); else if (isTag(x)) r = m_str32(U"tagged tag"); else if (isVar(x)) r = m_str32(U"tagged var"); diff --git a/src/builtins/sysfn.c b/src/builtins/sysfn.c index bc4a663e..e84afb62 100644 --- a/src/builtins/sysfn.c +++ b/src/builtins/sysfn.c @@ -16,7 +16,6 @@ B type_c1(B t, B x) { i32 r = -1; if (isArr(x)) r = 0; - else if (isI32(x)) r = 1; else if (isF64(x)) r = 1; else if (isC32(x)) r = 2; else if (isFun(x)) r = 3; diff --git a/src/core/fillarr.c b/src/core/fillarr.c index 5f706f4c..57242a96 100644 --- a/src/core/fillarr.c +++ b/src/core/fillarr.c @@ -25,7 +25,7 @@ B asFill(B x) { // consumes if (noFill) { ptr_dec(r.c); return bi_noFill; } return withFill(r.b, xf); } - if (isF64(x)|isI32(x)) return m_i32(0); + if (isF64(x)) return m_i32(0); if (isC32(x)) return m_c32(' '); dec(x); return bi_noFill; diff --git a/src/core/fillarr.h b/src/core/fillarr.h index d7498de5..ecfd71d4 100644 --- a/src/core/fillarr.h +++ b/src/core/fillarr.h @@ -38,7 +38,7 @@ static B getFillR(B x) { // doesn't consume; can return bi_noFill return bi_noFill; } } - if (isF64(x)|isI32(x)) return m_i32(0); + if (isNum(x)) return m_i32(0); if (isC32(x)) return m_c32(' '); return bi_noFill; } diff --git a/src/core/stuff.c b/src/core/stuff.c index 02163f87..863255e5 100644 --- a/src/core/stuff.c +++ b/src/core/stuff.c @@ -113,8 +113,6 @@ NOINLINE void print(B x) { if ((u32)x.u>=32) { printf("'"); printUTF8((u32)x.u); printf("'"); } else if((u32)x.u>15) printf("\\x%x", (u32)x.u); else printf("\\x0%x", (u32)x.u); - } else if (isI32(x)) { - printf("%d", (i32)x.u); } else if (isVal(x)) { #ifdef DEBUG if (isVal(x) && (v(x)->type==t_freed || v(x)->type==t_empty)) { diff --git a/src/h.h b/src/h.h index c33b3468..4e590910 100644 --- a/src/h.h +++ b/src/h.h @@ -52,7 +52,6 @@ // #define RT_VERIFY // compare native and runtime versions of primitives // #define NO_RT // whether to completely disable self-hosted runtime loading // #define PRECOMP // execute just precompiled code at src/gen/interp -// #define ATOM_I32 // not a thing; ignore pls #ifdef __OpenBSD__ @@ -137,7 +136,6 @@ static const u16 C32_TAG = 0b0111111111110001; // 7FF1 0111111111110001......... static const u16 TAG_TAG = 0b0111111111110010; // 7FF2 0111111111110010................nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn special value (0=nothing, 1=undefined var, 2=bad header; 3=optimized out; 4=error?; 5=no fill) static const u16 VAR_TAG = 0b0111111111110011; // 7FF3 0111111111110011ddddddddddddddddnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn variable reference static const u16 EXT_TAG = 0b0111111111110100; // 7FF4 0111111111110100ddddddddddddddddnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn extended variable reference -static const u16 I32_TAG = 0b0111111111110111; // 7FF7 0111111111110111................nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 32-bit int; unused static const u16 MD1_TAG = 0b1111111111110010; // FFF2 1111111111110010ppppppppppppppppppppppppppppppppppppppppppppp000 1-modifier static const u16 MD2_TAG = 0b1111111111110011; // FFF3 1111111111110011ppppppppppppppppppppppppppppppppppppppppppppp000 2-modifier static const u16 FUN_TAG = 0b1111111111110100; // FFF4 1111111111110100ppppppppppppppppppppppppppppppppppppppppppppp000 function @@ -302,11 +300,6 @@ void print_vmStack(void); NORETURN NOINLINE void err(char* s); // tag checks -#ifdef ATOM_I32 -static inline bool isI32(B x) { return (x.u>>48) == I32_TAG; } -#else -static inline bool isI32(B x) { return false; } -#endif static inline bool isFun(B x) { return (x.u>>48) == FUN_TAG; } static inline bool isArr(B x) { return (x.u>>48) == ARR_TAG; } static inline bool isC32(B x) { return (x.u>>48) == C32_TAG; } @@ -322,7 +315,7 @@ static inline bool isObj(B x) { return (x.u>>48) == OBJ_TAG; } // static inline bool isF64(B x) { return ((x.u>>51&0xFFF) != 0xFFE) | ((x.u<<1)==(b(1.0/0.0).u<<1)); } static inline bool isVal(B x) { return (x.u - (((u64)VAL_TAG<<51) + 1)) < ((1ull<<51) - 1); } // ((x.u>>51) == VAL_TAG) & ((x.u<<13) != 0); static inline bool isF64(B x) { return (x.u<<1) - ((0xFFEull<<52) + 2) >= (1ull<<52) - 2; } -static inline bool isNum(B x) { return isF64(x)|isI32(x); } +static inline bool isNum(B x) { return isF64(x); } static inline bool isAtm(B x) { return !isArr(x); } static inline bool isCallable(B x) { return isMd(x) | isFun(x); } @@ -331,11 +324,7 @@ static inline bool noFill(B x) { return x.u == bi_noFill.u; } // make objects static B m_f64(f64 n) { assert(isF64(b(n))); return b(n); } // assert just to make sure we're actually creating a float static B m_c32(u32 n) { return tag(n, C32_TAG); } // TODO check validity? -#ifdef ATOM_I32 -static B m_i32(i32 n) { return tag(n, I32_TAG); } -#else static B m_i32(i32 n) { return m_f64(n); } -#endif static B m_usz(usz n) { return n