diff --git a/src/builtins/slash.c b/src/builtins/slash.c index 92af67d2..302320c9 100644 --- a/src/builtins/slash.c +++ b/src/builtins/slash.c @@ -850,12 +850,22 @@ B slash_im(B t, B x) { rp[sum>0] = sum; rp[0] = xia - sum; r = num_squeeze(r); break; } -#define TRY_SMALL_OUT(N) \ +#if SINGELI_SIMD + #define TRY_SMALL_OUT(N) \ if (xp[0]<0) thrM("/⁼: Argument cannot contain negative numbers"); \ usz a=1; while (axp[a-1]) a++; \ u##N max=xp[a-1]; \ if (amax) max=c; } \ if ((i##N)max<0) thrM("/⁼: Argument cannot contain negative numbers"); \ usz ria = max + 1; \ @@ -877,79 +887,60 @@ B slash_im(B t, B x) { break; \ } \ usz ria = (usz)max + 1; -#define INIT_RES(N) \ + #define INIT_RES(N) \ i##N* rp; r = m_i##N##arrv(&rp, ria); \ for (usz i=0; im/2) thrM("/⁼: Argument cannot contain negative numbers"); - #define HAS_SINGELI_COUNT_SORTED 0 - #define SINGELI_COUNT_SORTED(N) -#endif CASE_SMALL(8) CASE_SMALL(16) -#undef CASE_SMALL -#undef RIA_SMALL -#undef SINGELI_COUNT_ALLOC -#undef SINGELI_COUNT + #undef CASE_SMALL case el_i32: { i32* xp = i32any_ptr(x); TRY_SMALL_OUT(32) INIT_RES(32) -#if SINGELI_SIMD simd_count_i32_i32(rp, xp, xia); -#else - FILL_RES -#endif r = num_squeeze(r); break; } -#undef TRY_SMALL_OUT -#undef INIT_RES -#undef FILL_RES + #undef TRY_SMALL_OUT + #undef INIT_RES + #undef FILL_RES +#else + #define CASE(N) case el_i##N: { \ + i##N* xp = i##N##any_ptr(x); \ + u##N max=xp[0]; \ + for (usz i=1; imax) max=c; } \ + if ((i##N)max<0) thrM("/⁼: Argument cannot contain negative numbers"); \ + usz ria = max + 1; \ + TALLOC(usz, t, ria); \ + for (usz j=0; j