1module Platform.AArch64.CardInfo
2
3import Compiler.MachineAArch64
4import Compiler.MachineAArch64Assembly
5import Platform.Linux.Nvidia.DeviceBinding
6
7-- AAPCS64 twin of nvidiaCardInfoGPUIdCode: x0 destination/result, x1 rows,
8-- x2 count, x3 minor; x4 match flag, x5 selected GPU ID, x6 scratch. The
9-- destination is written only after the complete inventory is unambiguous.
10def aarch64CardInfoAssembly =
11 (constructor
12 AArch64Assembly
13 AArch64AssemblyEmit
14 (constructor
15 AArch64Instruction
16 AArch64CompareImmediate
17 (constructor AArch64Register AArch64X2)
18 0)
19 (constructor
20 AArch64Assembly
21 AArch64AssemblyBranchIf
22 (constructor AArch64Condition AArch64Equal)
23 b"invalid"
24 (constructor
25 AArch64Assembly
26 AArch64AssemblyEmit
27 (constructor
28 AArch64Instruction
29 AArch64CompareImmediate
30 (constructor AArch64Register AArch64X2)
31 nvidiaCardInfoMaximumRows)
32 (constructor
33 AArch64Assembly
34 AArch64AssemblyBranchIf
35 (constructor AArch64Condition AArch64UnsignedHigher)
36 b"invalid"
37 (constructor
38 AArch64Assembly
39 AArch64AssemblyEmit
40 (constructor
41 AArch64Instruction
42 AArch64CompareImmediate
43 (constructor AArch64Register AArch64X3)
44 nvidiaCardMinorMaximum)
45 (constructor
46 AArch64Assembly
47 AArch64AssemblyBranchIf
48 (constructor AArch64Condition AArch64UnsignedHigher)
49 b"invalid"
50 (constructor
51 AArch64Assembly
52 AArch64AssemblyEmit
53 (constructor
54 AArch64Instruction
55 AArch64MoveWideZero
56 (constructor AArch64Register AArch64X4)
57 0
58 (constructor AArch64HalfwordShift AArch64Shift0))
59 (constructor
60 AArch64Assembly
61 AArch64AssemblyLabel
62 b"row"
63 (constructor
64 AArch64Assembly
65 AArch64AssemblyEmit
66 (constructor
67 AArch64Instruction
68 AArch64LoadMemory8ZeroExtend
69 (constructor AArch64Register AArch64X6)
70 (constructor AArch64Register AArch64X1)
71 nvidiaCardInfoValidOffset)
72 (constructor
73 AArch64Assembly
74 AArch64AssemblyEmit
75 (constructor
76 AArch64Instruction
77 AArch64CompareImmediate
78 (constructor AArch64Register AArch64X6)
79 0)
80 (constructor
81 AArch64Assembly
82 AArch64AssemblyBranchIf
83 (constructor AArch64Condition AArch64Equal)
84 b"next"
85 (constructor
86 AArch64Assembly
87 AArch64AssemblyEmit
88 (constructor
89 AArch64Instruction
90 AArch64CompareImmediate
91 (constructor AArch64Register AArch64X6)
92 1)
93 (constructor
94 AArch64Assembly
95 AArch64AssemblyBranchIf
96 (constructor AArch64Condition AArch64NotEqual)
97 b"invalid"
98 (constructor
99 AArch64Assembly
100 AArch64AssemblyEmit
101 (constructor
102 AArch64Instruction
103 AArch64LoadMemory32ZeroExtend
104 (constructor AArch64Register AArch64X6)
105 (constructor AArch64Register AArch64X1)
106 nvidiaCardInfoMinorOffset)
107 (constructor
108 AArch64Assembly
109 AArch64AssemblyEmit
110 (constructor
111 AArch64Instruction
112 AArch64CompareRegister
113 (constructor AArch64Register AArch64X6)
114 (constructor AArch64Register AArch64X3))
115 (constructor
116 AArch64Assembly
117 AArch64AssemblyBranchIf
118 (constructor AArch64Condition AArch64NotEqual)
119 b"next"
120 (constructor
121 AArch64Assembly
122 AArch64AssemblyEmit
123 (constructor
124 AArch64Instruction
125 AArch64CompareImmediate
126 (constructor AArch64Register AArch64X4)
127 0)
128 (constructor
129 AArch64Assembly
130 AArch64AssemblyBranchIf
131 (constructor AArch64Condition AArch64NotEqual)
132 b"invalid"
133 (constructor
134 AArch64Assembly
135 AArch64AssemblyEmit
136 (constructor
137 AArch64Instruction
138 AArch64AddImmediate
139 (constructor AArch64Register AArch64X4)
140 (constructor AArch64Register AArch64X4)
141 1)
142 (constructor
143 AArch64Assembly
144 AArch64AssemblyEmit
145 (constructor
146 AArch64Instruction
147 AArch64LoadMemory32ZeroExtend
148 (constructor AArch64Register AArch64X5)
149 (constructor AArch64Register AArch64X1)
150 nvidiaCardInfoGPUIdOffset)
151 (constructor
152 AArch64Assembly
153 AArch64AssemblyLabel
154 b"next"
155 (constructor
156 AArch64Assembly
157 AArch64AssemblyEmit
158 (constructor
159 AArch64Instruction
160 AArch64AddImmediate
161 (constructor AArch64Register AArch64X1)
162 (constructor AArch64Register AArch64X1)
163 nvidiaCardInfoRowBytes)
164 (constructor
165 AArch64Assembly
166 AArch64AssemblyEmit
167 (constructor
168 AArch64Instruction
169 AArch64SubtractImmediate
170 (constructor AArch64Register AArch64X2)
171 (constructor AArch64Register AArch64X2)
172 1)
173 (constructor
174 AArch64Assembly
175 AArch64AssemblyEmit
176 (constructor
177 AArch64Instruction
178 AArch64CompareImmediate
179 (constructor AArch64Register AArch64X2)
180 0)
181 (constructor
182 AArch64Assembly
183 AArch64AssemblyBranchIf
184 (constructor AArch64Condition AArch64NotEqual)
185 b"row"
186 (constructor
187 AArch64Assembly
188 AArch64AssemblyEmit
189 (constructor
190 AArch64Instruction
191 AArch64CompareImmediate
192 (constructor AArch64Register AArch64X4)
193 1)
194 (constructor
195 AArch64Assembly
196 AArch64AssemblyBranchIf
197 (constructor AArch64Condition AArch64NotEqual)
198 b"invalid"
199 (constructor
200 AArch64Assembly
201 AArch64AssemblyEmit
202 (constructor
203 AArch64Instruction
204 AArch64StoreMemory32
205 (constructor AArch64Register AArch64X0)
206 0
207 (constructor AArch64Register AArch64X5))
208 (constructor
209 AArch64Assembly
210 AArch64AssemblyEmit
211 (constructor
212 AArch64Instruction
213 AArch64MoveWideZero
214 (constructor AArch64Register AArch64X0)
215 0
216 (constructor AArch64HalfwordShift AArch64Shift0))
217 (constructor
218 AArch64Assembly
219 AArch64AssemblyEmit
220 (constructor AArch64Instruction AArch64Return)
221 (constructor
222 AArch64Assembly
223 AArch64AssemblyLabel
224 b"invalid"
225 (constructor
226 AArch64Assembly
227 AArch64AssemblyEmit
228 (constructor
229 AArch64Instruction
230 AArch64MoveWideZero
231 (constructor AArch64Register AArch64X0)
232 1
233 (constructor AArch64HalfwordShift AArch64Shift0))
234 (constructor
235 AArch64Assembly
236 AArch64AssemblyEmit
237 (constructor AArch64Instruction AArch64Return)
238 (constructor AArch64Assembly AArch64AssemblyEnd))))))))))))))))))))))))))))))))))
239
240def aarch64CardInfoCode : Bytes =
241 (eliminate
242 AArch64AssemblyResult
243 (lambda unrestricted value : (family AArch64AssemblyResult) . Bytes)
244 (aarch64Assemble aarch64CardInfoAssembly)
245 (branch AArch64AssemblyEncoded code . code)
246 (branch AArch64AssemblyEncodeDuplicateLabel name . b"")
247 (branch AArch64AssemblyMissingLabel name . b"")
248 (branch AArch64AssemblyDisplacementOutOfRange name . b"")
249 (branch AArch64AssemblyOperandRefused value . b""))The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.