support both ASM and intrinsics