• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; This file is generated from a similarly-named Perl script in the BoringSSL
2; source tree. Do not edit by hand.
3
4default	rel
5%define XMMWORD
6%define YMMWORD
7%define ZMMWORD
8
9%ifdef BORINGSSL_PREFIX
10%include "boringssl_prefix_symbols_nasm.inc"
11%endif
12section	.text code align=64
13
14
15
16
17
18
19
20
21
22
23global	abi_test_trampoline
24ALIGN	16
25abi_test_trampoline:
26$L$abi_test_trampoline_seh_begin:
27
28
29
30
31
32
33
34
35
36
37	sub	rsp,344
38
39$L$abi_test_trampoline_seh_prolog_alloc:
40	mov	QWORD[112+rsp],rbx
41
42$L$abi_test_trampoline_seh_prolog_rbx:
43	mov	QWORD[120+rsp],rbp
44
45$L$abi_test_trampoline_seh_prolog_rbp:
46	mov	QWORD[128+rsp],rdi
47
48$L$abi_test_trampoline_seh_prolog_rdi:
49	mov	QWORD[136+rsp],rsi
50
51$L$abi_test_trampoline_seh_prolog_rsi:
52	mov	QWORD[144+rsp],r12
53
54$L$abi_test_trampoline_seh_prolog_r12:
55	mov	QWORD[152+rsp],r13
56
57$L$abi_test_trampoline_seh_prolog_r13:
58	mov	QWORD[160+rsp],r14
59
60$L$abi_test_trampoline_seh_prolog_r14:
61	mov	QWORD[168+rsp],r15
62
63$L$abi_test_trampoline_seh_prolog_r15:
64	movdqa	XMMWORD[176+rsp],xmm6
65
66$L$abi_test_trampoline_seh_prolog_xmm6:
67	movdqa	XMMWORD[192+rsp],xmm7
68
69$L$abi_test_trampoline_seh_prolog_xmm7:
70	movdqa	XMMWORD[208+rsp],xmm8
71
72$L$abi_test_trampoline_seh_prolog_xmm8:
73	movdqa	XMMWORD[224+rsp],xmm9
74
75$L$abi_test_trampoline_seh_prolog_xmm9:
76	movdqa	XMMWORD[240+rsp],xmm10
77
78$L$abi_test_trampoline_seh_prolog_xmm10:
79	movdqa	XMMWORD[256+rsp],xmm11
80
81$L$abi_test_trampoline_seh_prolog_xmm11:
82	movdqa	XMMWORD[272+rsp],xmm12
83
84$L$abi_test_trampoline_seh_prolog_xmm12:
85	movdqa	XMMWORD[288+rsp],xmm13
86
87$L$abi_test_trampoline_seh_prolog_xmm13:
88	movdqa	XMMWORD[304+rsp],xmm14
89
90$L$abi_test_trampoline_seh_prolog_xmm14:
91	movdqa	XMMWORD[320+rsp],xmm15
92
93$L$abi_test_trampoline_seh_prolog_xmm15:
94$L$abi_test_trampoline_seh_prolog_end:
95	mov	rbx,QWORD[rdx]
96	mov	rbp,QWORD[8+rdx]
97	mov	rdi,QWORD[16+rdx]
98	mov	rsi,QWORD[24+rdx]
99	mov	r12,QWORD[32+rdx]
100	mov	r13,QWORD[40+rdx]
101	mov	r14,QWORD[48+rdx]
102	mov	r15,QWORD[56+rdx]
103	movdqa	xmm6,XMMWORD[64+rdx]
104	movdqa	xmm7,XMMWORD[80+rdx]
105	movdqa	xmm8,XMMWORD[96+rdx]
106	movdqa	xmm9,XMMWORD[112+rdx]
107	movdqa	xmm10,XMMWORD[128+rdx]
108	movdqa	xmm11,XMMWORD[144+rdx]
109	movdqa	xmm12,XMMWORD[160+rdx]
110	movdqa	xmm13,XMMWORD[176+rdx]
111	movdqa	xmm14,XMMWORD[192+rdx]
112	movdqa	xmm15,XMMWORD[208+rdx]
113
114	mov	QWORD[88+rsp],rcx
115	mov	QWORD[96+rsp],rdx
116
117
118
119
120	mov	r10,r8
121	mov	r11,r9
122	dec	r11
123	js	NEAR $L$args_done
124	mov	rcx,QWORD[r10]
125	add	r10,8
126	dec	r11
127	js	NEAR $L$args_done
128	mov	rdx,QWORD[r10]
129	add	r10,8
130	dec	r11
131	js	NEAR $L$args_done
132	mov	r8,QWORD[r10]
133	add	r10,8
134	dec	r11
135	js	NEAR $L$args_done
136	mov	r9,QWORD[r10]
137	add	r10,8
138	lea	rax,[32+rsp]
139$L$args_loop:
140	dec	r11
141	js	NEAR $L$args_done
142
143
144
145
146
147
148	mov	QWORD[104+rsp],r11
149	mov	r11,QWORD[r10]
150	mov	QWORD[rax],r11
151	mov	r11,QWORD[104+rsp]
152
153	add	r10,8
154	add	rax,8
155	jmp	NEAR $L$args_loop
156
157$L$args_done:
158	mov	rax,QWORD[88+rsp]
159	mov	r10,QWORD[384+rsp]
160	test	r10,r10
161	jz	NEAR $L$no_unwind
162
163
164	pushfq
165	or	QWORD[rsp],0x100
166	popfq
167
168
169
170	nop
171global	abi_test_unwind_start
172abi_test_unwind_start:
173
174	call	rax
175global	abi_test_unwind_return
176abi_test_unwind_return:
177
178
179
180
181	pushfq
182	and	QWORD[rsp],-0x101
183	popfq
184global	abi_test_unwind_stop
185abi_test_unwind_stop:
186
187	jmp	NEAR $L$call_done
188
189$L$no_unwind:
190	call	rax
191
192$L$call_done:
193
194	mov	rdx,QWORD[96+rsp]
195	mov	QWORD[rdx],rbx
196	mov	QWORD[8+rdx],rbp
197	mov	QWORD[16+rdx],rdi
198	mov	QWORD[24+rdx],rsi
199	mov	QWORD[32+rdx],r12
200	mov	QWORD[40+rdx],r13
201	mov	QWORD[48+rdx],r14
202	mov	QWORD[56+rdx],r15
203	movdqa	XMMWORD[64+rdx],xmm6
204	movdqa	XMMWORD[80+rdx],xmm7
205	movdqa	XMMWORD[96+rdx],xmm8
206	movdqa	XMMWORD[112+rdx],xmm9
207	movdqa	XMMWORD[128+rdx],xmm10
208	movdqa	XMMWORD[144+rdx],xmm11
209	movdqa	XMMWORD[160+rdx],xmm12
210	movdqa	XMMWORD[176+rdx],xmm13
211	movdqa	XMMWORD[192+rdx],xmm14
212	movdqa	XMMWORD[208+rdx],xmm15
213	mov	rbx,QWORD[112+rsp]
214
215	mov	rbp,QWORD[120+rsp]
216
217	mov	rdi,QWORD[128+rsp]
218
219	mov	rsi,QWORD[136+rsp]
220
221	mov	r12,QWORD[144+rsp]
222
223	mov	r13,QWORD[152+rsp]
224
225	mov	r14,QWORD[160+rsp]
226
227	mov	r15,QWORD[168+rsp]
228
229	movdqa	xmm6,XMMWORD[176+rsp]
230
231	movdqa	xmm7,XMMWORD[192+rsp]
232
233	movdqa	xmm8,XMMWORD[208+rsp]
234
235	movdqa	xmm9,XMMWORD[224+rsp]
236
237	movdqa	xmm10,XMMWORD[240+rsp]
238
239	movdqa	xmm11,XMMWORD[256+rsp]
240
241	movdqa	xmm12,XMMWORD[272+rsp]
242
243	movdqa	xmm13,XMMWORD[288+rsp]
244
245	movdqa	xmm14,XMMWORD[304+rsp]
246
247	movdqa	xmm15,XMMWORD[320+rsp]
248
249	add	rsp,344
250
251
252
253	DB	0F3h,0C3h		;repret
254
255$L$abi_test_trampoline_seh_end:
256
257
258global	abi_test_clobber_rax
259ALIGN	16
260abi_test_clobber_rax:
261	xor	rax,rax
262	DB	0F3h,0C3h		;repret
263
264
265global	abi_test_clobber_rbx
266ALIGN	16
267abi_test_clobber_rbx:
268	xor	rbx,rbx
269	DB	0F3h,0C3h		;repret
270
271
272global	abi_test_clobber_rcx
273ALIGN	16
274abi_test_clobber_rcx:
275	xor	rcx,rcx
276	DB	0F3h,0C3h		;repret
277
278
279global	abi_test_clobber_rdx
280ALIGN	16
281abi_test_clobber_rdx:
282	xor	rdx,rdx
283	DB	0F3h,0C3h		;repret
284
285
286global	abi_test_clobber_rdi
287ALIGN	16
288abi_test_clobber_rdi:
289	xor	rdi,rdi
290	DB	0F3h,0C3h		;repret
291
292
293global	abi_test_clobber_rsi
294ALIGN	16
295abi_test_clobber_rsi:
296	xor	rsi,rsi
297	DB	0F3h,0C3h		;repret
298
299
300global	abi_test_clobber_rbp
301ALIGN	16
302abi_test_clobber_rbp:
303	xor	rbp,rbp
304	DB	0F3h,0C3h		;repret
305
306
307global	abi_test_clobber_r8
308ALIGN	16
309abi_test_clobber_r8:
310	xor	r8,r8
311	DB	0F3h,0C3h		;repret
312
313
314global	abi_test_clobber_r9
315ALIGN	16
316abi_test_clobber_r9:
317	xor	r9,r9
318	DB	0F3h,0C3h		;repret
319
320
321global	abi_test_clobber_r10
322ALIGN	16
323abi_test_clobber_r10:
324	xor	r10,r10
325	DB	0F3h,0C3h		;repret
326
327
328global	abi_test_clobber_r11
329ALIGN	16
330abi_test_clobber_r11:
331	xor	r11,r11
332	DB	0F3h,0C3h		;repret
333
334
335global	abi_test_clobber_r12
336ALIGN	16
337abi_test_clobber_r12:
338	xor	r12,r12
339	DB	0F3h,0C3h		;repret
340
341
342global	abi_test_clobber_r13
343ALIGN	16
344abi_test_clobber_r13:
345	xor	r13,r13
346	DB	0F3h,0C3h		;repret
347
348
349global	abi_test_clobber_r14
350ALIGN	16
351abi_test_clobber_r14:
352	xor	r14,r14
353	DB	0F3h,0C3h		;repret
354
355
356global	abi_test_clobber_r15
357ALIGN	16
358abi_test_clobber_r15:
359	xor	r15,r15
360	DB	0F3h,0C3h		;repret
361
362
363global	abi_test_clobber_xmm0
364ALIGN	16
365abi_test_clobber_xmm0:
366	pxor	xmm0,xmm0
367	DB	0F3h,0C3h		;repret
368
369
370global	abi_test_clobber_xmm1
371ALIGN	16
372abi_test_clobber_xmm1:
373	pxor	xmm1,xmm1
374	DB	0F3h,0C3h		;repret
375
376
377global	abi_test_clobber_xmm2
378ALIGN	16
379abi_test_clobber_xmm2:
380	pxor	xmm2,xmm2
381	DB	0F3h,0C3h		;repret
382
383
384global	abi_test_clobber_xmm3
385ALIGN	16
386abi_test_clobber_xmm3:
387	pxor	xmm3,xmm3
388	DB	0F3h,0C3h		;repret
389
390
391global	abi_test_clobber_xmm4
392ALIGN	16
393abi_test_clobber_xmm4:
394	pxor	xmm4,xmm4
395	DB	0F3h,0C3h		;repret
396
397
398global	abi_test_clobber_xmm5
399ALIGN	16
400abi_test_clobber_xmm5:
401	pxor	xmm5,xmm5
402	DB	0F3h,0C3h		;repret
403
404
405global	abi_test_clobber_xmm6
406ALIGN	16
407abi_test_clobber_xmm6:
408	pxor	xmm6,xmm6
409	DB	0F3h,0C3h		;repret
410
411
412global	abi_test_clobber_xmm7
413ALIGN	16
414abi_test_clobber_xmm7:
415	pxor	xmm7,xmm7
416	DB	0F3h,0C3h		;repret
417
418
419global	abi_test_clobber_xmm8
420ALIGN	16
421abi_test_clobber_xmm8:
422	pxor	xmm8,xmm8
423	DB	0F3h,0C3h		;repret
424
425
426global	abi_test_clobber_xmm9
427ALIGN	16
428abi_test_clobber_xmm9:
429	pxor	xmm9,xmm9
430	DB	0F3h,0C3h		;repret
431
432
433global	abi_test_clobber_xmm10
434ALIGN	16
435abi_test_clobber_xmm10:
436	pxor	xmm10,xmm10
437	DB	0F3h,0C3h		;repret
438
439
440global	abi_test_clobber_xmm11
441ALIGN	16
442abi_test_clobber_xmm11:
443	pxor	xmm11,xmm11
444	DB	0F3h,0C3h		;repret
445
446
447global	abi_test_clobber_xmm12
448ALIGN	16
449abi_test_clobber_xmm12:
450	pxor	xmm12,xmm12
451	DB	0F3h,0C3h		;repret
452
453
454global	abi_test_clobber_xmm13
455ALIGN	16
456abi_test_clobber_xmm13:
457	pxor	xmm13,xmm13
458	DB	0F3h,0C3h		;repret
459
460
461global	abi_test_clobber_xmm14
462ALIGN	16
463abi_test_clobber_xmm14:
464	pxor	xmm14,xmm14
465	DB	0F3h,0C3h		;repret
466
467
468global	abi_test_clobber_xmm15
469ALIGN	16
470abi_test_clobber_xmm15:
471	pxor	xmm15,xmm15
472	DB	0F3h,0C3h		;repret
473
474
475
476
477
478global	abi_test_bad_unwind_wrong_register
479ALIGN	16
480abi_test_bad_unwind_wrong_register:
481
482$L$abi_test_bad_unwind_wrong_register_seh_begin:
483	push	r12
484
485$L$abi_test_bad_unwind_wrong_register_seh_push_r13:
486
487
488
489	nop
490	pop	r12
491
492	DB	0F3h,0C3h		;repret
493$L$abi_test_bad_unwind_wrong_register_seh_end:
494
495
496
497
498
499
500
501global	abi_test_bad_unwind_temporary
502ALIGN	16
503abi_test_bad_unwind_temporary:
504
505$L$abi_test_bad_unwind_temporary_seh_begin:
506	push	r12
507
508$L$abi_test_bad_unwind_temporary_seh_push_r12:
509
510	mov	rax,r12
511	inc	rax
512	mov	QWORD[rsp],rax
513
514
515
516	mov	QWORD[rsp],r12
517
518
519	pop	r12
520
521	DB	0F3h,0C3h		;repret
522$L$abi_test_bad_unwind_temporary_seh_end:
523
524
525
526
527
528
529
530global	abi_test_get_and_clear_direction_flag
531abi_test_get_and_clear_direction_flag:
532	pushfq
533	pop	rax
534	and	rax,0x400
535	shr	rax,10
536	cld
537	DB	0F3h,0C3h		;repret
538
539
540
541
542
543global	abi_test_set_direction_flag
544abi_test_set_direction_flag:
545	std
546	DB	0F3h,0C3h		;repret
547
548
549
550
551
552
553global	abi_test_bad_unwind_epilog
554ALIGN	16
555abi_test_bad_unwind_epilog:
556$L$abi_test_bad_unwind_epilog_seh_begin:
557	push	r12
558$L$abi_test_bad_unwind_epilog_seh_push_r12:
559
560	nop
561
562
563	pop	r12
564	nop
565	DB	0F3h,0C3h		;repret
566$L$abi_test_bad_unwind_epilog_seh_end:
567
568section	.pdata rdata align=4
569ALIGN	4
570
571	DD	$L$abi_test_trampoline_seh_begin wrt ..imagebase
572	DD	$L$abi_test_trampoline_seh_end wrt ..imagebase
573	DD	$L$abi_test_trampoline_seh_info wrt ..imagebase
574
575	DD	$L$abi_test_bad_unwind_wrong_register_seh_begin wrt ..imagebase
576	DD	$L$abi_test_bad_unwind_wrong_register_seh_end wrt ..imagebase
577	DD	$L$abi_test_bad_unwind_wrong_register_seh_info wrt ..imagebase
578
579	DD	$L$abi_test_bad_unwind_temporary_seh_begin wrt ..imagebase
580	DD	$L$abi_test_bad_unwind_temporary_seh_end wrt ..imagebase
581	DD	$L$abi_test_bad_unwind_temporary_seh_info wrt ..imagebase
582
583	DD	$L$abi_test_bad_unwind_epilog_seh_begin wrt ..imagebase
584	DD	$L$abi_test_bad_unwind_epilog_seh_end wrt ..imagebase
585	DD	$L$abi_test_bad_unwind_epilog_seh_info wrt ..imagebase
586
587section	.xdata rdata align=8
588ALIGN	8
589$L$abi_test_trampoline_seh_info:
590
591DB	1
592DB	$L$abi_test_trampoline_seh_prolog_end-$L$abi_test_trampoline_seh_begin
593DB	38
594DB	0
595DB	$L$abi_test_trampoline_seh_prolog_xmm15-$L$abi_test_trampoline_seh_begin
596DB	248
597	DW	20
598DB	$L$abi_test_trampoline_seh_prolog_xmm14-$L$abi_test_trampoline_seh_begin
599DB	232
600	DW	19
601DB	$L$abi_test_trampoline_seh_prolog_xmm13-$L$abi_test_trampoline_seh_begin
602DB	216
603	DW	18
604DB	$L$abi_test_trampoline_seh_prolog_xmm12-$L$abi_test_trampoline_seh_begin
605DB	200
606	DW	17
607DB	$L$abi_test_trampoline_seh_prolog_xmm11-$L$abi_test_trampoline_seh_begin
608DB	184
609	DW	16
610DB	$L$abi_test_trampoline_seh_prolog_xmm10-$L$abi_test_trampoline_seh_begin
611DB	168
612	DW	15
613DB	$L$abi_test_trampoline_seh_prolog_xmm9-$L$abi_test_trampoline_seh_begin
614DB	152
615	DW	14
616DB	$L$abi_test_trampoline_seh_prolog_xmm8-$L$abi_test_trampoline_seh_begin
617DB	136
618	DW	13
619DB	$L$abi_test_trampoline_seh_prolog_xmm7-$L$abi_test_trampoline_seh_begin
620DB	120
621	DW	12
622DB	$L$abi_test_trampoline_seh_prolog_xmm6-$L$abi_test_trampoline_seh_begin
623DB	104
624	DW	11
625DB	$L$abi_test_trampoline_seh_prolog_r15-$L$abi_test_trampoline_seh_begin
626DB	244
627	DW	21
628DB	$L$abi_test_trampoline_seh_prolog_r14-$L$abi_test_trampoline_seh_begin
629DB	228
630	DW	20
631DB	$L$abi_test_trampoline_seh_prolog_r13-$L$abi_test_trampoline_seh_begin
632DB	212
633	DW	19
634DB	$L$abi_test_trampoline_seh_prolog_r12-$L$abi_test_trampoline_seh_begin
635DB	196
636	DW	18
637DB	$L$abi_test_trampoline_seh_prolog_rsi-$L$abi_test_trampoline_seh_begin
638DB	100
639	DW	17
640DB	$L$abi_test_trampoline_seh_prolog_rdi-$L$abi_test_trampoline_seh_begin
641DB	116
642	DW	16
643DB	$L$abi_test_trampoline_seh_prolog_rbp-$L$abi_test_trampoline_seh_begin
644DB	84
645	DW	15
646DB	$L$abi_test_trampoline_seh_prolog_rbx-$L$abi_test_trampoline_seh_begin
647DB	52
648	DW	14
649DB	$L$abi_test_trampoline_seh_prolog_alloc-$L$abi_test_trampoline_seh_begin
650DB	1
651	DW	43
652
653
654ALIGN	8
655$L$abi_test_bad_unwind_wrong_register_seh_info:
656DB	1
657DB	$L$abi_test_bad_unwind_wrong_register_seh_push_r13-$L$abi_test_bad_unwind_wrong_register_seh_begin
658DB	1
659DB	0
660
661DB	$L$abi_test_bad_unwind_wrong_register_seh_push_r13-$L$abi_test_bad_unwind_wrong_register_seh_begin
662DB	208
663
664ALIGN	8
665$L$abi_test_bad_unwind_temporary_seh_info:
666DB	1
667DB	$L$abi_test_bad_unwind_temporary_seh_push_r12-$L$abi_test_bad_unwind_temporary_seh_begin
668DB	1
669DB	0
670
671DB	$L$abi_test_bad_unwind_temporary_seh_push_r12-$L$abi_test_bad_unwind_temporary_seh_begin
672DB	192
673
674ALIGN	8
675$L$abi_test_bad_unwind_epilog_seh_info:
676DB	1
677DB	$L$abi_test_bad_unwind_epilog_seh_push_r12-$L$abi_test_bad_unwind_epilog_seh_begin
678DB	1
679DB	0
680
681DB	$L$abi_test_bad_unwind_epilog_seh_push_r12-$L$abi_test_bad_unwind_epilog_seh_begin
682DB	192
683