move SIMD constrep functions to a table

This commit is contained in:
dzaima 2023-05-08 14:15:28 +03:00
parent 0598ce8357
commit 300d217ee8
2 changed files with 3 additions and 4 deletions

View File

@ -829,11 +829,11 @@ B slash_c2(B t, B w, B x) {
void* rv = m_tyarrv(&r, 1<<xk, s, xt);
void* xv = tyany_ptr(x);
#if SINGELI_AVX2
#define CASE(L,T) case L: constrep_##T(wv, xv, rv, xlen); break;
simd_constrep[xk](wv, xv, rv, xlen);
#else
#define CASE(L,T) case L: { REP_BY_SCAN(T, wv) break; }
#endif
switch (xk) { default: UD; CASE(0,u8) CASE(1,u16) CASE(2,u32) CASE(3,u64) }
#endif
#undef CASE
}
if (xr > 1) {

View File

@ -180,5 +180,4 @@ fn rep_const{T}(wv:u64, x:*void, r:*void, n:u64) : void = {
}
}
export{'constrep_u8', rep_const{i8 }}; export{'constrep_u16', rep_const{i16}}
export{'constrep_u32', rep_const{i32}}; export{'constrep_u64', rep_const{u64}}
exportT{'simd_constrep', each{rep_const, tup{i8, i16, i32, u64}}}