-
Notifications
You must be signed in to change notification settings - Fork 0
/
crdnm_amd64.s
53 lines (43 loc) · 1.31 KB
/
crdnm_amd64.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyrigth 2022 - mailto:seantolstoyevski@protonmail.com
//
// The source codes of this project are licensed under the MIT license.
//
// It is provided without any warranty.
//+build !noasm !appengine
// AUTO-GENERATED BY C2GOASM -- DO NOT EDIT
// NOSPLIT|NOPTR
#include "textflag.h"
TEXT ·_crmdnAsUint64(SB), NOSPLIT|NOPTR, $0-8
RDRANDL AX
MOVQ AX, v+0(FP)
RET
TEXT ·_crmdnAsUint32(SB), NOSPLIT|NOPTR, $0-8
RDRANDL AX
MOVQ AX, v+0(FP)
RET
TEXT ·_crmdnAsUint16(SB), NOSPLIT|NOPTR, $0-8
RDRANDL AX
MOVQ AX, v+0(FP)
RET
TEXT ·_RdseedAsUint16(SB), $0-16
MOVQ val+0(FP), DI
LONG $0xf8c70f66 // rdseed ax
WORD $0xb70f; BYTE $0xc8 // movzx ecx, ax
LONG $0x000001b8; BYTE $0x00 // mov eax, 1
WORD $0x430f; BYTE $0xc1 // cmovae eax, ecx
MOVQ AX, r+8(FP)
RET
TEXT ·_RdseedAsUint32(SB), $0-16
MOVQ val+0(FP), DI
WORD $0xc70f; BYTE $0xf9 // rdseed ecx
LONG $0x000001b8; BYTE $0x00 // mov eax, 1
WORD $0x430f; BYTE $0xc1 // cmovae eax, ecx
MOVQ AX, r+8(FP)
RET
TEXT ·_RdseedAsUint64(SB), $0-16
MOVQ val+0(FP), DI
LONG $0xf9c70f48 // rdseed rcx
LONG $0x000001b8; BYTE $0x00 // mov eax, 1
WORD $0x430f; BYTE $0xc1 // cmovae eax, ecx
MOVQ AX, r+8(FP)
RET