diff options
Diffstat (limited to 'liblow/cmovznz.c')
-rw-r--r-- | liblow/cmovznz.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/liblow/cmovznz.c b/liblow/cmovznz.c new file mode 100644 index 000000000..8533ade99 --- /dev/null +++ b/liblow/cmovznz.c @@ -0,0 +1,10 @@ +#include <stdint.h> +#include "liblow.h" +uint64_t cmovznz(uint64_t t, uint64_t z, uint64_t nz) { + asm ("testq %1, %1;" "\n" + "\t" "cmovnzq %3, %0;" + :"=r"(z) + :"r"(t), "0"(z), "r"(nz) + ); + return z; +} |