From e72c7dc9376caf281d9407d9b986a26fcc7029b7 Mon Sep 17 00:00:00 2001 From: dzaima Date: Thu, 1 Sep 2022 15:59:26 +0300 Subject: [PATCH] =?UTF-8?q?faster=20=C3=B7=20=E2=8B=86=20=E2=88=9A=20|=20?= =?UTF-8?q?=E2=8B=86=E2=81=BC=20on=20i8=20&=20i16=20arrays?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/arithd.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/builtins/arithd.c b/src/builtins/arithd.c index 591411da..ad52611a 100644 --- a/src/builtins/arithd.c +++ b/src/builtins/arithd.c @@ -24,40 +24,42 @@ static f64 pfmod(f64 a, f64 b) { #define GC2f(SYMB, NAME, EXPR, EXTRA) B NAME##_c2(B t, B w, B x) { \ if (isF64(w) & isF64(x)) return m_f64(EXPR); \ EXTRA \ - if (isArr(w)|isArr(x)) { B ow=w; B ox=x; \ + if (isArr(w)|isArr(x)) { \ if (isArr(w)&isArr(x) && RNK(w)==RNK(x)) { \ if (!eqShPart(SH(w), SH(x), RNK(w))) thrF(SYMB ": Expected equal shape prefix (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", w, x); \ usz ia = IA(x); \ u8 we = TI(w,elType); \ u8 xe = TI(x,elType); \ - if ((we==el_i32|we==el_f64)&(xe==el_i32|xe==el_f64)) { \ + if (elNum(we) && elNum(xe)) { \ + if (we