Add has='pclmul' option and avoid using broadcast
This commit is contained in:
parent
871a81ca5f
commit
03d8919307
@ -216,7 +216,7 @@ po ← { # parsed options
|
|||||||
|
|
||||||
has ⇐ Lowercase GetOpt "has"
|
has ⇐ Lowercase GetOpt "has"
|
||||||
has ↩ ∧⍷has ∾ (⊑"slow-pdep"<⊸∊has)/⋈"bmi2"
|
has ↩ ∧⍷has ∾ (⊑"slow-pdep"<⊸∊has)/⋈"bmi2"
|
||||||
{𝕊: "Error: Unsupported 'has' options; options:"∾1↓∾", "⊸∾¨𝕩}_assert_(∧´has∊⊢) "avx2"‿"bmi2"‿"slow-pdep"
|
{𝕊: "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
|
{𝕊: "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
|
||||||
|
|
||||||
avx2 ⇐ (arch≡"x86-64") ∧ singeli ∧ native ∨ ⊑"avx2"<⊸∊has
|
avx2 ⇐ (arch≡"x86-64") ∧ singeli ∧ native ∨ ⊑"avx2"<⊸∊has
|
||||||
@ -672,7 +672,7 @@ cachedBin‿linkerCache ← {
|
|||||||
|
|
||||||
singeliArgs ← po.singeliFlags∾⟨"-l", "gen="∾AtRoot singeliCache.folder, "-c", "usz=u"∾•Repr po.usz⟩∾{
|
singeliArgs ← po.singeliFlags∾⟨"-l", "gen="∾AtRoot singeliCache.folder, "-c", "usz=u"∾•Repr po.usz⟩∾{
|
||||||
po.native? ⟨⟩;
|
po.native? ⟨⟩;
|
||||||
"-a" ⋈ ({"x86-64":"X86_64"; "aarch64":"AARCH64"; "none"} po.arch) ∾ ∾ ','⊸∾¨ Uppercase ∊⟜"avx2"‿"bmi2"⊸/po.has
|
"-a" ⋈ ({"x86-64":"X86_64"; "aarch64":"AARCH64"; "none"} po.arch) ∾ ∾ ','⊸∾¨ Uppercase ∊⟜"avx2"‿"bmi2"‿"pclmul"⊸/po.has
|
||||||
}
|
}
|
||||||
{𝕊: "Singeli args: "∾•Repr singeliArgs} _verboseLog @
|
{𝕊: "Singeli args: "∾•Repr singeliArgs} _verboseLog @
|
||||||
singeliObjs ↩ {MakeSingeliInv ⟨singeliArgs, {𝕊:UpdateSubmodule po.singeliDir}, singeliCache, 𝕩, "src/singeli/src/"•file.At 𝕩∾".singeli", (𝕩≡"dyarith")/⟨gaRule⟩⟩}¨ 1⊑¨singeliMap
|
singeliObjs ↩ {MakeSingeliInv ⟨singeliArgs, {𝕊:UpdateSubmodule po.singeliDir}, singeliCache, 𝕩, "src/singeli/src/"•file.At 𝕩∾".singeli", (𝕩≡"dyarith")/⟨gaRule⟩⟩}¨ 1⊑¨singeliMap
|
||||||
|
|||||||
@ -110,11 +110,11 @@ fn pext{T}(x:T, m:T) {
|
|||||||
|
|
||||||
fn pext{T & hasarch{'PCLMUL'} & T==u64}(xs:T, ms:T) {
|
fn pext{T & hasarch{'PCLMUL'} & T==u64}(xs:T, ms:T) {
|
||||||
def num = lb{width{T}}
|
def num = lb{width{T}}
|
||||||
def V = [2]T
|
def vec{s} = make{[2]T, s, 0}
|
||||||
m := V**ms
|
m := vec{ms}
|
||||||
x := V**xs & m
|
x := vec{xs} & m
|
||||||
d := ~m << 1 # One bit of the position difference at x
|
d := ~m << 1 # One bit of the position difference at x
|
||||||
c := V**(1<<64-1)
|
c := vec{1<<64-1}
|
||||||
@unroll (i to num) {
|
@unroll (i to num) {
|
||||||
def sh = 1 << i
|
def sh = 1 << i
|
||||||
def shift_at{v, s} = { v = (v&~s) | (v&s)>>sh }
|
def shift_at{v, s} = { v = (v&~s) | (v&s)>>sh }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user