move atomEqual around

This commit is contained in:
dzaima 2021-05-24 18:25:18 +03:00
parent f24ee7674d
commit 8dc1ffd7c3
3 changed files with 9 additions and 7 deletions

View File

@ -228,11 +228,7 @@ NOINLINE i32 compareR(B w, B x) {
}
#undef CMP
bool atomEqual(B w, B x) { // doesn't consume (not that that matters really currently)
if(isF64(w)&isF64(x)) return w.f==x.f;
if (w.u==x.u) return true;
if (!isVal(w) | !isVal(x)) return false;
NOINLINE bool atomEqualR(B w, B x) {
if (v(w)->type!=v(x)->type) return false;
B2B dcf = TI(w).decompose;
if (dcf == def_decompose) return false;
@ -245,7 +241,7 @@ bool atomEqual(B w, B x) { // doesn't consume (not that that matters really curr
{ dec(wd);dec(xd); return false; }
dec(wd);dec(xd); return true;
}
bool equal(B w, B x) { // doesn't consume
NOINLINE bool equal(B w, B x) { // doesn't consume
bool wa = isAtm(w);
bool xa = isAtm(x);
if (wa!=xa) return false;

View File

@ -166,6 +166,13 @@ static i32 compare(B w, B x) { // doesn't consume; -1 if w<x, 1 if w>x, 0 if w
}
#undef CMP
NOINLINE bool atomEqualR(B w, B x);
static bool atomEqual(B w, B x) { // doesn't consume (not that that matters really currently)
if(isF64(w)&isF64(x)) return w.f==x.f;
if (w.u==x.u) return true;
if (!isVal(w) | !isVal(x)) return false;
return atomEqualR(w, x);
}

View File

@ -265,7 +265,6 @@ void print(B x); // doesn't consume
void arr_print(B x); // doesn't consume
bool equal(B w, B x); // doesn't consume
bool eequal(B w, B x); // doesn't consume
bool atomEqual(B w, B x); // doesn't consume
u64 depth(B x); // doesn't consume
B toCells(B x); // consumes
B toKCells(B x, ur k); // consumes