cv-fpo-realign.s
5.76 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# RUN: llvm-mc -triple=i686-windows-msvc -filetype=obj < %s | llvm-readobj --codeview | FileCheck %s
# Test for .cv_fpo_stackalign. We should generate FPO data that restores CSRs
# at each instruction, and in the last FrameData we should use the '@'
# alignment operator to define $T0, the vframe value.
# Based on this C code:
# void usevals(int, int, double*);
# int realign_with_csrs() {
# int a = getval();
# int b = getval();
# double __declspec(align(8)) force_alignment = 0.42;
# usevals(a, b, &force_alignment);
# return a + b;
# }
# CHECK: Subsection [
# CHECK: SubSectionType: Symbols (0xF1)
# CHECK: Compile3Sym {
# CHECK: Kind: S_COMPILE3 (0x113C)
# CHECK: }
# CHECK: ]
# CHECK: Subsection [
# CHECK: SubSectionType: FrameData (0xF5)
# CHECK: FrameData {
# CHECK: FrameFunc [
# CHECK: $T0 .raSearch =
# CHECK: $eip $T0 ^ =
# CHECK: $esp $T0 4 + =
# CHECK: ]
# CHECK: }
# CHECK: FrameData {
# CHECK: FrameFunc [
# CHECK: $T0 .raSearch =
# CHECK: $eip $T0 ^ =
# CHECK: $esp $T0 4 + =
# CHECK: $ebp $T0 4 - ^ =
# CHECK: ]
# CHECK: }
# CHECK: FrameData {
# CHECK: FrameFunc [
# CHECK: $T0 $ebp 4 + =
# CHECK: $eip $T0 ^ =
# CHECK: $esp $T0 4 + =
# CHECK: $ebp $T0 4 - ^ =
# CHECK: ]
# CHECK: }
# CHECK: FrameData {
# CHECK: FrameFunc [
# CHECK: $T0 $ebp 4 + =
# CHECK: $eip $T0 ^ =
# CHECK: $esp $T0 4 + =
# CHECK: $ebp $T0 4 - ^ =
# CHECK: $edi $T0 8 - ^ =
# CHECK: ]
# CHECK: }
# CHECK: FrameData {
# CHECK: FrameFunc [
# CHECK: $T0 $ebp 4 + =
# CHECK: $eip $T0 ^ =
# CHECK: $esp $T0 4 + =
# CHECK: $ebp $T0 4 - ^ =
# CHECK: $edi $T0 8 - ^ =
# CHECK: $esi $T0 12 - ^ =
# CHECK: ]
# CHECK: }
# CHECK: FrameData {
# CHECK: FrameFunc [
# CHECK: $T1 $ebp 4 + =
# CHECK: $T0 $T1 12 - 8 @ =
# CHECK: $eip $T1 ^ =
# CHECK: $esp $T1 4 + =
# CHECK: $ebp $T1 4 - ^ =
# CHECK: $edi $T1 8 - ^ =
# CHECK: $esi $T1 12 - ^ =
# CHECK: ]
# CHECK: }
# CHECK: ]
# CHECK: Subsection [
# CHECK: SubSectionType: Symbols (0xF1)
# CHECK: ]
# CHECK: Subsection [
# CHECK: SubSectionType: FileChecksums (0xF4)
# CHECK: ]
# CHECK: Subsection [
# CHECK: SubSectionType: StringTable (0xF3)
# CHECK: ]
.text
.def _realign_with_csrs; .scl 2; .type 32; .endef
.globl _realign_with_csrs # -- Begin function realign_with_csrs
_realign_with_csrs: # @realign_with_csrs
Lfunc_begin0:
.cv_func_id 0
.cv_file 1 "C:\\src\\llvm-project\\build\\t.c" "2A4F9B6BBBF7845521201755D1B14ACC" 1
.cv_loc 0 1 4 0 # t.c:4:0
.cv_fpo_proc _realign_with_csrs 0
# %bb.0: # %entry
pushl %ebp
.cv_fpo_pushreg %ebp
movl %esp, %ebp
.cv_fpo_setframe %ebp
Ltmp0:
pushl %edi
.cv_fpo_pushreg %edi
pushl %esi
.cv_fpo_pushreg %esi
andl $-8, %esp
.cv_fpo_stackalign 8
subl $8, %esp
.cv_fpo_stackalloc 8
.cv_fpo_endprologue
.cv_loc 0 1 5 0 # t.c:5:0
calll _getval
movl %eax, %esi
.cv_loc 0 1 6 0 # t.c:6:0
calll _getval
movl %eax, %edi
movl %esp, %eax
.cv_loc 0 1 7 0 # t.c:7:0
movl $1071309127, 4(%esp) # imm = 0x3FDAE147
movl $-1374389535, (%esp) # imm = 0xAE147AE1
.cv_loc 0 1 8 0 # t.c:8:0
pushl %eax
pushl %edi
pushl %esi
calll _usevals
addl $12, %esp
.cv_loc 0 1 9 0 # t.c:9:0
addl %esi, %edi
movl %edi, %eax
leal -8(%ebp), %esp
popl %esi
popl %edi
popl %ebp
retl
Ltmp1:
.cv_fpo_endproc
Lfunc_end0:
# -- End function
.section .debug$S,"dr"
.p2align 2
.long 4 # Debug section magic
.long 241
.long Ltmp3-Ltmp2 # Subsection size
Ltmp2:
.short Ltmp5-Ltmp4 # Record length
Ltmp4:
.short 4412 # Record kind: S_COMPILE3
.long 0 # Flags and language
.short 7 # CPUType
.short 8 # Frontend version
.short 0
.short 0
.short 0
.short 8000 # Backend version
.short 0
.short 0
.short 0
.asciz "clang version 8.0.0 " # Null-terminated compiler version string
Ltmp5:
Ltmp3:
.p2align 2
.cv_fpo_data _realign_with_csrs
.long 241 # Symbol subsection for realign_with_csrs
.long Ltmp7-Ltmp6 # Subsection size
Ltmp6:
.short Ltmp9-Ltmp8 # Record length
Ltmp8:
.short 4423 # Record kind: S_GPROC32_ID
.long 0 # PtrParent
.long 0 # PtrEnd
.long 0 # PtrNext
.long Lfunc_end0-_realign_with_csrs # Code size
.long 0 # Offset after prologue
.long 0 # Offset before epilogue
.long 0 # Function type index
.secrel32 _realign_with_csrs # Function section relative address
.secidx _realign_with_csrs # Function section index
.byte 0 # Flags
.asciz "realign_with_csrs" # Function name
Ltmp9:
.short Ltmp11-Ltmp10 # Record length
Ltmp10:
.short 4114 # Record kind: S_FRAMEPROC
.long 12 # FrameSize
.long 0 # Padding
.long 0 # Offset of padding
.long 8 # Bytes of callee saved registers
.long 0 # Exception handler offset
.short 0 # Exception handler section
.long 1196032 # Flags (defines frame register)
Ltmp11:
.short 2 # Record length
.short 4431 # Record kind: S_PROC_ID_END
Ltmp7:
.p2align 2
.cv_filechecksums # File index to string table offset subsection
.cv_stringtable # String table