blob: 8002f98765f0438672fb6ca240c25ac91c6e3a26 [file] [log] [blame]
Anton Korobeynikov9ac72c42008-03-23 14:53:18 +00001;;===-- X86CompilationCallback_Win64.asm - Implement Win64 JIT callback ---===
2;;
3;; The LLVM Compiler Infrastructure
4;;
5;; This file is distributed under the University of Illinois Open Source
6;; License. See LICENSE.TXT for details.
7;;
8;;===----------------------------------------------------------------------===
9;;
10;; This file implements the JIT interfaces for the X86 target.
11;;
12;;===----------------------------------------------------------------------===
13
Anton Korobeynikov5f287b92008-03-23 14:44:32 +000014extrn X86CompilationCallback2: PROC
15
16.code
17X86CompilationCallback proc
18 push rbp
19
20 ; Save RSP
21 mov rbp, rsp
22
23 ; Save all int arg registers
24 push rcx
25 push rdx
26 push r8
27 push r9
28
29 ; Align stack on 16-byte boundary.
30 and rsp, -16
31
32 ; Save all XMM arg registers
33 sub rsp, 64
34 movaps [rsp], xmm0
35 movaps [rsp+16], xmm1
36 movaps [rsp+32], xmm2
37 movaps [rsp+48], xmm3
38
39 ; JIT callee
40
41 ; Pass prev frame and return address
42 mov rcx, rbp
43 mov rdx, qword ptr [rbp+8]
44 call X86CompilationCallback2
45
46 ; Restore all XMM arg registers
47 movaps xmm3, [rsp+48]
48 movaps xmm2, [rsp+32]
49 movaps xmm1, [rsp+16]
50 movaps xmm0, [rsp]
51
52 ; Restore RSP
53 mov rsp, rbp
54
55 ; Restore all int arg registers
56 sub rsp, 32
57 pop r9
58 pop r8
59 pop rdx
60 pop rcx
61
62 ; Restore RBP
63 pop rbp
64 ret
65X86CompilationCallback endp
66
67End