diff --git a/build/src/build.bqn b/build/src/build.bqn index e8c4981d..19c0856b 100755 --- a/build/src/build.bqn +++ b/build/src/build.bqn @@ -694,10 +694,12 @@ cachedBin‿linkerCache ← { •file.Name ga, ⟨⟩ ⟩ - singeliArgs ← po.singeliFlags∾⟨"-l", "gen="∾AtRoot singeliCache.folder, "-c", "usz=u"∾•Repr po.usz⟩∾{ - po.native? ⟨⟩; - "-a" ⋈ 1↓∾ ','⊸∾¨ po.singeliArch - } + singeliArgs ← ∾⟨ + po.singeliFlags + ⟨"-l", "gen="∾AtRoot singeliCache.folder, "-c", "usz=u"∾•Repr po.usz⟩ + (⊑"slow-pdep"<⊸∊po.has)/⟨"-c", "SLOW_PDEP=1"⟩ + {po.native? ⟨⟩; "-a" ⋈ 1↓∾ ','⊸∾¨ po.singeliArch} + ⟩ {𝕊: "Singeli args: "∾•Repr singeliArgs} _verboseLog @ {𝕊: "Singeli-required C args: "∾•Repr po.siCFlags; @} _verboseLog @ singeliObjs ↩ {MakeSingeliInv ⟨singeliArgs, {𝕊:UpdateSubmodule po.singeliDir}, singeliCache, 𝕩, "src/singeli/src/"•file.At 𝕩∾".singeli", (𝕩≡"dyarith")/⟨gaRule⟩⟩}¨ 1⊑¨singeliMap diff --git a/src/singeli/src/base.singeli b/src/singeli/src/base.singeli index 68ded7f3..d5e11120 100644 --- a/src/singeli/src/base.singeli +++ b/src/singeli/src/base.singeli @@ -5,6 +5,7 @@ include 'util/kind' def ux = u64 config usz = u32 +config SLOW_PDEP = 0 def same = is oper ~~ reinterpret infix right 55 @@ -157,6 +158,7 @@ def base{b,l} = if (0==tuplen{l}) 0 else tupsel{0,l}+b*base{b,slice{l,1}} # vector definitions def arch_defvw = if (hasarch{'AVX2'}) 256 else 128 def has_simd = hasarch{'X86_64'} | hasarch{'AARCH64'} +def fast_BMI2{} = if (SLOW_PDEP) 0 else hasarch{'BMI2'} # test if vector has a specific width & element type def lvec{T, n, w} = 0 diff --git a/src/singeli/src/slash.singeli b/src/singeli/src/slash.singeli index 937d5ec3..e66b97fa 100644 --- a/src/singeli/src/slash.singeli +++ b/src/singeli/src/slash.singeli @@ -359,9 +359,9 @@ def pext_popc{x0:V, m0:V & hasarch{'PCLMUL'} & V==[2]u64} = { tup{x, @collect (j to 2) popc{extract{m0,j}}} } -def pext_width {& hasarch{'BMI2'}} = 1 -def thresh_bool{& hasarch{'BMI2'}} = 512 -def pext_popc{x:T, m:T & hasarch{'BMI2'} & T==u64} = tup{pext{x, m}, popc{m}} +def pext_width {& fast_BMI2{}} = 1 +def thresh_bool{& fast_BMI2{}} = 512 +def pext_popc{x:T, m:T & fast_BMI2{} & T==u64} = tup{pext{x, m}, popc{m}} fn compress_bool(w:*u64, x:*u64, r:*u64, n:u64) : void = { cw:u64 = 0; # current word