more BMI and NEON defs
This commit is contained in:
parent
bda9245ac3
commit
09f2980ebf
11
src/singeli/src/bmi.singeli
Normal file
11
src/singeli/src/bmi.singeli
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
def x86_tzcnt{x:T if (T==u16 or T==u32 or T==u64) and hasarch{'BMI' }} = emit{T, merge{'_tzcnt_u',fmtnat{width{T}}}, x}
|
||||||
|
def x86_lzcnt{x:T if ( T==u32 or T==u64) and hasarch{'LZCNT'}} = emit{T, merge{'_lzcnt_u',fmtnat{width{T}}}, x}
|
||||||
|
|
||||||
|
def pdep{x:T, m:T==u64 if hasarch{'BMI2'}} = emit{T, '_pdep_u64', x, m}
|
||||||
|
def pdep{x:T, m:T==u32 if hasarch{'BMI2'}} = emit{T, '_pdep_u32', x, m}
|
||||||
|
def pext{x:T, m:T==u64 if hasarch{'BMI2'}} = emit{T, '_pext_u64', x, m}
|
||||||
|
def pext{x:T, m:T==u32 if hasarch{'BMI2'}} = emit{T, '_pext_u32', x, m}
|
||||||
|
|
||||||
|
# only low 8 bits of n matter, so any int is fine
|
||||||
|
def bzhi{x:T==u64, n if any_int{n} and hasarch{'BMI2'}} = emit{T, '_bzhi_u64', x, n}
|
||||||
|
def bzhi{x:T==u32, n if any_int{n} and hasarch{'BMI2'}} = emit{T, '_bzhi_u32', x, n}
|
||||||
@ -1,4 +0,0 @@
|
|||||||
def pdep{x:T, m:T==u64} = emit{T, '_pdep_u64', x, m}
|
|
||||||
def pdep{x:T, m:T==u32} = emit{T, '_pdep_u32', x, m}
|
|
||||||
def pext{x:T, m:T==u64} = emit{T, '_pext_u64', x, m}
|
|
||||||
def pext{x:T, m:T==u32} = emit{T, '_pext_u32', x, m}
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
include './base'
|
include './base'
|
||||||
include './mask'
|
include './mask'
|
||||||
if_inline (hasarch{'BMI2'}) include './bmi2'
|
if_inline (hasarch{'BMI2'}) include './bmi'
|
||||||
include './spaced'
|
include './spaced'
|
||||||
include './scan_common'
|
include './scan_common'
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,8 @@ def addhn{a:V, b:V if w128i{V}} = emit{el_h{V}, ntyp0{'vaddhn', V}, a, b}
|
|||||||
def subhn{a:V, b:V if w128i{V}} = emit{el_h{V}, ntyp0{'vsubhn', V}, a, b}
|
def subhn{a:V, b:V if w128i{V}} = emit{el_h{V}, ntyp0{'vsubhn', V}, a, b}
|
||||||
def addhn_upper{lo:L=[k]RE, a:V=[k]XE, b:V if w128i{V} and w64i{L} and eqqi{RE,XE}} = emit{[k*2]RE, ntyp0{'vaddhn_high', V}, lo, a, b}
|
def addhn_upper{lo:L=[k]RE, a:V=[k]XE, b:V if w128i{V} and w64i{L} and eqqi{RE,XE}} = emit{[k*2]RE, ntyp0{'vaddhn_high', V}, lo, a, b}
|
||||||
def subhn_upper{lo:L=[k]RE, a:V=[k]XE, b:V if w128i{V} and w64i{L} and eqqi{RE,XE}} = emit{[k*2]RE, ntyp0{'vsubhn_high', V}, lo, a, b}
|
def subhn_upper{lo:L=[k]RE, a:V=[k]XE, b:V if w128i{V} and w64i{L} and eqqi{RE,XE}} = emit{[k*2]RE, ntyp0{'vsubhn_high', V}, lo, a, b}
|
||||||
|
def raddhn{a:V, b:V if w128i{V}} = emit{el_h{V}, ntyp0{'vraddhn', V}, a, b}
|
||||||
|
def rsubhn{a:V, b:V if w128i{V}} = emit{el_h{V}, ntyp0{'vrsubhn', V}, a, b}
|
||||||
|
|
||||||
# pairwise min/max
|
# pairwise min/max
|
||||||
def minp{a:V, b:V if w128i{V}} = emit{V, ntyp{'vpmin', V}, a, b}
|
def minp{a:V, b:V if w128i{V}} = emit{V, ntyp{'vpmin', V}, a, b}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
include './base'
|
include './base'
|
||||||
if_inline (hasarch{'X86_64'}) {
|
if_inline (hasarch{'X86_64'}) {
|
||||||
if_inline (hasarch{'PCLMUL'}) include './clmul'
|
if_inline (hasarch{'PCLMUL'}) include './clmul'
|
||||||
if_inline (hasarch{'BMI2'}) include './bmi2'
|
if_inline (hasarch{'BMI2'}) include './bmi'
|
||||||
}
|
}
|
||||||
include './mask'
|
include './mask'
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user