[abm] check generated assembly

This commit is contained in:
gnzlbg 2017-09-19 21:11:06 +02:00 committed by Andrew Gallant
parent 9483950d3e
commit cb1db00983
4 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,12 @@
_lzcnt_u32:
pushq %rbp
movq %rsp, %rbp
lzcntl %edi, %eax
popq %rbp
retq
_lzcnt_u64:
pushq %rbp
movq %rsp, %rbp
lzcntq %rdi, %rax
popq %rbp
retq

View file

@ -0,0 +1,11 @@
extern crate stdsimd;
#[no_mangle]
pub fn lzcnt_u32(x: u32) -> u32 {
stdsimd::vendor::_lzcnt_u32(x)
}
#[no_mangle]
pub fn lzcnt_u64(x: u64) -> u64 {
stdsimd::vendor::_lzcnt_u64(x)
}

View file

@ -0,0 +1,12 @@
_popcnt_u32:
pushq %rbp
movq %rsp, %rbp
popcntl %edi, %eax
popq %rbp
retq
_popcnt_u64:
pushq %rbp
movq %rsp, %rbp
popcntq %rdi, %rax
popq %rbp
retq

View file

@ -0,0 +1,11 @@
extern crate stdsimd;
#[no_mangle]
pub fn popcnt_u32(x: u32) -> u32 {
stdsimd::vendor::_popcnt32(x)
}
#[no_mangle]
pub fn popcnt_u64(x: u64) -> u64 {
stdsimd::vendor::_popcnt64(x)
}