separate arith inits, add comments on init order

This commit is contained in:
dzaima 2023-05-06 22:05:48 +03:00
parent 7618dce2f3
commit 3ae9b14d64
3 changed files with 11 additions and 3 deletions

View File

@ -516,3 +516,7 @@ B lcm_c2(B t, B w, B x) {
}
#undef P2
void arithd_init() {
}

View File

@ -176,12 +176,12 @@ B getMathNS(void) {
return incG(mathNS);
}
void arith_init(void) {
void arithm_init(void) {
c(BFn,bi_add)->ident = c(BFn,bi_sub)->ident = c(BFn,bi_or )->ident = c(BFn,bi_ne)->ident = c(BFn,bi_gt)->ident = m_i32(0);
c(BFn,bi_mul)->ident = c(BFn,bi_div)->ident = c(BFn,bi_and)->ident = c(BFn,bi_eq)->ident = c(BFn,bi_ge)->ident = c(BFn,bi_pow)->ident = c(BFn,bi_not)->ident = m_i32(1);
c(BFn,bi_floor)->ident = m_f64(1.0/0.0);
c(BFn,bi_ceil )->ident = m_f64(-1.0/0.0);
#define INVERSE_PAIR(F,G) \
c(BFn,bi_##F)->im = G##_c1; \
c(BFn,bi_##G)->im = F##_c1;

View File

@ -8,7 +8,11 @@
#define PRECOMPILED_FILE1(X) PRECOMPILED_FILE0(X)
#define PRECOMPILED_FILE(END) PRECOMPILED_FILE1(../build/BYTECODE_DIR/gen/END)
#define FOR_INIT(F) F(base) F(harr) F(mutF) F(cmpA) F(fillarr) F(tyarr) F(hash) F(sfns) F(fns) F(arith) F(md1) F(md2) F(derv) F(comp) F(rtWrap) F(ns) F(nfn) F(sysfn) F(inverse) F(slash) F(search) F(transp) F(load) F(sysfnPost) F(dervPost) F(ryu) F(ffi) F(mmap) F(typesFinished)
#define FOR_INIT(F) \
/* initialize primary things */ F(base) F(harr) F(mutF) F(cmpA) F(fillarr) F(tyarr) F(hash) F(sfns) F(fns) F(arithm) F(arithd) F(md1) F(md2) F(derv) F(comp) F(rtWrap) F(ns) F(nfn) F(sysfn) F(inverse) F(slash) F(search) F(transp) F(ryu) F(ffi) F(mmap) \
/* first thing that executes BQN code (the precompiled stuff) */ F(load) \
/* precompiled stuff loaded; init things that need it */ F(sysfnPost) F(dervPost) F(typesFinished)
#define F(X) NOINLINE void X##_init(void);
FOR_INIT(F)
#undef F