Changeset 15004 for trunk/source/compiler/X86/x862.lisp
 Timestamp:
 Sep 29, 2011, 9:52:16 AM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/compiler/X86/x862.lisp
r14998 r15004 7308 7308 (^))))) 7309 7309 7310 (defparameter *x862generatecasejump* nil)7310 (defparameter *x862generatecasejump* t) 7311 7311 7312 7312 (defun x862generatecasejump (seg vreg xfer ranges trueforms var otherwise) 7313 (declare (ignorable trueforms var otherwise))7314 7313 (when *x862generatecasejump* 7315 7314 (withx86localvinsnmacros (seg vreg xfer) 7316 (unless (x862mvpassp xfer) 7317 (when ranges 7318 (let* ((min (caar ranges)) 7319 (max min) 7320 (count 0) 7321 (all ())) 7322 (declare (fixnum min max count)) 7323 (when ; determine min,max, count; punt on duplicate keys 7324 (dolist (range ranges t) 7325 (let* ((info (cons (backendgetnextlabel) (pop trueforms)))) 7326 (unless (dolist (val range t) 7327 (declare (fixnum val)) 7328 (when (assoc val all) 7329 (return nil)) 7330 (push (cons val info) all) 7331 (if (< val min) 7332 (setq min val) 7333 (if (> val max) 7334 (setq max val))) 7335 (incf count)) 7336 (return nil)))) 7337 (let* ((span (1+ ( max min)))) 7338 (declare (fixnum span)) 7339 (when (and (typep min '(signedbyte 32)) 7340 (typep ( max min) 'unsignedbyte 32) 7341 (> count 4) 7342 (> count (the fixnum ( span (the fixnum (ash span 2)))))) 7343 (let* ((defaultlabel (backendgetnextlabel)) 7344 (endlabel (backendgetnextlabel)) 7345 (reg ($ *x862argz*))) 7346 (x862useoperator (%nx1operator lexicalreference) 7347 seg reg nil var) 7348 (! cjmp reg (ash min *x862targetfixnumshift*) (ash ( max min) *x862targetfixnumshift*) (aref *backendlabels* defaultlabel)) 7349 (do* ((val min (1+ val))) 7350 ((> val max)) 7351 (declare (fixnum val)) 7352 (let* ((info (assoc val all))) 7353 (! jtabentry (aref *backendlabels* (if info (cadr info) defaultlabel))))) 7354 (let* ((target (x862cdmerge xfer endlabel))) 7355 (dolist (case (nreverse all)) 7356 (let* ((lab (cadr case)) 7357 (form (cddr case))) 7358 (@= lab) 7359 (x862form seg vreg target form))) 7360 (@= defaultlabel) 7361 (x862form seg vreg target otherwise) 7362 (@ endlabel) 7363 (when (x862mvpassp xfer) 7364 (^)) 7365 t))))))))))) 7315 (when ranges 7316 (let* ((min (caar ranges)) 7317 (max min) 7318 (count 0) 7319 (all ())) 7320 (declare (fixnum min max count)) 7321 (when ; determine min,max, count; punt on duplicate keys 7322 (dolist (range ranges t) 7323 (let* ((info (cons (backendgetnextlabel) (pop trueforms)))) 7324 (unless (dolist (val range t) 7325 (declare (fixnum val)) 7326 (when (assoc val all) 7327 (return nil)) 7328 (push (cons val info) all) 7329 (if (< val min) 7330 (setq min val) 7331 (if (> val max) 7332 (setq max val))) 7333 (incf count)) 7334 (return nil)))) 7335 7336 (let* ((span (1+ ( max min)))) 7337 (declare (fixnum span)) 7338 (when (and (typep (ash min *x862targetfixnumshift*) '(signedbyte 32)) 7339 (typep (ash ( max min) *x862targetfixnumshift*) 'unsignedbyte 32) 7340 (> count 4) 7341 (> count (the fixnum ( span (the fixnum (ash span 2)))))) 7342 (let* ((defaultlabel (backendgetnextlabel)) 7343 (endlabel (backendgetnextlabel)) 7344 (reg ($ *x862imm0*))) 7345 (x862useoperator (%nx1operator lexicalreference) 7346 seg reg nil var) 7347 (! cjmp reg (ash min *x862targetfixnumshift*) (ash ( max min) *x862targetfixnumshift*) (aref *backendlabels* defaultlabel)) 7348 (do* ((val min (1+ val))) 7349 ((> val max)) 7350 (declare (fixnum val)) 7351 (let* ((info (assoc val all))) 7352 (! jtabentry (aref *backendlabels* (if info (cadr info) defaultlabel))))) 7353 (let* ((target (if (x862mvpassp xfer) 7354 (logior $backendmvpassmask endlabel) 7355 (x862cdmerge xfer endlabel))) 7356 (entrystack (x862encodestack))) 7357 (dolist (case (nreverse all)) 7358 (let* ((lab (cadr case)) 7359 (form (cddr case))) 7360 (@= lab) 7361 (multiplevaluesetq (*x862undocount* 7362 *x862cstack* 7363 *x862vstack* 7364 *x862topvstacklcell*) 7365 (x862decodestack entrystack)) 7366 (x862undobody seg vreg target form entrystack))) 7367 (@= defaultlabel) 7368 (x862form seg vreg target otherwise) 7369 (@ endlabel) 7370 (when (x862mvpassp xfer) 7371 (let* ((*x862returningvalues* :pass)) 7372 (^))) 7373 t)))))))))) 7366 7374 7367 7375 (defx862 x862if if (seg vreg xfer testform true false &aux testval)
Note: See TracChangeset
for help on using the changeset viewer.