Changeset 14705
 Timestamp:
 Apr 5, 2011, 5:28:25 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/compiler/acoderewrite.lisp
r14421 r14705 27 27 ;;; Rewrite acode trees. 28 28 29 ;(nextnxdefops)30 29 (defvar *acoderewritefunctions* nil) 31 30 (let* ((newsize (%i+ (nextnxnumops) 10)) … … 182 181 (setf (car typecons) intersection)))) 183 182 183 184 # 185 (defun acodesetimmediatetype (typecons acodeexpr) 186 (let* ((type 187 (cond ((nxnull acodeexpr) 'null) 188 ((nxt acodeexpr) '(eql t)) 189 (( 190 # 184 191 185 192 … … 291 298 292 299 300 (defacoderewrite acoderewrite%gvector %gvector typecons (arglist) 301 (let* ((allargs (append (car arglist) (reverse (cadr arglist))))) 302 (dolist (arg allargs) 303 (rewriteacodeform arg t)) 304 ;; Could try to map constant subtag to type here 305 )) 306 307 (defacoderewrite acoderewritecharcode (%charcode charcode) typecons (&whole w c) 308 (rewriteacodeform c t) 309 (let* ((char (acodeconstantp c))) 310 (when char 311 (let* ((code (charcode char))) 312 (setf (car w) (%nx1operator fixnum) 313 (cadr w) code 314 (cddr w) nil))) 315 (acodetypemerge typecons 'validcharcode))) 316 317 (defacoderewrite acoderewrite%ilogior2 %ilogior2 typecons (&whole w x y) 318 (acodeconstantfoldnumericbinop typecons w x y 'logior) 319 (acodetypemerge typecons `(or ,(acodeformtype x *acoderewritetrustdeclarations*) ,(acodeformtype y *acoderewritetrustdeclarations*)))) 320 321 (defacoderewrite acoderewrite%ilogand2 %ilogand2 typecons (&whole w x y) 322 (acodeconstantfoldnumericbinop typecons w x y 'logand) 323 (acodetypemerge typecons `(and ,(acodeformtype x *acoderewritetrustdeclarations*) ,(acodeformtype y *acoderewritetrustdeclarations*)))) 324 325 (defacoderewrite acoderewrite%ilogxor %ilogxor2 typecons (&whole w x y) 326 (acodeconstantfoldnumericbinop typecons w x y 'logxor)) 327 328 (defacoderewrite acoderewrite%ineg %ineg typecons (&whole w x) 329 (rewriteacodeform x 'fixnum) 330 (let* ((val (acodefixnumformp x)) 331 (negated (if val ( val)))) 332 (if negated 333 (setf (acodeoperator w) (if (typep negated *nxtargetfixnumtype*) 334 (%nx1operator fixnum) 335 (%nx1operator immediate)) 336 (cadr w) negated 337 (cddr w) nil)))) 338 339 340 341 342 293 343 294 344
Note: See TracChangeset
for help on using the changeset viewer.