xref: /aosp_15_r20/external/boringssl/src/gen/bcm/rdrand-x86_64-win.asm (revision 8fb009dc861624b67b6cdb62ea21f0f22d0c584b)
1; This file is generated from a similarly-named Perl script in the BoringSSL
2; source tree. Do not edit by hand.
3
4%ifidn __OUTPUT_FORMAT__, win64
5default	rel
6%define XMMWORD
7%define YMMWORD
8%define ZMMWORD
9%define _CET_ENDBR
10
11%ifdef BORINGSSL_PREFIX
12%include "boringssl_prefix_symbols_nasm.inc"
13%endif
14section	.text code align=64
15
16
17
18
19
20global	CRYPTO_rdrand
21
22ALIGN	16
23CRYPTO_rdrand:
24
25_CET_ENDBR
26	xor	rax,rax
27DB	73,15,199,240
28
29	adc	rax,rax
30	mov	QWORD[rcx],r8
31	ret
32
33
34
35
36
37
38
39global	CRYPTO_rdrand_multiple8_buf
40
41ALIGN	16
42CRYPTO_rdrand_multiple8_buf:
43
44_CET_ENDBR
45	test	rdx,rdx
46	jz	NEAR $L$out
47	mov	r8,8
48$L$loop:
49DB	73,15,199,241
50	jnc	NEAR $L$err
51	mov	QWORD[rcx],r9
52	add	rcx,r8
53	sub	rdx,r8
54	jnz	NEAR $L$loop
55$L$out:
56	mov	rax,1
57	ret
58$L$err:
59	xor	rax,rax
60	ret
61
62
63%else
64; Work around https://bugzilla.nasm.us/show_bug.cgi?id=3392738
65ret
66%endif
67