Add clmul.singeli
This commit is contained in:
parent
301a23fb1f
commit
77188b8e73
@ -209,6 +209,7 @@ def extract{...x} = assert{'extract not supported', show{...x}}
|
|||||||
def abs{...x} = assert{'abs not supported', show{...x}}
|
def abs{...x} = assert{'abs not supported', show{...x}}
|
||||||
def homBlend{...x} = assert{'homBlend not supported', show{...x}}
|
def homBlend{...x} = assert{'homBlend not supported', show{...x}}
|
||||||
def zip{...x} = assert{'zip not supported', show{...x}}
|
def zip{...x} = assert{'zip not supported', show{...x}}
|
||||||
|
def clmul{...x} = assert{'clmul not supported', show{...x}}
|
||||||
|
|
||||||
def andnot{a, b & anyNum{a} & anyNum{b}} = a & ~b
|
def andnot{a, b & anyNum{a} & anyNum{b}} = a & ~b
|
||||||
oper &~ andnot infix none 35
|
oper &~ andnot infix none 35
|
||||||
|
|||||||
2
src/singeli/src/clmul.singeli
Normal file
2
src/singeli/src/clmul.singeli
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
def clmul{a:T, b:T, imm & w128i{T}} = emit{T, '_mm_clmulepi64_si128', a, b, imm}
|
||||||
|
def clmul{a, b} = clmul{a, b, 0}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
include './base'
|
include './base'
|
||||||
include './sse'
|
include './sse'
|
||||||
|
include './clmul'
|
||||||
|
|
||||||
def clmul{a:T, b:T, imm & w128i{T}} = emit{T, '_mm_clmulepi64_si128', a, b, imm}
|
|
||||||
def unpacklo{a:T,b:T & T==[2]u64} = emit{T, '_mm_unpacklo_epi64', a, b}
|
def unpacklo{a:T,b:T & T==[2]u64} = emit{T, '_mm_unpacklo_epi64', a, b}
|
||||||
|
|
||||||
fn clmul_scan_ne_any(x:*void, r:*void, init:u64, words:u64, mark:u64) : void = {
|
fn clmul_scan_ne_any(x:*void, r:*void, init:u64, words:u64, mark:u64) : void = {
|
||||||
|
|||||||
@ -1,19 +1,8 @@
|
|||||||
include './base'
|
include './base'
|
||||||
if (hasarch{'BMI2'}) {
|
if (hasarch{'X86_64'}) include './sse'
|
||||||
include './bmi2'
|
if (hasarch{'PCLMUL'}) include './clmul'
|
||||||
}
|
if (hasarch{'AVX2'}) { include './avx'; include './avx2' }
|
||||||
if (hasarch{'X86_64'}) {
|
if (hasarch{'BMI2'}) include './bmi2'
|
||||||
include './sse'
|
|
||||||
}
|
|
||||||
if (hasarch{'PCLMUL'}) {
|
|
||||||
def clmul{a:T, b:T, imm & w128i{T}} = emit{T, '_mm_clmulepi64_si128', a, b, imm}
|
|
||||||
} else {
|
|
||||||
def clmul{...x} = assert{'clmul not supported', show{...x}}
|
|
||||||
}
|
|
||||||
if (hasarch{'AVX2'}) {
|
|
||||||
include './avx'
|
|
||||||
include './avx2'
|
|
||||||
}
|
|
||||||
if (hasarch{'AVX512F'}) {
|
if (hasarch{'AVX512F'}) {
|
||||||
local def mti{s,T} = merge{'_mm512_',s,'_epi',fmtnat{elwidth{T}}}
|
local def mti{s,T} = merge{'_mm512_',s,'_epi',fmtnat{elwidth{T}}}
|
||||||
def load{a:T, n & 512==width{eltype{T}}} = emit{eltype{T}, '_mm512_loadu_si512', a+n}
|
def load{a:T, n & 512==width{eltype{T}}} = emit{eltype{T}, '_mm512_loadu_si512', a+n}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user