... |
... |
@@ -209,7 +209,61 @@ |
209
|
209
|
,(reg-spec-temp res))))
|
210
|
210
|
results))))))
|
211
|
211
|
|
|
212
|
+;;; Define-Assembly-Routine -- Public
|
|
213
|
+;;;
|
|
214
|
+;;; Parse the code to produce an assembly routine and create a VOP
|
|
215
|
+;;; that calls the assembly routine.
|
212
|
216
|
(defmacro define-assembly-routine (name&options vars &rest code)
|
|
217
|
+ "Define-Assembly-Routine (Name&Options Vars Code*)
|
|
218
|
+ Define a Lisp assembly routine, and a VOP to that calls the assembly
|
|
219
|
+ routine, if enabled. (A VOP is not created if the reader
|
|
220
|
+ conditional #+assembler precedes the definition of the assembly
|
|
221
|
+ routine.)
|
|
222
|
+
|
|
223
|
+ Name&Options
|
|
224
|
+ A list giving the name of the assembly routine and options
|
|
225
|
+ describing the assembly routine options and VOP options. The
|
|
226
|
+ format is (Name ({Key Value})*) where Name is the name of the
|
|
227
|
+ assembly routine. Options is a list of options:
|
|
228
|
+
|
|
229
|
+ Options
|
|
230
|
+
|
|
231
|
+ :Cost Cost
|
|
232
|
+ The cost of the VOP. This is used in the generated VOP.
|
|
233
|
+
|
|
234
|
+ :Policy {:Small | :Fast | :Safe | :Fast-Safe}
|
|
235
|
+ The policy for the VOP.
|
|
236
|
+
|
|
237
|
+ :Translate Name
|
|
238
|
+ The translation for the VOP.
|
|
239
|
+
|
|
240
|
+ :Arg-Types arg-types
|
|
241
|
+ :Result-Types result-types
|
|
242
|
+ The template restrictions for the arguments of the VOP and the
|
|
243
|
+ results of the VOP.
|
|
244
|
+
|
|
245
|
+ :Return-Style {:Raw :Full-Call :None}
|
|
246
|
+
|
|
247
|
+ Vars is a list of the arguments and returned results and
|
|
248
|
+ temporaries used by the assembly routine.
|
|
249
|
+
|
|
250
|
+ :Arg Arg-Name (SC*) SC-Offset
|
|
251
|
+ Input argument for the assembly routine with the name
|
|
252
|
+ Arg-Name. The argument must be one of the SC types. The register
|
|
253
|
+ assigned to this argument is given by SC-Offset which must be
|
|
254
|
+ the offset for the register holding this argument.
|
|
255
|
+
|
|
256
|
+ :Res Res-Name SC SC-Offset
|
|
257
|
+ Result of the assembly routine with the name Res-Name. The
|
|
258
|
+ result must be a register of the specified storage class SC. The
|
|
259
|
+ Sc-offset is the register used for the result.
|
|
260
|
+
|
|
261
|
+ :Temp Temp-Name SC SC-Offset
|
|
262
|
+ Like :Res, except this names a temporary register that the
|
|
263
|
+ assembly routine can use.
|
|
264
|
+
|
|
265
|
+ Code
|
|
266
|
+ The code for the assembly routine."
|
213
|
267
|
(multiple-value-bind (name options)
|
214
|
268
|
(if (atom name&options)
|
215
|
269
|
(values name&options nil)
|