Replace top-level if with if_inline
This commit is contained in:
parent
526d9bbebe
commit
12d7629f9c
@ -185,13 +185,13 @@ def homMask{...vs & tuplen{vs}>1} = {
|
||||
(b<<(n/2 * vcount{T})) | a
|
||||
}
|
||||
|
||||
if (hasarch{'X86_64'}) {
|
||||
if_inline (hasarch{'X86_64'}) {
|
||||
include 'arch/iintrinsic/basic'
|
||||
include './sse2'
|
||||
include './sse'
|
||||
include './avx'
|
||||
include './avx2'
|
||||
} else if (hasarch{'AARCH64'}) {
|
||||
} else if_inline (hasarch{'AARCH64'}) {
|
||||
include 'arch/neon_intrin/basic'
|
||||
include './neon'
|
||||
} else {
|
||||
|
||||
@ -40,7 +40,7 @@ fn max_scan{T, up}(x:*T, len:u64) : void = {
|
||||
}
|
||||
|
||||
def getsel{...x} = assert{'shuffling not supported', show{...x}}
|
||||
if (hasarch{'AVX2'}) {
|
||||
if_inline (hasarch{'AVX2'}) {
|
||||
def getsel{h:H & lvec{H, 16, 8}} = {
|
||||
sel{H, pair{h,h}, .}
|
||||
}
|
||||
@ -295,7 +295,7 @@ def bin_search_vec{prim, T, w:*T, wn, x:*T, xn, rp, maxwn & hasarch{'AVX2'}} = {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasarch{'AVX2'}) {
|
||||
if_inline (hasarch{'AVX2'}) {
|
||||
fn avx2_search_bin{prim, T, maxwn}(rp:*(if (prim=='∊') u64 else i8), w:*void, wn:u64, x:*void, xn:u64) : void = {
|
||||
bin_search_vec{prim, T, *T~~w, wn, *T~~x, xn, rp, maxwn}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ include './base'
|
||||
include 'util/tup'
|
||||
include './vecfold'
|
||||
|
||||
if (hasarch{'SSE2'}) {
|
||||
if_inline (hasarch{'SSE2'}) {
|
||||
fn sum_vec{T}(v:T) = vfold{+, fold{+, unpackQ{v, T**0}}}
|
||||
def fold_addw{v:T & eltype{T}==i8} = sum_vec{T}(v)
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ def hash_val{x0:(u64)} = {
|
||||
x ^= x >> 33; x
|
||||
}
|
||||
# CRC32
|
||||
if (hasarch{'SSE4.2'}) require{'x86intrin.h'}
|
||||
if_inline (hasarch{'SSE4.2'}) require{'x86intrin.h'}
|
||||
def hash_val{x:(u32) & hasarch{'SSE4.2'}} = {
|
||||
emit{u32, '_mm_crc32_u32', 0x973afb51, x}
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ exportT{'si_replicate_scan', flat_table{rep_by_scan, ind_types, dat_types}}
|
||||
|
||||
|
||||
# Constant replicate
|
||||
if (not (hasarch{'AVX2'} | hasarch{'AARCH64'})) {
|
||||
if_inline (not (hasarch{'AVX2'} | hasarch{'AARCH64'})) {
|
||||
|
||||
fn rep_const{T}(wv:u64, x:*void, r:*void, n:u64) : void = {
|
||||
rep_by_scan{T, cast_i{usz,wv}, x, r, cast_i{usz, wv*n}}
|
||||
@ -148,7 +148,7 @@ def rep_const_shuffle{V, wv, onreps, xv:*V, rv:*V, n:(u64)} = { # onreps{inputVe
|
||||
}
|
||||
}
|
||||
|
||||
if (hasarch{'AVX2'}) {
|
||||
if_inline (hasarch{'AVX2'}) {
|
||||
def rep_iter_from_sh{sh}{x, gen} = {
|
||||
def l = tuplen{sh}
|
||||
def h = l>>1
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include './base'
|
||||
if (hasarch{'X86_64'}) {
|
||||
if (hasarch{'PCLMUL'}) include './clmul'
|
||||
if (hasarch{'AVX512BW', 'VPCLMULQDQ', 'GFNI'}) include './avx512'
|
||||
if_inline (hasarch{'X86_64'}) {
|
||||
if_inline (hasarch{'PCLMUL'}) include './clmul'
|
||||
if_inline (hasarch{'AVX512BW', 'VPCLMULQDQ', 'GFNI'}) include './avx512'
|
||||
}
|
||||
include './mask'
|
||||
include './f64'
|
||||
|
||||
@ -60,7 +60,7 @@ fn copyOrdered{}(r:*f64, x:*f64, len:u64) : u1 = {
|
||||
0
|
||||
}
|
||||
|
||||
if (hasarch{'X86_64'} | hasarch{'AARCH64'}) {
|
||||
if_inline (hasarch{'X86_64'} | hasarch{'AARCH64'}) {
|
||||
export{'simd_search_u8', searchOne{u64, u8}}
|
||||
export{'simd_search_u16', searchOne{u64, u16}}
|
||||
export{'simd_search_u32', searchOne{u64, u32}}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
if (hasarch{'AVX2'}) {
|
||||
if_inline (hasarch{'AVX2'}) {
|
||||
|
||||
include './base'
|
||||
include './cbqnDefs'
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
include './base'
|
||||
if (hasarch{'X86_64'}) {
|
||||
if (hasarch{'PCLMUL'}) include './clmul'
|
||||
if (hasarch{'BMI2'}) include './bmi2'
|
||||
if (hasarch{'AVX512F'}) include './avx512'
|
||||
if_inline (hasarch{'X86_64'}) {
|
||||
if_inline (hasarch{'PCLMUL'}) include './clmul'
|
||||
if_inline (hasarch{'BMI2'}) include './bmi2'
|
||||
if_inline (hasarch{'AVX512F'}) include './avx512'
|
||||
}
|
||||
include './mask'
|
||||
include 'util/tup'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user