ref: f6dbc2ae6e153c5608b6f9d893238d71ae521935
parent: d347f48f5ee550b901d0cdba4779f2ebd11b0c73
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Jul 20 05:31:39 EDT 2021
builtins: these instruction are available in 6a (thanks kemal)
--- a/c_builtins_amd64.s
+++ b/c_builtins_amd64.s
@@ -1,13 +1,13 @@
TEXT __builtin_ctz(SB),1,$0
- BYTE $0x0F; BYTE $0xBC; BYTE $0xC5 /* BSFL RARG, AX */
+ BSFL RARG, AX
RET
TEXT __builtin_clz(SB),1,$0
- BYTE $0x0F; BYTE $0xBD; BYTE $0xC5 /* BSRL RARG, AX */
+ BSRL RARG, AX
XORL $31, AX
RET
TEXT __builtin_clzll(SB),1,$0
- BYTE $0x48; BYTE $0x0F; BYTE $0xBD; BYTE $0xC5 /* BSRQ RARG, AX */
+ BSRQ RARG, AX
XORL $63, AX
RET