bitsasm.cc

来自「the FXT library: fast transforms and low」· CC 代码 · 共 56 行

CC
56
字号
#include "bitsasm.h"#include "fxttypes.h"#if defined  BITS_USE_ASM  // use x86 ASM asm code#warning 'FYI: using x86-asm for various bit operations'#if defined  BITS_USE_ASM    // use x86 asm code#if defined  BITS__ASM_USE_INLINE#warning 'FYI: using inline asm templates'#else // BITS__ASM_USE_INLINE#warning 'FYI: using asm'#error 'defunct'voidasm_bsf(ulong *x){ asm("movl  4 (%esp), %eaxmovl  (%eax), %edx//jnz .LABEL1//movl  0xffffffff, %edx//.LABEL1:bsf   %edx, %edxmovl  %edx, (%eax)");}//------------------------voidasm_bsr(ulong *x){ asm("movl  4 (%esp), %eaxmovl  (%eax), %edx//jnz .LABEL2//movl  0xffffffff, %edx//.LABEL2:bsr   %edx, %edxmovl  %edx, (%eax)");}//------------------------#endif // BITS__ASM_USE_INLINE#endif // BITS_USE_ASM#endif // BITS_USE_ASM

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?