| 1 |
;;;; -*- Mode: Lisp; Syntax: Common-Lisp; indent-tabs-mode: nil; Package: C -*- |
| 2 |
;;;; vim: set filetype=lisp tabstop=8 shiftwidth=2 expandtab: |
| 3 |
|
| 4 |
;;;; |
| 5 |
;;;; Copyright (c) 1991, Giuseppe Attardi. All rights reserved. |
| 6 |
;;;; Copyright (c) 2003, Juan Jose Garcia Ripoll |
| 7 |
;;;; |
| 8 |
;;;; See the file 'LICENSE' for the copyright details. |
| 9 |
;;;; |
| 10 |
|
| 11 |
;;;; |
| 12 |
;;;; Database for system functions. |
| 13 |
;;;; |
| 14 |
|
| 15 |
(in-package "COMPILER") |
| 16 |
|
| 17 |
;;; |
| 18 |
;;; DATABASE OF INLINE EXPANSIONS |
| 19 |
;;; |
| 20 |
;;; (DEF-INLINE function-name kind ([arg-type]*) return-host-type |
| 21 |
;;; expansion-string) |
| 22 |
;;; |
| 23 |
;;; Here, ARG-TYPE is the list of argument types belonging to the lisp family, |
| 24 |
;;; while RETURN-REP-TYPE is a representation type, i.e. the C type of the |
| 25 |
;;; output expression. EXPANSION-STRING is a C/C++ expression template, like the |
| 26 |
;;; ones used by C-INLINE. Finally, KIND can be :ALWAYS or :UNSAFE, depending on |
| 27 |
;;; whether the inline expression should be applied always or only in the unsafe |
| 28 |
;;; compilation mode, respectively. |
| 29 |
;;; |
| 30 |
|
| 31 |
;;; Valid property names for open coded functions are: |
| 32 |
;;; :INLINE-ALWAYS |
| 33 |
;;; :INLINE-UNSAFE non-safe-compile only |
| 34 |
;;; |
| 35 |
;;; Each property is a list of 'inline-info's, where each inline-info is: |
| 36 |
;;; ( types { type | boolean } { string | function } ). |
| 37 |
;;; |
| 38 |
;;; For each open-codable function, open coding will occur only if there exits |
| 39 |
;;; an appropriate property with the argument types equal to 'types' and with |
| 40 |
;;; the return-type equal to 'type'. |
| 41 |
;;; |
| 42 |
;;; The third element is T if and only if side effects may occur by the call of |
| 43 |
;;; the function. Even if *DESTINATION* is TRASH, open code for such a function |
| 44 |
;;; with side effects must be included in the compiled code. |
| 45 |
;;; |
| 46 |
;;; The forth element is T if and only if the result value is a new Lisp object, |
| 47 |
;;; i.e., it must be explicitly protected against GBC. |
| 48 |
|
| 49 |
(defun inline-information (name safety) |
| 50 |
(gethash (list name safety) *inline-information*)) |
| 51 |
|
| 52 |
(defun (setf inline-information) (value name safety) |
| 53 |
(setf (gethash (list name safety) *inline-information*) value)) |
| 54 |
|
| 55 |
(defun %def-inline (name safety arg-types return-host-type expansion |
| 56 |
&key (one-liner t) (exact-return-type nil) |
| 57 |
(multiple-values t) |
| 58 |
&aux arg-host-types) |
| 59 |
(setf safety |
| 60 |
(case safety |
| 61 |
(:unsafe :inline-unsafe) |
| 62 |
(:always :inline-always) |
| 63 |
(t (error "In DEF-INLINE, ~s is a wrong value of SAFETY." safety)))) |
| 64 |
;; Ensure we can inline this form. We only inline when the features are |
| 65 |
;; there (checked above) and when the C types are part of this machine |
| 66 |
;; (checked here). |
| 67 |
(loop for type in (list* return-host-type arg-types) |
| 68 |
unless (or (eq type 'fixnum-float) |
| 69 |
(and (consp type) (eq (car type) 'values)) |
| 70 |
(lisp-type-p type) |
| 71 |
(machine-c-type-p type)) |
| 72 |
do (warn "Dropping inline form for ~A because of missing type ~A" name type) |
| 73 |
(return-from %def-inline)) |
| 74 |
(setf arg-host-types |
| 75 |
(mapcar #'(lambda (x) (if (eq x '*) x (lisp-type->host-type x))) |
| 76 |
arg-types)) |
| 77 |
(when (eq return-host-type t) |
| 78 |
(setf return-host-type :object)) |
| 79 |
(let* ((return-type (if (and (consp return-host-type) |
| 80 |
(eq (first return-host-type) 'values)) |
| 81 |
t |
| 82 |
(host-type->lisp-type return-host-type))) |
| 83 |
(inline-info |
| 84 |
(make-inline-info :name name |
| 85 |
:arg-host-types arg-host-types |
| 86 |
:return-host-type return-host-type |
| 87 |
:return-type return-type |
| 88 |
:arg-types arg-types |
| 89 |
:exact-return-type exact-return-type |
| 90 |
:multiple-values multiple-values |
| 91 |
;; :side-effects (not (si:get-sysprop name 'no-side-effects)) |
| 92 |
:one-liner one-liner |
| 93 |
:expansion expansion))) |
| 94 |
(push inline-info (gethash (list name safety) *inline-information*)))) |
| 95 |
|
| 96 |
(defmacro def-inline (&rest args) |
| 97 |
`(apply #'%def-inline ',args)) |
| 98 |
|
| 99 |
(defun make-inline-information (*machine*) |
| 100 |
(let ((*inline-information* (make-hash-table :size 768 :test 'equal))) |
| 101 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 102 |
;; |
| 103 |
;; ALL FUNCTION DECLARATIONS AND INLINE FORMS |
| 104 |
;; |
| 105 |
(def-inline cl:aref :unsafe (t t t) t "@0;ecl_aref_unsafe(#0,ecl_fixnum(#1)*(#0)->array.dims[1]+ecl_fixnum(#2))") |
| 106 |
(def-inline cl:aref :unsafe ((array t) t t) t "@0;(#0)->array.self.t[ecl_fixnum(#1)*(#0)->array.dims[1]+ecl_fixnum(#2)]") |
| 107 |
(def-inline cl:aref :unsafe ((array bit) t t) :fixnum "@0;ecl_aref_bv(#0,ecl_fixnum(#1)*(#0)->array.dims[1]+ecl_fixnum(#2))") |
| 108 |
(def-inline cl:aref :unsafe ((array t) fixnum fixnum) t "@0;(#0)->array.self.t[#1*(#0)->array.dims[1]+#2]") |
| 109 |
(def-inline cl:aref :unsafe ((array bit) fixnum fixnum) :fixnum "@0;ecl_aref_bv(#0,(#1)*(#0)->array.dims[1]+#2)") |
| 110 |
(def-inline cl:aref :unsafe ((array base-char) fixnum fixnum) :unsigned-char "@0;(#0)->base_string.self[#1*(#0)->array.dims[1]+#2]") |
| 111 |
(def-inline cl:aref :unsafe ((array double-float) fixnum fixnum) :double "@0;(#0)->array.self.df[#1*(#0)->array.dims[1]+#2]") |
| 112 |
(def-inline cl:aref :unsafe ((array single-float) fixnum fixnum) :float "@0;(#0)->array.self.sf[#1*(#0)->array.dims[1]+#2]") |
| 113 |
(def-inline cl:aref :unsafe ((array long-float) fixnum fixnum) :long-double "@0;(#0)->array.self.lf[#1*(#0)->array.dims[1]+#2]") |
| 114 |
(when (member :complex-float *features*) |
| 115 |
(def-inline cl:aref :unsafe ((array si:complex-single-float) fixnum fixnum) :csfloat "@0;(#0)->array.self.csf[#1*(#0)->array.dims[1]+#2]") |
| 116 |
(def-inline cl:aref :unsafe ((array si:complex-double-float) fixnum fixnum) :cdfloat "@0;(#0)->array.self.cdf[#1*(#0)->array.dims[1]+#2]") |
| 117 |
(def-inline cl:aref :unsafe ((array si:complex-long-float) fixnum fixnum) :clfloat "@0;(#0)->array.self.clf[#1*(#0)->array.dims[1]+#2]")) |
| 118 |
|
| 119 |
(def-inline cl:aref :unsafe ((array fixnum) fixnum fixnum) :fixnum "@0;(#0)->array.self.fix[#1*(#0)->array.dims[1]+#2]") |
| 120 |
|
| 121 |
(def-inline cl:aref :always (t t) t "ecl_aref1(#0,ecl_to_size(#1))") |
| 122 |
(def-inline cl:aref :always (t fixnum) t "ecl_aref1(#0,#1)") |
| 123 |
(def-inline cl:aref :unsafe (t t) t "ecl_aref1(#0,ecl_fixnum(#1))") |
| 124 |
(def-inline cl:aref :unsafe ((array bit) t) :fixnum "ecl_aref_bv(#0,ecl_fixnum(#1))") |
| 125 |
(def-inline cl:aref :unsafe ((array bit) fixnum) :fixnum "ecl_aref_bv(#0,#1)") |
| 126 |
(when (member :unicode *features*) |
| 127 |
(def-inline cl:aref :unsafe ((array character) fixnum) :wchar "(#0)->string.self[#1]")) |
| 128 |
(def-inline cl:aref :unsafe ((array base-char) fixnum) :unsigned-char "(#0)->base_string.self[#1]") |
| 129 |
(def-inline cl:aref :unsafe ((array double-float) fixnum) :double "(#0)->array.self.df[#1]") |
| 130 |
(def-inline cl:aref :unsafe ((array single-float) fixnum) :float "(#0)->array.self.sf[#1]") |
| 131 |
(def-inline cl:aref :unsafe ((array long-float) fixnum) :long-double "(#0)->array.self.lf[#1]") |
| 132 |
(when (member :complex-float *features*) |
| 133 |
(def-inline cl:aref :unsafe ((array si:complex-single-float) fixnum) :csfloat "(#0)->array.self.csf[#1]") |
| 134 |
(def-inline cl:aref :unsafe ((array si:complex-double-float) fixnum) :cdfloat "(#0)->array.self.cdf[#1]") |
| 135 |
(def-inline cl:aref :unsafe ((array si:complex-long-float) fixnum) :clfloat "(#0)->array.self.clf[#1]")) |
| 136 |
(def-inline cl:aref :unsafe ((array fixnum) fixnum) :fixnum "(#0)->array.self.fix[#1]") |
| 137 |
|
| 138 |
(def-inline cl:row-major-aref :always (t t) t "ecl_aref(#0,ecl_to_size(#1))") |
| 139 |
(def-inline cl:row-major-aref :always (t fixnum) t "ecl_aref(#0,#1)") |
| 140 |
(def-inline cl:row-major-aref :unsafe (t t) t "ecl_aref_unsafe(#0,ecl_fixnum(#1))") |
| 141 |
(def-inline cl:row-major-aref :unsafe (t fixnum) t "ecl_aref_unsafe(#0,#1)") |
| 142 |
(def-inline cl:row-major-aref :unsafe ((array bit) t) :fixnum "ecl_aref_bv(#0,ecl_fixnum(#1))") |
| 143 |
(def-inline cl:row-major-aref :unsafe ((array bit) fixnum) :fixnum "ecl_aref_bv(#0,#1)") |
| 144 |
(when (member :unicode *features*) |
| 145 |
(def-inline cl:row-major-aref :unsafe ((array character) fixnum) :wchar "(#0)->string.self[#1]")) |
| 146 |
(def-inline cl:row-major-aref :unsafe ((array base-char) fixnum) :unsigned-char "(#0)->base_string.self[#1]") |
| 147 |
(def-inline cl:row-major-aref :unsafe ((array ext:byte8) fixnum) :uint8-t "(#0)->vector.self.b8[#1]") |
| 148 |
(def-inline cl:row-major-aref :unsafe ((array ext:integer8) fixnum) :int8-t "(#0)->vector.self.i8[#1]") |
| 149 |
(def-inline cl:row-major-aref :unsafe ((array ext:byte16) fixnum) :uint16-t "(#0)->vector.self.b16[#1]") |
| 150 |
(def-inline cl:row-major-aref :unsafe ((array ext:integer16) fixnum) :int16-t "(#0)->vector.self.i16[#1]") |
| 151 |
(def-inline cl:row-major-aref :unsafe ((array ext:byte32) fixnum) :uint32-t "(#0)->vector.self.b32[#1]") |
| 152 |
(def-inline cl:row-major-aref :unsafe ((array ext:integer32) fixnum) :int32-t "(#0)->vector.self.i32[#1]") |
| 153 |
(def-inline cl:row-major-aref :unsafe ((array ext:byte64) fixnum) :uint64-t "(#0)->vector.self.b64[#1]") |
| 154 |
(def-inline cl:row-major-aref :unsafe ((array ext:integer64) fixnum) :int64-t "(#0)->vector.self.i64[#1]") |
| 155 |
(def-inline cl:row-major-aref :unsafe ((array long-float) fixnum) :long-double "(#0)->array.self.lf[#1]") |
| 156 |
(def-inline cl:row-major-aref :unsafe ((array double-float) fixnum) :double "(#0)->array.self.df[#1]") |
| 157 |
(def-inline cl:row-major-aref :unsafe ((array single-float) fixnum) :float "(#0)->array.self.sf[#1]") |
| 158 |
(when (member :complex-float *features*) |
| 159 |
(def-inline cl:row-major-aref :unsafe ((array si:complex-single-float) fixnum) :csfloat "(#0)->array.self.csf[#1]") |
| 160 |
(def-inline cl:row-major-aref :unsafe ((array si:complex-double-float) fixnum) :cdfloat "(#0)->array.self.cdf[#1]") |
| 161 |
(def-inline cl:row-major-aref :unsafe ((array si:complex-long-float) fixnum) :clfloat "(#0)->array.self.clf[#1]")) |
| 162 |
(def-inline cl:row-major-aref :unsafe ((array fixnum) fixnum) :fixnum "(#0)->array.self.fix[#1]") |
| 163 |
|
| 164 |
(def-inline si:row-major-aset :always (t t t) t "ecl_aset(#0,ecl_to_size(#1),#2)") |
| 165 |
(def-inline si:row-major-aset :always (t fixnum t) t "ecl_aset(#0,#1,#2)") |
| 166 |
(def-inline si:row-major-aset :unsafe (t t t) t "ecl_aset_unsafe(#0,ecl_fixnum(#1),#2)") |
| 167 |
(def-inline si:row-major-aset :unsafe (t fixnum t) t "ecl_aset_unsafe(#0,#1,#2)") |
| 168 |
(def-inline si:row-major-aset :unsafe ((array t) fixnum t) t "(#0)->vector.self.t[#1]= #2") |
| 169 |
(def-inline si:row-major-aset :unsafe ((array bit) fixnum t) :fixnum "ecl_aset_bv(#0,#1,ecl_fixnum(#2))") |
| 170 |
(def-inline si:row-major-aset :unsafe ((array bit) fixnum fixnum) :fixnum "ecl_aset_bv(#0,#1,#2)") |
| 171 |
(def-inline si:row-major-aset :unsafe ((array base-char) fixnum base-char) :unsigned-char "(#0)->base_string.self[#1]= #2") |
| 172 |
(when (member :unicode *features*) |
| 173 |
(def-inline si:row-major-aset :unsafe ((array character) fixnum character) :wchar "(#0)->string.self[#1]= #2")) |
| 174 |
(def-inline si:row-major-aset :unsafe ((array ext:byte8) fixnum ext:byte8) :uint8-t "(#0)->vector.self.b8[#1]= #2") |
| 175 |
(def-inline si:row-major-aset :unsafe ((array ext:integer8) fixnum ext:integer8) :int8-t "(#0)->vector.self.i8[#1]= #2") |
| 176 |
(def-inline si:row-major-aset :unsafe ((array ext:byte16) fixnum ext:byte16) :uint16-t "(#0)->vector.self.b16[#1]= #2") |
| 177 |
(def-inline si:row-major-aset :unsafe ((array ext:integer16) fixnum ext:integer16) :int16-t "(#0)->vector.self.i16[#1]= #2") |
| 178 |
(def-inline si:row-major-aset :unsafe ((array ext:byte32) fixnum ext:byte32) :uint32-t "(#0)->vector.self.b32[#1]= #2") |
| 179 |
(def-inline si:row-major-aset :unsafe ((array ext:integer32) fixnum ext:integer32) :int32-t "(#0)->vector.self.i32[#1]= #2") |
| 180 |
(def-inline si:row-major-aset :unsafe ((array ext:byte64) fixnum ext:byte64) :uint64-t "(#0)->vector.self.b64[#1]= #2") |
| 181 |
(def-inline si:row-major-aset :unsafe ((array ext:integer64) fixnum ext:integer64) :int64-t "(#0)->vector.self.i64[#1]= #2") |
| 182 |
(def-inline si:row-major-aset :unsafe ((array long-float) fixnum long-float) :long-double "(#0)->array.self.lf[#1]= #2") |
| 183 |
(def-inline si:row-major-aset :unsafe ((array double-float) fixnum double-float) :double "(#0)->array.self.df[#1]= #2") |
| 184 |
(def-inline si:row-major-aset :unsafe ((array single-float) fixnum single-float) :float "(#0)->array.self.sf[#1]= #2") |
| 185 |
(when (member :complex-float *features*) |
| 186 |
(def-inline si:row-major-aset :unsafe ((array si:complex-single-float) fixnum si:complex-single-float) :csfloat "(#0)->array.self.csf[#1]= #2") |
| 187 |
(def-inline si:row-major-aset :unsafe ((array si:complex-double-float) fixnum si:complex-double-float) :cdfloat "(#0)->array.self.cdf[#1]= #2") |
| 188 |
(def-inline si:row-major-aset :unsafe ((array si:complex-long-float) fixnum si:complex-long-float) :clfloat "(#0)->array.self.clf[#1]= #2")) |
| 189 |
(def-inline si:row-major-aset :unsafe ((array fixnum) fixnum fixnum) :fixnum "(#0)->array.self.fix[#1]= #2") |
| 190 |
|
| 191 |
(def-inline si:copy-subarray :always (array ext:array-index array ext:array-index ext:array-index) array "@0;(ecl_copy_subarray(#0,#1,#2,#3,#4),#0)") |
| 192 |
|
| 193 |
(def-inline cl:array-rank :unsafe (array) :fixnum "@0;(((#0)->d.t == t_array)?(#0)->array.rank:1)") |
| 194 |
(def-inline cl:array-rank :always (array) :fixnum "ecl_array_rank(#0)") |
| 195 |
|
| 196 |
(def-inline cl:array-dimension :always (t t) fixnum "ecl_array_dimension(#0,ecl_to_size(#1))") |
| 197 |
(def-inline cl:array-dimension :always (t fixnum) fixnum "ecl_array_dimension(#0,#1)") |
| 198 |
|
| 199 |
(def-inline cl:array-total-size :unsafe (t) :fixnum "((#0)->array.dim)") |
| 200 |
|
| 201 |
(def-inline cl:adjustable-array-p :always (t) :bool "@0;(ECL_ARRAYP(#0)? (void)0: FEtype_error_array(#0),ECL_ADJUSTABLE_ARRAY_P(#0))") |
| 202 |
(def-inline cl:adjustable-array-p :unsafe (array) :bool "ECL_ADJUSTABLE_ARRAY_P(#0)") |
| 203 |
|
| 204 |
(def-inline cl:svref :always (t t) t "ecl_aref1(#0,ecl_to_size(#1))") |
| 205 |
(def-inline cl:svref :always (t fixnum) t "ecl_aref1(#0,#1)") |
| 206 |
(def-inline cl:svref :unsafe (t t) t "(#0)->vector.self.t[ecl_fixnum(#1)]") |
| 207 |
(def-inline cl:svref :unsafe (t fixnum) t "(#0)->vector.self.t[#1]") |
| 208 |
|
| 209 |
(def-inline si:svset :always (t t t) t "ecl_aset1(#0,ecl_to_size(#1),#2)") |
| 210 |
(def-inline si:svset :always (t fixnum t) t "ecl_aset1(#0,#1,#2)") |
| 211 |
(def-inline si:svset :unsafe (t t t) t "((#0)->vector.self.t[ecl_fixnum(#1)]=(#2))") |
| 212 |
(def-inline si:svset :unsafe (t fixnum t) t "(#0)->vector.self.t[#1]= #2") |
| 213 |
|
| 214 |
(def-inline cl:array-has-fill-pointer-p :always (t) :bool "@0;(ECL_ARRAYP(#0)?(void)0:FEtype_error_array(#0),ECL_ARRAY_HAS_FILL_POINTER_P(#0))") |
| 215 |
(def-inline cl:array-has-fill-pointer-p :unsafe (array) :bool "ECL_ARRAY_HAS_FILL_POINTER_P(#0)") |
| 216 |
|
| 217 |
(def-inline cl:fill-pointer :unsafe (t) :fixnum "((#0)->vector.fillp)") |
| 218 |
(def-inline si:fill-pointer-set :unsafe (t fixnum) :fixnum "((#0)->vector.fillp)=(#1)") |
| 219 |
|
| 220 |
;; file character.d |
| 221 |
|
| 222 |
(def-inline cl:standard-char-p :always (character) :bool "ecl_standard_char_p(#0)") |
| 223 |
(def-inline cl:graphic-char-p :always (character) :bool "ecl_graphic_char_p(#0)") |
| 224 |
(def-inline cl:alpha-char-p :always (character) :bool "ecl_alpha_char_p(#0)") |
| 225 |
(def-inline cl:upper-case-p :always (character) :bool "ecl_upper_case_p(#0)") |
| 226 |
(def-inline cl:lower-case-p :always (character) :bool "ecl_lower_case_p(#0)") |
| 227 |
(def-inline cl:both-case-p :always (character) :bool "ecl_both_case_p(#0)") |
| 228 |
(def-inline cl:alphanumericp :always (character) :bool "ecl_alphanumericp(#0)") |
| 229 |
|
| 230 |
(def-inline cl:char= :always (t t) :bool "ecl_char_code(#0)==ecl_char_code(#1)") |
| 231 |
(def-inline cl:char= :always (character character) :bool "(#0)==(#1)") |
| 232 |
|
| 233 |
(def-inline cl:char/= :always (t t) :bool "ecl_char_code(#0)!=ecl_char_code(#1)") |
| 234 |
(def-inline cl:char/= :always (character character) :bool "(#0)!=(#1)") |
| 235 |
|
| 236 |
(def-inline cl:char< :always (character character) :bool "(#0)<(#1)") |
| 237 |
(def-inline cl:char> :always (character character) :bool "(#0)>(#1)") |
| 238 |
(def-inline cl:char<= :always (character character) :bool "(#0)<=(#1)") |
| 239 |
(def-inline cl:char>= :always (character character) :bool "(#0)>=(#1)") |
| 240 |
|
| 241 |
(def-inline cl:char-code :always (character) :fixnum "#0") |
| 242 |
(def-inline cl:code-char :always (fixnum) :wchar "#0") |
| 243 |
|
| 244 |
(def-inline cl:char-upcase :always (base-char) :unsigned-char "ecl_char_upcase(#0)") |
| 245 |
(def-inline cl:char-upcase :always (character) :wchar "ecl_char_upcase(#0)") |
| 246 |
|
| 247 |
(def-inline cl:char-downcase :always (base-char) :unsigned-char "ecl_char_downcase(#0)") |
| 248 |
(def-inline cl:char-downcase :always (character) :wchar "ecl_char_downcase(#0)") |
| 249 |
|
| 250 |
(def-inline cl:char-int :always (character) :fixnum "#0") |
| 251 |
|
| 252 |
;; file ffi.d |
| 253 |
|
| 254 |
(def-inline si:foreign-data-p :always (t) :bool "@0;ECL_FOREIGN_DATA_P(#0)") |
| 255 |
|
| 256 |
;; file file.d |
| 257 |
|
| 258 |
(def-inline cl:input-stream-p :always (stream) :bool "ecl_input_stream_p(#0)") |
| 259 |
(def-inline cl:output-stream-p :always (stream) :bool "ecl_output_stream_p(#0)") |
| 260 |
|
| 261 |
;; file hash.d |
| 262 |
|
| 263 |
(def-inline cl:gethash :always (t t t) t "ecl_gethash_safe(#0,#1,#2)" :multiple-values nil) |
| 264 |
(def-inline cl:gethash :always (t t) t "ecl_gethash_safe(#0,#1,ECL_NIL)" :multiple-values nil) |
| 265 |
(def-inline cl:hash-table-count :unsafe (hash-table) ext:array-index "ecl_hash_table_count(#0)") |
| 266 |
|
| 267 |
;; file list.d |
| 268 |
|
| 269 |
(def-inline cl:car :unsafe (cons) t "ECL_CONS_CAR(#0)") |
| 270 |
(def-inline cl:car :unsafe (t) t "_ecl_car(#0)") |
| 271 |
|
| 272 |
(def-inline si:cons-car :always (t) t "ECL_CONS_CAR(#0)") |
| 273 |
|
| 274 |
(def-inline cl:cdr :unsafe (cons) t "ECL_CONS_CDR(#0)") |
| 275 |
(def-inline cl:cdr :unsafe (t) t "_ecl_cdr(#0)") |
| 276 |
|
| 277 |
(def-inline si:cons-cdr :always (t) t "ECL_CONS_CDR(#0)") |
| 278 |
|
| 279 |
;; BEGIN-GENERATED (gen-cons-sysfun) |
| 280 |
|
| 281 |
(def-inline cl:car :always (t) t "ecl_car(#0)") |
| 282 |
(def-inline cl:car :unsafe (t) t "_ecl_car(#0)") |
| 283 |
(def-inline cl:cdr :always (t) t "ecl_cdr(#0)") |
| 284 |
(def-inline cl:cdr :unsafe (t) t "_ecl_cdr(#0)") |
| 285 |
(def-inline cl:caar :always (t) t "ecl_caar(#0)") |
| 286 |
(def-inline cl:caar :unsafe (t) t "_ecl_caar(#0)") |
| 287 |
(def-inline cl:cdar :always (t) t "ecl_cdar(#0)") |
| 288 |
(def-inline cl:cdar :unsafe (t) t "_ecl_cdar(#0)") |
| 289 |
(def-inline cl:cadr :always (t) t "ecl_cadr(#0)") |
| 290 |
(def-inline cl:cadr :unsafe (t) t "_ecl_cadr(#0)") |
| 291 |
(def-inline cl:cddr :always (t) t "ecl_cddr(#0)") |
| 292 |
(def-inline cl:cddr :unsafe (t) t "_ecl_cddr(#0)") |
| 293 |
(def-inline cl:caaar :always (t) t "ecl_caaar(#0)") |
| 294 |
(def-inline cl:caaar :unsafe (t) t "_ecl_caaar(#0)") |
| 295 |
(def-inline cl:cdaar :always (t) t "ecl_cdaar(#0)") |
| 296 |
(def-inline cl:cdaar :unsafe (t) t "_ecl_cdaar(#0)") |
| 297 |
(def-inline cl:cadar :always (t) t "ecl_cadar(#0)") |
| 298 |
(def-inline cl:cadar :unsafe (t) t "_ecl_cadar(#0)") |
| 299 |
(def-inline cl:cddar :always (t) t "ecl_cddar(#0)") |
| 300 |
(def-inline cl:cddar :unsafe (t) t "_ecl_cddar(#0)") |
| 301 |
(def-inline cl:caadr :always (t) t "ecl_caadr(#0)") |
| 302 |
(def-inline cl:caadr :unsafe (t) t "_ecl_caadr(#0)") |
| 303 |
(def-inline cl:cdadr :always (t) t "ecl_cdadr(#0)") |
| 304 |
(def-inline cl:cdadr :unsafe (t) t "_ecl_cdadr(#0)") |
| 305 |
(def-inline cl:caddr :always (t) t "ecl_caddr(#0)") |
| 306 |
(def-inline cl:caddr :unsafe (t) t "_ecl_caddr(#0)") |
| 307 |
(def-inline cl:cdddr :always (t) t "ecl_cdddr(#0)") |
| 308 |
(def-inline cl:cdddr :unsafe (t) t "_ecl_cdddr(#0)") |
| 309 |
(def-inline cl:caaaar :always (t) t "ecl_caaaar(#0)") |
| 310 |
(def-inline cl:caaaar :unsafe (t) t "_ecl_caaaar(#0)") |
| 311 |
(def-inline cl:cdaaar :always (t) t "ecl_cdaaar(#0)") |
| 312 |
(def-inline cl:cdaaar :unsafe (t) t "_ecl_cdaaar(#0)") |
| 313 |
(def-inline cl:cadaar :always (t) t "ecl_cadaar(#0)") |
| 314 |
(def-inline cl:cadaar :unsafe (t) t "_ecl_cadaar(#0)") |
| 315 |
(def-inline cl:cddaar :always (t) t "ecl_cddaar(#0)") |
| 316 |
(def-inline cl:cddaar :unsafe (t) t "_ecl_cddaar(#0)") |
| 317 |
(def-inline cl:caadar :always (t) t "ecl_caadar(#0)") |
| 318 |
(def-inline cl:caadar :unsafe (t) t "_ecl_caadar(#0)") |
| 319 |
(def-inline cl:cdadar :always (t) t "ecl_cdadar(#0)") |
| 320 |
(def-inline cl:cdadar :unsafe (t) t "_ecl_cdadar(#0)") |
| 321 |
(def-inline cl:caddar :always (t) t "ecl_caddar(#0)") |
| 322 |
(def-inline cl:caddar :unsafe (t) t "_ecl_caddar(#0)") |
| 323 |
(def-inline cl:cdddar :always (t) t "ecl_cdddar(#0)") |
| 324 |
(def-inline cl:cdddar :unsafe (t) t "_ecl_cdddar(#0)") |
| 325 |
(def-inline cl:caaadr :always (t) t "ecl_caaadr(#0)") |
| 326 |
(def-inline cl:caaadr :unsafe (t) t "_ecl_caaadr(#0)") |
| 327 |
(def-inline cl:cdaadr :always (t) t "ecl_cdaadr(#0)") |
| 328 |
(def-inline cl:cdaadr :unsafe (t) t "_ecl_cdaadr(#0)") |
| 329 |
(def-inline cl:cadadr :always (t) t "ecl_cadadr(#0)") |
| 330 |
(def-inline cl:cadadr :unsafe (t) t "_ecl_cadadr(#0)") |
| 331 |
(def-inline cl:cddadr :always (t) t "ecl_cddadr(#0)") |
| 332 |
(def-inline cl:cddadr :unsafe (t) t "_ecl_cddadr(#0)") |
| 333 |
(def-inline cl:caaddr :always (t) t "ecl_caaddr(#0)") |
| 334 |
(def-inline cl:caaddr :unsafe (t) t "_ecl_caaddr(#0)") |
| 335 |
(def-inline cl:cdaddr :always (t) t "ecl_cdaddr(#0)") |
| 336 |
(def-inline cl:cdaddr :unsafe (t) t "_ecl_cdaddr(#0)") |
| 337 |
(def-inline cl:cadddr :always (t) t "ecl_cadddr(#0)") |
| 338 |
(def-inline cl:cadddr :unsafe (t) t "_ecl_cadddr(#0)") |
| 339 |
(def-inline cl:cddddr :always (t) t "ecl_cddddr(#0)") |
| 340 |
(def-inline cl:cddddr :unsafe (t) t "_ecl_cddddr(#0)") |
| 341 |
;; END-GENERATED |
| 342 |
|
| 343 |
(def-inline cl:cons :always (t t) t "CONS(#0,#1)") |
| 344 |
|
| 345 |
(def-inline cl:endp :always (t) :bool "ecl_endp(#0)") |
| 346 |
(def-inline cl:endp :unsafe (t) :bool "#0==ECL_NIL") |
| 347 |
|
| 348 |
(def-inline cl:nth :always (t t) t "ecl_nth(ecl_to_size(#0),#1)") |
| 349 |
(def-inline cl:nth :always (fixnum t) t "ecl_nth(#0,#1)") |
| 350 |
(def-inline cl:nth :unsafe (t t) t "ecl_nth(ecl_fixnum(#0),#1)") |
| 351 |
(def-inline cl:nth :unsafe (fixnum t) t "ecl_nth(#0,#1)") |
| 352 |
|
| 353 |
(def-inline cl:nthcdr :always (t t) t "ecl_nthcdr(ecl_to_size(#0),#1)") |
| 354 |
(def-inline cl:nthcdr :always (fixnum t) t "ecl_nthcdr(#0,#1)") |
| 355 |
(def-inline cl:nthcdr :unsafe (t t) t "ecl_nthcdr(ecl_fixnum(#0),#1)") |
| 356 |
(def-inline cl:nthcdr :unsafe (fixnum t) t "ecl_nthcdr(#0,#1)") |
| 357 |
|
| 358 |
(def-inline cl:last :always (t) t "ecl_last(#0,1)") |
| 359 |
|
| 360 |
(def-inline cl:list :always nil t "ECL_NIL") |
| 361 |
(def-inline cl:list :always (t) t "ecl_list1(#0)") |
| 362 |
|
| 363 |
(def-inline cl:list* :always (t) t "#0") |
| 364 |
(def-inline cl:list* :always (t t) t "CONS(#0,#1)") |
| 365 |
|
| 366 |
(def-inline cl:append :always (t t) t "ecl_append(#0,#1)") |
| 367 |
(def-inline cl:nconc :always (t t) t "ecl_nconc(#0,#1)") |
| 368 |
(def-inline cl:butlast :always (t) t "ecl_butlast(#0,1)") |
| 369 |
(def-inline cl:nbutlast :always (t) t "ecl_nbutlast(#0,1)") |
| 370 |
|
| 371 |
;; file num_arith.d |
| 372 |
|
| 373 |
(def-inline cl:1+ :always (t) t "ecl_one_plus(#0)") |
| 374 |
(def-inline cl:1+ :always (fixnum) t "ecl_make_integer((#0)+1)") |
| 375 |
(def-inline cl:1+ :always (long-float) :long-double "(long double)(#0)+1") |
| 376 |
(def-inline cl:1+ :always (double-float) :double "(double)(#0)+1") |
| 377 |
(def-inline cl:1+ :always (single-float) :float "(float)(#0)+1") |
| 378 |
(when (member :complex-float *features*) |
| 379 |
(def-inline cl:1+ :always (si:complex-single-float) :csfloat "(_Complex float)(#0)+1") |
| 380 |
(def-inline cl:1+ :always (si:complex-double-float) :cdfloat "(_Complex double)(#0)+1") |
| 381 |
(def-inline cl:1+ :always (si:complex-long-float) :clfloat "(_Complex long double)(#0)+1")) |
| 382 |
(def-inline cl:1+ :always (fixnum) :fixnum "(#0)+1" :exact-return-type t) |
| 383 |
|
| 384 |
(def-inline cl:1- :always (t) t "ecl_one_minus(#0)") |
| 385 |
(def-inline cl:1- :always (fixnum) t "ecl_make_integer((#0)-1)") |
| 386 |
(def-inline cl:1- :always (long-float) :long-double "(long double)(#0)-1") |
| 387 |
(def-inline cl:1- :always (double-float) :double "(double)(#0)-1") |
| 388 |
(def-inline cl:1- :always (single-float) :float "(float)(#0)-1") |
| 389 |
(when (member :complex-float *features*) |
| 390 |
(def-inline cl:1- :always (si:complex-single-float) :csfloat "(_Complex float)(#0)-1") |
| 391 |
(def-inline cl:1- :always (si:complex-double-float) :cdfloat "(_Complex double)(#0)-1") |
| 392 |
(def-inline cl:1- :always (si:complex-long-float) :clfloat "(_Complex long double)(#0)-1")) |
| 393 |
(def-inline cl:1- :always (fixnum) :fixnum "(#0)-1" :exact-return-type t) |
| 394 |
|
| 395 |
;; file num_co.d |
| 396 |
|
| 397 |
(def-inline cl:float :always (t single-float) :float "ecl_to_float(#0)") |
| 398 |
(def-inline cl:float :always (t double-float) :double "ecl_to_double(#0)") |
| 399 |
(def-inline cl:float :always (t long-float) :long-double "ecl_to_long_double(#0)") |
| 400 |
(def-inline cl:float :always (fixnum-float) :long-double "((long double)(#0))" :exact-return-type t) |
| 401 |
(def-inline cl:float :always (fixnum-float) :double "((double)(#0))" :exact-return-type t) |
| 402 |
(def-inline cl:float :always (fixnum-float) :float "((float)(#0))" :exact-return-type t) |
| 403 |
|
| 404 |
(def-inline cl:numerator :unsafe (integer) integer "(#0)") |
| 405 |
(def-inline cl:numerator :unsafe (ratio) integer "(#0)->ratio.num") |
| 406 |
|
| 407 |
(def-inline cl:denominator :unsafe (integer) integer "ecl_make_fixnum(1)") |
| 408 |
(def-inline cl:denominator :unsafe (ratio) integer "(#0)->ratio.den") |
| 409 |
|
| 410 |
(def-inline cl:floor :always (t) (values &rest t) "ecl_floor1(#0)") |
| 411 |
(def-inline cl:floor :always (t t) (values &rest t) "ecl_floor2(#0,#1)") |
| 412 |
#+(or) ; does not work well, no multiple values |
| 413 |
(def-inline cl:floor :always (fixnum fixnum) :fixnum "@01;(#0>=0&>0?(#0)/(#1):ecl_ifloor(#0,#1))") |
| 414 |
|
| 415 |
(def-inline cl:ceiling :always (t) (values &rest t) "ecl_ceiling1(#0)") |
| 416 |
(def-inline cl:ceiling :always (t t) (values &rest t) "ecl_ceiling2(#0,#1)") |
| 417 |
|
| 418 |
(def-inline cl:truncate :always (t) (values &rest t) "ecl_truncate1(#0)") |
| 419 |
(def-inline cl:truncate :always (t t) (values &rest t) "ecl_truncate2(#0,#1)") |
| 420 |
#+(or) ; does not work well, no multiple values |
| 421 |
(def-inline cl:truncate :always (fixnum-float) :fixnum "(cl_fixnum)(#0)") |
| 422 |
|
| 423 |
(def-inline cl:round :always (t) (values &rest t) "ecl_round1(#0)") |
| 424 |
(def-inline cl:round :always (t t) (values &rest t) "ecl_round2(#0,#1)") |
| 425 |
|
| 426 |
(def-inline cl:mod :always (t t) t "(ecl_floor2(#0,#1),cl_env_copy->values[1])") |
| 427 |
(def-inline cl:mod :always (fixnum fixnum) :fixnum "@01;(#0>=0&>0?(#0)%(#1):ecl_imod(#0,#1))") |
| 428 |
|
| 429 |
(def-inline cl:rem :always (t t) t "(ecl_truncate2(#0,#1),cl_env_copy->values[1])") |
| 430 |
(def-inline cl:rem :always (fixnum fixnum) :fixnum "(#0)%(#1)") |
| 431 |
|
| 432 |
(def-inline cl:= :always (t t) :bool "ecl_number_equalp(#0,#1)") |
| 433 |
(def-inline cl:= :always (fixnum-float fixnum-float) :bool "(#0)==(#1)") |
| 434 |
|
| 435 |
(def-inline cl:/= :always (t t) :bool "!ecl_number_equalp(#0,#1)") |
| 436 |
(def-inline cl:/= :always (fixnum-float fixnum-float) :bool "(#0)!=(#1)") |
| 437 |
|
| 438 |
(def-inline cl:< :always (t t) :bool "ecl_lower(#0,#1)") |
| 439 |
(def-inline cl:< :always (fixnum-float fixnum-float) :bool "(#0)<(#1)") |
| 440 |
(def-inline cl:< :always (fixnum-float fixnum-float fixnum-float) :bool "@012;((#0)<(#1) && (#1)<(#2))") |
| 441 |
|
| 442 |
(def-inline cl:> :always (t t) :bool "ecl_greater(#0,#1)") |
| 443 |
(def-inline cl:> :always (fixnum-float fixnum-float) :bool "(#0)>(#1)") |
| 444 |
(def-inline cl:> :always (fixnum-float fixnum-float fixnum-float) :bool "@012;((#0)>(#1) && (#1)>(#2))") |
| 445 |
|
| 446 |
(def-inline cl:<= :always (t t) :bool "ecl_lowereq(#0,#1)") |
| 447 |
(def-inline cl:<= :always (fixnum-float fixnum-float) :bool "(#0)<=(#1)") |
| 448 |
(def-inline cl:<= :always (fixnum-float fixnum-float fixnum-float) :bool "@012;((#0)<=(#1) && (#1)<=(#2))") |
| 449 |
|
| 450 |
(def-inline cl:>= :always (t t) :bool "ecl_greatereq(#0,#1)") |
| 451 |
(def-inline cl:>= :always (fixnum-float fixnum-float) :bool "(#0)>=(#1)") |
| 452 |
(def-inline cl:>= :always (fixnum-float fixnum-float fixnum-float) :bool "@012;((#0)>=(#1) && (#1)>=(#2))") |
| 453 |
|
| 454 |
(def-inline cl:max :always (fixnum fixnum) :fixnum "@01;(#0)>=(#1)?#0:#1") |
| 455 |
(def-inline cl:min :always (fixnum fixnum) :fixnum "@01;(#0)<=(#1)?#0:#1") |
| 456 |
(if (member :ieee-floating-point *features*) |
| 457 |
(progn |
| 458 |
(def-inline cl:max :always (t t) t "@01;((ecl_float_nan_p(#1) || ecl_greatereq(#0,#1))?#0:#1)") |
| 459 |
(def-inline cl:min :always (t t) t "@01;((ecl_float_nan_p(#1) || ecl_lowereq(#0,#1))?#0:#1)")) |
| 460 |
(progn |
| 461 |
(def-inline cl:max :always (t t) t "@01;(ecl_greatereq(#0,#1)?#0:#1)") |
| 462 |
(def-inline cl:min :always (t t) t "@01;(ecl_lowereq(#0,#1)?#0:#1)"))) |
| 463 |
|
| 464 |
;; file num_log.d |
| 465 |
|
| 466 |
(def-inline cl:logand :always nil t "ecl_make_fixnum(-1)") |
| 467 |
(def-inline cl:logand :always nil :fixnum "-1") |
| 468 |
(def-inline cl:logand :always (t t) t "ecl_boole(ECL_BOOLAND,(#0),(#1))") |
| 469 |
(def-inline cl:logand :always (fixnum fixnum) :fixnum "((#0) & (#1))") |
| 470 |
|
| 471 |
(def-inline cl:logandc1 :always (t t) t "ecl_boole(ECL_BOOLANDC1,(#0),(#1))") |
| 472 |
(def-inline cl:logandc1 :always (fixnum fixnum) :fixnum "(~(#0) & (#1))") |
| 473 |
|
| 474 |
(def-inline cl:logandc2 :always (t t) t "ecl_boole(ECL_BOOLANDC2,(#0),(#1))") |
| 475 |
(def-inline cl:logandc2 :always (fixnum fixnum) :fixnum "((#0) & ~(#1))") |
| 476 |
|
| 477 |
(def-inline cl:logeqv :always nil t "ecl_make_fixnum(-1)") |
| 478 |
(def-inline cl:logeqv :always nil :fixnum "-1") |
| 479 |
(def-inline cl:logeqv :always (t t) t "ecl_boole(ECL_BOOLEQV,(#0),(#1))") |
| 480 |
(def-inline cl:logeqv :always (fixnum fixnum) :fixnum "(~( (#0) ^ (#1) ))") |
| 481 |
|
| 482 |
(def-inline cl:logior :always nil t "ecl_make_fixnum(0)") |
| 483 |
(def-inline cl:logior :always nil :fixnum "0") |
| 484 |
(def-inline cl:logior :always (t t) t "ecl_boole(ECL_BOOLIOR,(#0),(#1))") |
| 485 |
(def-inline cl:logior :always (fixnum fixnum) :fixnum "((#0) | (#1))") |
| 486 |
|
| 487 |
(def-inline cl:lognand :always (t t) t "ecl_boole(ECL_BOOLNAND,(#0),(#1))") |
| 488 |
(def-inline cl:lognand :always (fixnum fixnum) :fixnum "(~( (#0) & (#1) ))") |
| 489 |
|
| 490 |
(def-inline cl:lognor :always (t t) t "ecl_boole(ECL_BOOLNOR,(#0),(#1))") |
| 491 |
(def-inline cl:lognor :always (fixnum fixnum) :fixnum "(~( (#0) | (#1) ))") |
| 492 |
|
| 493 |
(def-inline cl:lognot :always (t) t "ecl_boole(ECL_BOOLXOR,(#0),ecl_make_fixnum(-1))") |
| 494 |
(def-inline cl:lognot :always (fixnum) :fixnum "(~(#0))") |
| 495 |
|
| 496 |
(def-inline cl:logorc1 :always (t t) t "ecl_boole(ECL_BOOLORC1,(#0),(#1))") |
| 497 |
(def-inline cl:logorc1 :always (fixnum fixnum) :fixnum "(~(#0) | (#1))") |
| 498 |
|
| 499 |
(def-inline cl:logorc2 :always (t t) t "ecl_boole(ECL_BOOLORC2,(#0),(#1))") |
| 500 |
(def-inline cl:logorc2 :always (fixnum fixnum) :fixnum "((#0) | ~(#1))") |
| 501 |
|
| 502 |
(def-inline cl:logxor :always nil t "ecl_make_fixnum(0)") |
| 503 |
(def-inline cl:logxor :always nil :fixnum "0") |
| 504 |
(def-inline cl:logxor :always (t t) t "ecl_boole(ECL_BOOLXOR,(#0),(#1))") |
| 505 |
(def-inline cl:logxor :always (fixnum fixnum) :fixnum "((#0) ^ (#1))") |
| 506 |
|
| 507 |
(def-inline cl:boole :always (fixnum t t) t "ecl_boole((#0),(#1),(#2))") |
| 508 |
|
| 509 |
(def-inline cl:logbitp :always ((integer -29 29) fixnum) :bool "(#1 >> #0) & 1") |
| 510 |
|
| 511 |
(def-inline cl:integer-length :always (t) :cl-index "ecl_integer_length(#0)") |
| 512 |
|
| 513 |
(def-inline cl:zerop :always (t) :bool "ecl_zerop(#0)") |
| 514 |
(def-inline cl:zerop :always (fixnum-float) :bool "(#0)==0") |
| 515 |
|
| 516 |
(def-inline cl:plusp :always (t) :bool "ecl_plusp(#0)") |
| 517 |
(def-inline cl:plusp :always (fixnum-float) :bool "(#0)>0") |
| 518 |
|
| 519 |
(def-inline cl:minusp :always (t) :bool "ecl_minusp(#0)") |
| 520 |
(def-inline cl:minusp :always (fixnum-float) :bool "(#0)<0") |
| 521 |
|
| 522 |
(def-inline cl:oddp :always (t) :bool "ecl_oddp(#0)") |
| 523 |
(def-inline cl:oddp :always (fixnum fixnum) :bool "(#0) & 1") |
| 524 |
|
| 525 |
(def-inline cl:evenp :always (t) :bool "ecl_evenp(#0)") |
| 526 |
(def-inline cl:evenp :always (fixnum fixnum) :bool "~(#0) & 1") |
| 527 |
|
| 528 |
(def-inline cl:abs :always (t t) t "ecl_abs(#0,#1)") |
| 529 |
(def-inline cl:exp :always (t) t "ecl_exp(#0)") |
| 530 |
|
| 531 |
(def-inline cl:expt :always (t t) t "ecl_expt(#0,#1)") |
| 532 |
(def-inline cl:expt :always ((integer 2 2) (integer 0 29)) :fixnum "(1<<(#1))") |
| 533 |
;; Note that the following two inlines are conflicting. CHOOSE-INLINE-INFO |
| 534 |
;; assumes the one that has more specific types. |
| 535 |
(def-inline cl:expt :always ((integer 0 0) (integer 0 0)) :fixnum "1") |
| 536 |
(def-inline cl:expt :always ((integer 0 0) t) :fixnum "0") |
| 537 |
(def-inline cl:expt :always ((integer 1 1) t) :fixnum "1") |
| 538 |
(def-inline cl:expt :always ((long-float 0.0l0 *) long-float) :long-double "powl((long double)#0,(long double)#1)") |
| 539 |
(def-inline cl:expt :always ((double-float 0.0d0 *) double-float) :double "pow((double)#0,(double)#1)") |
| 540 |
(def-inline cl:expt :always ((single-float 0.0f0 *) single-float) :float "powf((float)#0,(float)#1)") |
| 541 |
(when (member :complex-float *features*) |
| 542 |
(def-inline cl:expt :always (si:complex-single-float si:complex-single-float) :csfloat "cpowf(#0,#1)") |
| 543 |
(def-inline cl:expt :always (si:complex-double-float si:complex-double-float) :cdfloat "cpow(#0,#1)") |
| 544 |
(def-inline cl:expt :always (si:complex-long-float si:complex-long-float) :clfloat "cpowl(#0,#1)")) |
| 545 |
|
| 546 |
(def-inline cl:log :always (fixnum-float) :long-double "logl((long double)(#0))" :exact-return-type t) |
| 547 |
(def-inline cl:log :always (fixnum-float) :double "log((double)(#0))" :exact-return-type t) |
| 548 |
(def-inline cl:log :always (fixnum-float) :float "logf((float)(#0))" :exact-return-type t) |
| 549 |
(when (member :complex-float *features*) |
| 550 |
(def-inline cl:log :always (si:complex-single-float) :csfloat "clogf(#0)") |
| 551 |
(def-inline cl:log :always (si:complex-double-float) :cdfloat "clog(#0)") |
| 552 |
(def-inline cl:log :always (si:complex-long-float) :clfloat "clogl(#0)")) |
| 553 |
|
| 554 |
(def-inline cl:sqrt :always (number) number "ecl_sqrt(#0)") |
| 555 |
(def-inline cl:sqrt :always ((long-float 0.0l0 *)) :long-double "sqrtl((long double)(#0))") |
| 556 |
(def-inline cl:sqrt :always ((double-float 0.0d0 *)) :double "sqrt((double)(#0))") |
| 557 |
(def-inline cl:sqrt :always ((single-float 0.0f0 *)) :float "sqrtf((float)(#0))") |
| 558 |
(when (member :complex-float *features*) |
| 559 |
(def-inline cl:sqrt :always (si:complex-single-float) :csfloat "csqrtf(#0)") |
| 560 |
(def-inline cl:sqrt :always (si:complex-double-float) :cdfloat "csqrt(#0)") |
| 561 |
(def-inline cl:sqrt :always (si:complex-long-float) :clfloat "csqrtl(#0)")) |
| 562 |
|
| 563 |
(def-inline cl:sin :always (number) number "ecl_sin(#0)") |
| 564 |
(def-inline cl:sin :always (fixnum-float) :long-double "sinl((long double)(#0))" :exact-return-type t) |
| 565 |
(def-inline cl:sin :always (fixnum-float) :double "sin((double)(#0))" :exact-return-type t) |
| 566 |
(def-inline cl:sin :always (fixnum-float) :float "sinf((float)(#0))" :exact-return-type t) |
| 567 |
(when (member :complex-float *features*) |
| 568 |
(def-inline cl:sin :always (si:complex-single-float) :csfloat "csinf(#0)") |
| 569 |
(def-inline cl:sin :always (si:complex-double-float) :cdfloat "csin(#0)") |
| 570 |
(def-inline cl:sin :always (si:complex-long-float) :clfloat "csinl(#0)")) |
| 571 |
|
| 572 |
(def-inline cl:cos :always (t) number "ecl_cos(#0)") |
| 573 |
(def-inline cl:cos :always (fixnum-float) :long-double "cosl((long double)(#0))" :exact-return-type t) |
| 574 |
(def-inline cl:cos :always (fixnum-float) :double "cos((double)(#0))" :exact-return-type t) |
| 575 |
(def-inline cl:cos :always (fixnum-float) :float "cosf((float)(#0))" :exact-return-type t) |
| 576 |
(when (member :complex-float *features*) |
| 577 |
(def-inline cl:cos :always (si:complex-single-float) :csfloat "ccosf(#0)") |
| 578 |
(def-inline cl:cos :always (si:complex-double-float) :cdfloat "ccos(#0)") |
| 579 |
(def-inline cl:cos :always (si:complex-long-float) :clfloat "ccosl(#0)")) |
| 580 |
|
| 581 |
(def-inline cl:tan :always (t) number "ecl_tan(#0)") |
| 582 |
(def-inline cl:tan :always (fixnum-float) :long-double "tanl((long double)(#0))" :exact-return-type t) |
| 583 |
(def-inline cl:tan :always (fixnum-float) :double "tan((double)(#0))" :exact-return-type t) |
| 584 |
(def-inline cl:tan :always (fixnum-float) :float "tanf((float)(#0))" :exact-return-type t) |
| 585 |
(when (member :complex-float *features*) |
| 586 |
(def-inline cl:tan :always (si:complex-single-float) :csfloat "ctanf(#0)") |
| 587 |
(def-inline cl:tan :always (si:complex-double-float) :cdfloat "ctan(#0)") |
| 588 |
(def-inline cl:tan :always (si:complex-long-float) :clfloat "ctanl(#0)")) |
| 589 |
|
| 590 |
(def-inline cl:sinh :always (t) number "ecl_sinh(#0)") |
| 591 |
(def-inline cl:sinh :always (fixnum-float) :long-double "sinhl((long double)(#0))" :exact-return-type t) |
| 592 |
(def-inline cl:sinh :always (fixnum-float) :double "sinh((double)(#0))" :exact-return-type t) |
| 593 |
(def-inline cl:sinh :always (fixnum-float) :float "sinhf((float)(#0))" :exact-return-type t) |
| 594 |
(when (member :complex-float *features*) |
| 595 |
(def-inline cl:sinh :always (si:complex-single-float) :csfloat "csinhf(#0)") |
| 596 |
(def-inline cl:sinh :always (si:complex-double-float) :cdfloat "csinh(#0)") |
| 597 |
(def-inline cl:sinh :always (si:complex-long-float) :clfloat "csinhl(#0)")) |
| 598 |
|
| 599 |
(def-inline cl:cosh :always (t) number "ecl_cosh(#0)") |
| 600 |
(def-inline cl:cosh :always (fixnum-float) :long-double "coshl((long double)(#0))" :exact-return-type t) |
| 601 |
(def-inline cl:cosh :always (fixnum-float) :double "cosh((double)(#0))" :exact-return-type t) |
| 602 |
(def-inline cl:cosh :always (fixnum-float) :float "coshf((float)(#0))" :exact-return-type t) |
| 603 |
(when (member :complex-float *features*) |
| 604 |
(def-inline cl:cosh :always (si:complex-single-float) :csfloat "ccoshf(#0)") |
| 605 |
(def-inline cl:cosh :always (si:complex-double-float) :cdfloat "ccosh(#0)") |
| 606 |
(def-inline cl:cosh :always (si:complex-long-float) :clfloat "ccoshl(#0)")) |
| 607 |
|
| 608 |
(def-inline cl:tanh :always (t) number "ecl_tanh(#0)") |
| 609 |
(def-inline cl:tanh :always (fixnum-float) :long-double "tanhl((long double)(#0))" :exact-return-type t) |
| 610 |
(def-inline cl:tanh :always (fixnum-float) :double "tanh((double)(#0))" :exact-return-type t) |
| 611 |
(def-inline cl:tanh :always (fixnum-float) :float "tanhf((float)(#0))" :exact-return-type t) |
| 612 |
(when (member :complex-float *features*) |
| 613 |
(def-inline cl:tanh :always (si:complex-single-float) :csfloat "ctanhf(#0)") |
| 614 |
(def-inline cl:tanh :always (si:complex-double-float) :cdfloat "ctanh(#0)") |
| 615 |
(def-inline cl:tanh :always (si:complex-long-float) :clfloat "ctanhl(#0)")) |
| 616 |
|
| 617 |
;; file package.d |
| 618 |
|
| 619 |
;; file pathname.d |
| 620 |
|
| 621 |
(def-inline cl:null :always (t) :bool "#0==ECL_NIL") |
| 622 |
(def-inline cl:symbolp :always (t) :bool "@0;ECL_SYMBOLP(#0)") |
| 623 |
(def-inline cl:atom :always (t) :bool "@0;ECL_ATOM(#0)") |
| 624 |
(def-inline cl:consp :always (t) :bool "@0;ECL_CONSP(#0)") |
| 625 |
(def-inline cl:listp :always (t) :bool "@0;ECL_LISTP(#0)") |
| 626 |
(def-inline cl:numberp :always (t) :bool "ecl_numberp(#0)") |
| 627 |
(def-inline cl:integerp :always (t) :bool "@0;ECL_FIXNUMP(#0)||ECL_BIGNUMP(#0)") |
| 628 |
(def-inline cl:floatp :always (t) :bool "floatp(#0)") |
| 629 |
(def-inline cl:characterp :always (t) :bool "ECL_CHARACTERP(#0)") |
| 630 |
(def-inline si:base-char-p :always (character) :bool "ECL_BASE_CHAR_P(#0)") |
| 631 |
(def-inline cl:stringp :always (t) :bool "@0;ECL_STRINGP(#0)") |
| 632 |
(def-inline si:base-string-p :always (t) :bool "@0;ECL_BASE_STRING_P(#0)") |
| 633 |
(def-inline cl:bit-vector-p :always (t) :bool "@0;ECL_BIT_VECTOR_P(#0)") |
| 634 |
(def-inline cl:vectorp :always (t) :bool "@0;ECL_VECTORP(#0)") |
| 635 |
(def-inline cl:arrayp :always (t) :bool "@0;ECL_ARRAYP(#0)") |
| 636 |
|
| 637 |
(def-inline cl:eq :always (t t) :bool "(#0)==(#1)") |
| 638 |
(def-inline cl:eq :always (fixnum fixnum) :bool "(#0)==(#1)") |
| 639 |
|
| 640 |
(def-inline cl:eql :always (t t) :bool "ecl_eql(#0,#1)") |
| 641 |
(def-inline cl:eql :always (character t) :bool "(ECL_CODE_CHAR(#0)==(#1))") |
| 642 |
(def-inline cl:eql :always (t character) :bool "((#0)==ECL_CODE_CHAR(#1))") |
| 643 |
(def-inline cl:eql :always (character character) :bool "(#0)==(#1)") |
| 644 |
(def-inline cl:eql :always ((not (or complex bignum ratio float)) t) :bool "(#0)==(#1)") |
| 645 |
(def-inline cl:eql :always (t (not (or complex bignum ratio float))) :bool "(#0)==(#1)") |
| 646 |
(def-inline cl:eql :always (fixnum fixnum) :bool "(#0)==(#1)") |
| 647 |
|
| 648 |
(def-inline cl:equal :always (t t) :bool "ecl_equal(#0,#1)") |
| 649 |
(def-inline cl:equal :always (fixnum fixnum) :bool "(#0)==(#1)") |
| 650 |
|
| 651 |
(def-inline cl:equalp :always (t t) :bool "ecl_equalp(#0,#1)") |
| 652 |
(def-inline cl:equalp :always (fixnum fixnum) :bool "(#0)==(#1)") |
| 653 |
|
| 654 |
(def-inline cl:not :always (t) :bool "(#0)==ECL_NIL") |
| 655 |
|
| 656 |
;; file print.d, read.d |
| 657 |
|
| 658 |
(def-inline cl:clear-output :always (stream) NULL "(ecl_clear_output(#0),ECL_NIL)") |
| 659 |
(def-inline cl:finish-output :always (stream) NULL "(ecl_finish_output(#0),ECL_NIL)") |
| 660 |
(def-inline cl:finish-output :always (stream) NULL "(ecl_force_output(#0),ECL_NIL)") |
| 661 |
(def-inline cl:write-char :always (t) t "@0;(ecl_princ_char(ecl_char_code(#0),ECL_NIL),(#0))") |
| 662 |
(def-inline cl:clear-input :always (stream) NULL "(ecl_clear_input(#0),ECL_NIL)") |
| 663 |
(def-inline cl:copy-readtable :always (null null) t "cl_core.standard_readtable") |
| 664 |
|
| 665 |
(def-inline cl:boundp :always (t) :bool "ecl_boundp(cl_env_copy,#0)") |
| 666 |
(def-inline cl:boundp :unsafe ((and symbol (not null))) :bool "ECL_SYM_VAL(cl_env_copy,#0)!=OBJNULL") |
| 667 |
|
| 668 |
(def-inline cl:terpri :always (t) :object "(ecl_terpri(#0))") |
| 669 |
(def-inline cl:print :always (t t) :object "(ecl_print(#0,#1))") |
| 670 |
(def-inline cl:prin1 :always (t t) :object "(ecl_prin1(#0,#1))") |
| 671 |
(def-inline cl:princ :always (t t) :object "(ecl_princ(#0,#1))") |
| 672 |
|
| 673 |
;; file unixsys.d |
| 674 |
|
| 675 |
;; file sequence.d |
| 676 |
|
| 677 |
(def-inline cl:elt :always (t t) t "ecl_elt(#0,ecl_to_size(#1))") |
| 678 |
(def-inline cl:elt :always (t fixnum) t "ecl_elt(#0,#1)") |
| 679 |
(def-inline cl:elt :unsafe (t t) t "ecl_elt(#0,ecl_fixnum(#1))") |
| 680 |
(def-inline cl:elt :unsafe (t fixnum) t "ecl_elt(#0,#1)") |
| 681 |
(def-inline cl:elt :unsafe (vector t) t "ecl_aref_unsafe(#0,ecl_fixnum(#1))") |
| 682 |
(def-inline cl:elt :unsafe (vector fixnum) t "ecl_aref_unsafe(#0,#1)") |
| 683 |
(def-inline cl:aref :unsafe ((array bit) t) :fixnum "ecl_aref_bv(#0,ecl_fixnum(#1))") |
| 684 |
(def-inline cl:aref :unsafe ((array bit) fixnum) :fixnum "ecl_aref_bv(#0,#1)") |
| 685 |
(when (member :unicode *features*) |
| 686 |
(def-inline cl:aref :unsafe ((array character) fixnum) :wchar "(#0)->string.self[#1]")) |
| 687 |
(def-inline cl:aref :unsafe ((array base-char) fixnum) :unsigned-char "(#0)->base_string.self[#1]") |
| 688 |
(def-inline cl:aref :unsafe ((array double-float) fixnum) :double "(#0)->array.self.df[#1]") |
| 689 |
(def-inline cl:aref :unsafe ((array single-float) fixnum) :float "(#0)->array.self.sf[#1]") |
| 690 |
(def-inline cl:aref :unsafe ((array fixnum) fixnum) :fixnum "(#0)->array.self.fix[#1]") |
| 691 |
|
| 692 |
(def-inline si:elt-set :always (t t t) t "ecl_elt_set(#0,ecl_to_size(#1),#2)") |
| 693 |
(def-inline si:elt-set :always (t fixnum t) t "ecl_elt_set(#0,#1,#2)") |
| 694 |
(def-inline si:elt-set :unsafe (t t t) t "ecl_elt_set(#0,ecl_fixnum(#1),#2)") |
| 695 |
(def-inline si:elt-set :unsafe (vector t t) t "ecl_aset_unsafe(#0,ecl_to_size(#1),#2)") |
| 696 |
(def-inline si:elt-set :unsafe (vector fixnum t) t "ecl_aset_unsafe(#0,#1,#2)") |
| 697 |
|
| 698 |
(def-inline cl:length :always (t) :fixnum "ecl_length(#0)") |
| 699 |
(def-inline cl:length :unsafe (vector) :fixnum "(#0)->vector.fillp") |
| 700 |
|
| 701 |
(def-inline cl:copy-seq :always (t) t "ecl_copy_seq(#0)") |
| 702 |
|
| 703 |
;; file character.d |
| 704 |
|
| 705 |
(def-inline cl:char :always (t fixnum) t "ecl_aref1(#0,#1)") |
| 706 |
(def-inline cl:char :always (t fixnum) :wchar "ecl_char(#0,#1)") |
| 707 |
(if (member :unicode *features*) |
| 708 |
(def-inline cl:char :unsafe (ext:extended-string fixnum) :wchar "(#0)->string.self[#1]") |
| 709 |
(progn |
| 710 |
(def-inline cl:char :unsafe (t t) t "ECL_CODE_CHAR((#0)->base_string.self[ecl_fixnum(#1)])") |
| 711 |
(def-inline cl:char :unsafe (t fixnum) :unsigned-char "(#0)->base_string.self[#1]"))) |
| 712 |
(def-inline cl:char :unsafe (base-string fixnum) :unsigned-char "(#0)->base_string.self[#1]") |
| 713 |
|
| 714 |
(def-inline si:char-set :always (t t t) t "si_char_set(#0,#1,#2)") |
| 715 |
(def-inline si:char-set :always (t fixnum t) t "ecl_aset1(#0,#1,#2)") |
| 716 |
(def-inline si:char-set :always (t fixnum character) :wchar "ecl_char_set(#0,#1,#2)") |
| 717 |
|
| 718 |
(unless (member :unicode *features*) |
| 719 |
(def-inline si:char-set :unsafe (t t t) t "@2;((#0)->base_string.self[ecl_fixnum(#1)]=ecl_char_code(#2),(#2))") |
| 720 |
(def-inline si:char-set :unsafe (t fixnum character) :unsigned-char "(#0)->base_string.self[#1]= #2")) |
| 721 |
(def-inline si:char-set :unsafe (base-string t t) t "@2;((#0)->base_string.self[ecl_fixnum(#1)]=ecl_char_code(#2),(#2))") |
| 722 |
(def-inline si:char-set :unsafe (base-string fixnum base-char) :unsigned-char "(#0)->base_string.self[#1]= #2") |
| 723 |
(def-inline si:char-set :unsafe (ext:extended-string t t) t "@2;((#0)->string.self[ecl_fixnum(#1)]=ecl_char_code(#2),(#2))") |
| 724 |
(def-inline si:char-set :unsafe (ext:extended-string fixnum character) :unsigned-char "(#0)->string.self[#1]= #2") |
| 725 |
|
| 726 |
(def-inline cl:schar :always (t t) t "ecl_elt(#0,ecl_to_size(#1))") |
| 727 |
(def-inline cl:schar :always (t fixnum) t "ecl_elt(#0,#1)") |
| 728 |
(def-inline cl:schar :always (t fixnum) :wchar "ecl_char(#0,#1)") |
| 729 |
(def-inline cl:schar :unsafe (base-string t) t "ECL_CODE_CHAR((#0)->base_string.self[ecl_fixnum(#1)])") |
| 730 |
(def-inline cl:schar :unsafe (base-string fixnum) :unsigned-char "(#0)->base_string.self[#1]") |
| 731 |
(if (member :unicode *features*) |
| 732 |
(def-inline cl:schar :unsafe (ext:extended-string fixnum) :wchar "(#0)->string.self[#1]") |
| 733 |
(def-inline cl:schar :unsafe (t fixnum) :unsigned-char "(#0)->base_string.self[#1]")) |
| 734 |
(def-inline si:schar-set :always (t t t) t "ecl_elt_set(#0,ecl_to_size(#1),#2)") |
| 735 |
(def-inline si:schar-set :always (t fixnum t) t "ecl_elt_set(#0,#1,#2)") |
| 736 |
(def-inline si:schar-set :always (t fixnum character) :wchar "ecl_char_set(#0,#1,#2)") |
| 737 |
(if (member :unicode *features*) |
| 738 |
(progn |
| 739 |
(def-inline si:schar-set :unsafe (ext:extended-string fixnum t) :wchar "@2;((#0)->string.self[#1]= ecl_char_code(#2),(#2))") |
| 740 |
(def-inline si:schar-set :unsafe (ext:extended-string fixnum character) :wchar "(#0)->string.self[#1]= #2")) |
| 741 |
(progn |
| 742 |
(def-inline si:schar-set :unsafe (t t t) t "@2;((#0)->base_string.self[ecl_fixnum(#1)]=ecl_char_code(#2),(#2))") |
| 743 |
(def-inline si:schar-set :unsafe (t fixnum base-char) :unsigned-char "(#0)->base_string.self[#1]= #2"))) |
| 744 |
(def-inline si:schar-set :unsafe (base-string t t) t "@2;((#0)->base_string.self[ecl_fixnum(#1)]=ecl_char_code(#2),(#2))") |
| 745 |
(def-inline si:schar-set :unsafe (base-string fixnum base-char) :unsigned-char "(#0)->base_string.self[#1]= #2") |
| 746 |
|
| 747 |
(def-inline cl:string= :always (string string) :bool "ecl_string_eq(#0,#1)") |
| 748 |
|
| 749 |
;; file structure.d |
| 750 |
|
| 751 |
(def-inline si:structure-name :always (structure-object) symbol "ECL_STRUCT_NAME(#0)") |
| 752 |
(def-inline si:structure-ref :always (t t fixnum) t "ecl_structure_ref(#0,#1,#2)") |
| 753 |
(def-inline si:structure-set :always (t t fixnum t) t "ecl_structure_set(#0,#1,#2,#3)") |
| 754 |
|
| 755 |
;; file symbol.d |
| 756 |
|
| 757 |
(def-inline cl:get :always (t t t) t "ecl_get(#0,#1,#2)") |
| 758 |
(def-inline cl:get :always (t t) t "ecl_get(#0,#1,ECL_NIL)") |
| 759 |
|
| 760 |
(def-inline cl:symbol-name :always (t) string "ecl_symbol_name(#0)") |
| 761 |
|
| 762 |
;; Additions used by the compiler. |
| 763 |
;; The following functions do not exist. They are always expanded into the |
| 764 |
;; given C code. References to these functions are generated in the C1 phase. |
| 765 |
|
| 766 |
(def-inline shift>> :always (fixnum fixnum) :fixnum "((#0) >> (- (#1)))") |
| 767 |
(def-inline shift<< :always (fixnum fixnum) :fixnum "((#0) << (#1))") |
| 768 |
|
| 769 |
(def-inline si:short-float-p :always (t) :bool "@0;ECL_SINGLE_FLOAT_P(#0)") |
| 770 |
(def-inline si:single-float-p :always (t) :bool "@0;ECL_SINGLE_FLOAT_P(#0)") |
| 771 |
(def-inline si:double-float-p :always (t) :bool "@0;ECL_DOUBLE_FLOAT_P(#0)") |
| 772 |
(def-inline si:long-float-p :always (t) :bool "@0;ECL_LONG_FLOAT_P(#0)") |
| 773 |
|
| 774 |
(when (member :complex-float *features*) |
| 775 |
(def-inline si::complex-single-float-p :always (t) :bool "@0;ECL_COMPLEX_SINGLE_FLOAT_P(#0)") |
| 776 |
(def-inline si::complex-double-float-p :always (t) :bool "@0;ECL_COMPLEX_DOUBLE_FLOAT_P(#0)") |
| 777 |
(def-inline si::complex-long-float-p :always (t) :bool "@0;ECL_COMPLEX_LONG_FLOAT_P(#0)")) |
| 778 |
|
| 779 |
(def-inline ext:fixnump :always (t) :bool "ECL_FIXNUMP(#0)") |
| 780 |
(def-inline ext:fixnump :always (fixnum) :bool "1") |
| 781 |
|
| 782 |
;; Functions only available with threads |
| 783 |
(when (member :threads *features*) |
| 784 |
(def-inline mp:lock-count :unsafe (mp:lock) fixnum "((#0)->lock.counter)") |
| 785 |
(def-inline mp:compare-and-swap-car :always (cons t t) t "ecl_compare_and_swap(&ECL_CONS_CAR(#0),(#1),(#2))") |
| 786 |
(def-inline mp:atomic-incf-car :always (cons t) t "ecl_atomic_incf(&ECL_CONS_CAR(#0),(#1))") |
| 787 |
(def-inline mp:atomic-incf-car :always (cons fixnum) t "ecl_atomic_incf_by_fixnum(&ECL_CONS_CAR(#0),(#1))") |
| 788 |
|
| 789 |
(def-inline mp:compare-and-swap-cdr :always (cons t t) t "ecl_compare_and_swap(&ECL_CONS_CDR(#0),(#1),(#2))") |
| 790 |
(def-inline mp:atomic-incf-cdr :always (cons t) t "ecl_atomic_incf(&ECL_CONS_CDR(#0),(#1))") |
| 791 |
(def-inline mp:atomic-incf-cdr :always (cons fixnum) t "ecl_atomic_incf_by_fixnum(&ECL_CONS_CDR(#0),(#1))") |
| 792 |
|
| 793 |
(def-inline mp:compare-and-swap-symbol-value :unsafe (symbol t t) t "ecl_compare_and_swap(ecl_bds_ref(ecl_process_env(),(#0)),(#1),(#2))") |
| 794 |
(def-inline mp:atomic-incf-symbol-value :always (t fixnum) t "ecl_atomic_incf_by_fixnum(ecl_bds_ref(ecl_process_env(),(#0)),(#1))") |
| 795 |
(def-inline mp:atomic-incf-symbol-value :unsafe (symbol t) t "ecl_atomic_incf(ecl_bds_ref(ecl_process_env(),(#0)),(#1))") |
| 796 |
(def-inline mp:atomic-incf-symbol-value :unsafe (symbol fixnum) t "ecl_atomic_incf_by_fixnum(ecl_bds_ref(ecl_process_env(),(#0)),(#1))") |
| 797 |
|
| 798 |
(def-inline mp:compare-and-swap-svref :unsafe (t t t t) t "ecl_compare_and_swap((#0)->vector.self.t + ecl_fixnum(#1),(#2),(#3))") |
| 799 |
(def-inline mp:compare-and-swap-svref :unsafe (t fixnum t t) t "ecl_compare_and_swap((#0)->vector.self.t + (#1),(#2),(#3))") |
| 800 |
|
| 801 |
;; :threads are implicit |
| 802 |
(when (member :clos *features*) |
| 803 |
(def-inline mp:compare-and-swap-instance :always (t fixnum t t) t "ecl_compare_and_swap_instance((#0),(#1),(#2),(#3))") |
| 804 |
(def-inline mp:compare-and-swap-instance :unsafe (standard-object fixnum t t) t "ecl_compare_and_swap((#0)->instance.slots+(#1),(#2),(#3))") |
| 805 |
(def-inline mp:atomic-incf-instance :always (t fixnum t) t "ecl_atomic_incf_instance((#0),(#1),(#2))") |
| 806 |
(def-inline mp:atomic-incf-instance :unsafe (standard-object fixnum t) t "ecl_atomic_incf((#0)->instance.slots+(#1),(#2))") |
| 807 |
(def-inline mp:atomic-incf-instance :unsafe (standard-object fixnum fixnum) t "ecl_atomic_incf_by_fixnum((#0)->instance.slots+(#1),(#2))")) |
| 808 |
|
| 809 |
(def-inline mp:compare-and-swap-structure :unsafe (structure-object t fixnum t t) t "ecl_compare_and_swap(&(ECL_STRUCT_SLOT((#0),(#2))),(#3),(#4))")) |
| 810 |
|
| 811 |
;; Functions only available with CLOS |
| 812 |
(when (member :clos *features*) |
| 813 |
(def-inline si:instance-ref :always (t fixnum) t "ecl_instance_ref((#0),(#1))") |
| 814 |
(def-inline si:instance-ref :unsafe (standard-object fixnum) t "(#0)->instance.slots[#1]") |
| 815 |
(def-inline si::instance-slotds :unsafe (standard-object) list "(#0)->instance.slotds") |
| 816 |
|
| 817 |
(def-inline si:instance-set :unsafe (t fixnum t) t "ecl_instance_set((#0),(#1),(#2))") |
| 818 |
(def-inline si:instance-set :unsafe (standard-object fixnum t) t "(#0)->instance.slots[#1]=(#2)") |
| 819 |
|
| 820 |
(def-inline si:instance-class :always (standard-object) t "ECL_CLASS_OF(#0)") |
| 821 |
(def-inline cl:class-of :unsafe (standard-object) t "ECL_CLASS_OF(#0)") |
| 822 |
|
| 823 |
(def-inline si:instancep :always (t) :bool "@0;ECL_INSTANCEP(#0)") |
| 824 |
(def-inline si:unbound :always nil t "ECL_UNBOUND") |
| 825 |
|
| 826 |
(def-inline si:sl-boundp :always (t) :bool "(#0)!=ECL_UNBOUND") |
| 827 |
|
| 828 |
(def-inline clos:standard-instance-access :always (t fixnum) t "ecl_instance_ref((#0),(#1))") |
| 829 |
(def-inline clos:standard-instance-access :unsafe (standard-object fixnum) t "(#0)->instance.slots[#1]") |
| 830 |
|
| 831 |
(def-inline clos:funcallable-standard-instance-access :always (t fixnum) t "ecl_instance_ref((#0),(#1))") |
| 832 |
(def-inline clos:funcallable-standard-instance-access :unsafe (clos:funcallable-standard-object fixnum) t "(#0)->instance.slots[#1]")) |
| 833 |
|
| 834 |
*inline-information*)) |
| 835 |
|
| 836 |
;;; XXX this should be part of the initializer for the compiler instance (but |
| 837 |
;;; currently the compiler is a singleton). |
| 838 |
(setf (machine-inline-information *default-machine*) |
| 839 |
(make-inline-information *default-machine*)) |