diff --git a/README.md b/README.md index a9c0143d..e899405d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Thus, performance can be significantly improved by targeting the specific CPU vi On x86-64, a native build will enable usage of AVX2 (i.e. ability to use 256-bit SIMD vectors instead of 128-bit ones, among other things), and BMI2 if available. But, on aarch64, NEON is always available, so a native build won't give significant benefits. -To produce a binary utilizing AVX2 not specific to any processor, it's possible to do `make o3 has=avx2`. (`has='avx2 bmi2'` for targeting both AVX2 & BMI2) +To produce a binary utilizing AVX2 not specific to any processor, it's possible to do `make o3 has=avx2`. (`has=avx2,bmi2` for targeting both AVX2 & BMI2) Additionally, on AMD Zen 1 & Zen 2, `make o3n has=slow-pdep` will further improve certain builtins (Zen 1/2 support BMI2, but their implementation of `pdep`/`pext` is so slow that not using it for certain operations is very beneficial). diff --git a/build/src/build.bqn b/build/src/build.bqn index d9310be5..7ff49816 100755 --- a/build/src/build.bqn +++ b/build/src/build.bqn @@ -76,7 +76,8 @@ onExitList ← ⟨⟩ OnExit ← {𝕊: {𝕏@}¨ onExitList} _assert_ ← { 𝔾𝕩?𝕩; Log 𝕨𝔽𝕩 ⋄ OnExit@ ⋄ •Exit 1} -SepArgs ← {' ' ((¬-˜⊢×·+`»⊸>)∘≠⊔⊢) 𝕩} +Split ← ((¬-˜⊢×·+`»⊸>)∘≠⊔⊢) +SepArgs ← ' '⊸Split Lowercase ← {𝕩 - (-´"Aa")×(𝕩≥'A')∧𝕩≤'Z'} Uppercase ← {𝕩 - (-´"aA")×(𝕩≥'a')∧𝕩≤'z'} @@ -229,7 +230,7 @@ po ← { # parsed options singeli ⇐ GetOpt "singeli" replxx ⇐ GetOpt "REPLXX" - has ⇐ Lowercase GetOpt "has" + has ⇐ ∾ ','Split¨Lowercase GetOpt "has" has ↩ ∧⍷has ∾ (⊑"slow-pdep"<⊸∊has)/⋈"bmi2" {𝕊: "Error: Unsupported 'has' options; options:"∾1↓∾", "⊸∾¨𝕩}_assert_(∧´has∊⊢) "avx2"‿"bmi2"‿"pclmul"‿"slow-pdep" {𝕊: "Error: Cannot have 'has' options on architecture '"∾arch∾"'; add an argument of "∾compat⊑"arch=x86-64"‿"target_arch=x86-64"}_assert_¬ (arch≢"x86-64") ∧ 0≠≠has