shithub: snippets

Download patch

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	Fri Jul  2 14:45:08 2021
+++ b/c_builtins_amd64.s	Tue Jul 20 05:31:39 2021
@@ -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