Changeset 10977 for trunk/source/compiler/PPC/ppc2.lisp
 Timestamp:
 Oct 5, 2008, 2:35:06 AM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/compiler/PPC/ppc2.lisp
r10976 r10977 2591 2591 2592 2592 2593 (defun ppc2longconstantp (form) 2594 (setq form (acodeunwrappedform form)) 2595 (or (acodefixnumformp form) 2596 (and (acodep form) 2597 (eq (acodeoperator form) (%nx1operator immediate)) 2598 (setq form (%cadr form)) 2599 (if (integerp form) 2600 form)))) 2593 (defun ppc2integerconstantp (form mode) 2594 (let* ((val 2595 (or (acodefixnumformp (setq form (acodeunwrappedform form))) 2596 (and (acodep form) 2597 (eq (acodeoperator form) (%nx1operator immediate)) 2598 (setq form (%cadr form)) 2599 (if (typep form 'integer) 2600 form))))) 2601 (and val (%typep val (modespecifiertype mode)) val))) 2601 2602 2602 2603 … … 2634 2635 2635 2636 2636 ;;; treat form as a 32bit immediate value and load it into immreg.2637 ;;; This is the "lenient" version of 32bitness; OSTYPEs and chars2638 ;;; count, and we don't care about the integer's sign.2639 2637 2640 2638 (defun ppc2unboxedintegerargtoreg (seg form immreg &optional ffiargtype) … … 2646 2644 (:unsignedhalfword :u16) 2647 2645 (:signedfullword :s32) 2648 (:unsignedfullword :u32))) 2646 (:unsignedfullword :u32) 2647 (:unsigneddoubleword :u64) 2648 (:signeddoubleword :s64))) 2649 2649 (modeval (gprmodenamevalue mode))) 2650 2650 (withppclocalvinsnmacros (seg) 2651 (let* ((value (ppc2 longconstantp form)))2651 (let* ((value (ppc2integerconstantp form mode))) 2652 2652 (if value 2653 2653 (if (eql value 0) … … 4085 4085 (ppc2%immediatesetptr seg vreg xfer ptr offset val) 4086 4086 (let* ((size (logand #xf bits)) 4087 ( longp (eq size 4))4087 (nbits (ash size 3)) 4088 4088 (signed (not (logbitp 5 bits))) 4089 (intval ( if longp (ppc2longconstantp val) (acodefixnumformp val)))4089 (intval (acodeintegerconstantp val nbits)) 4090 4090 (offval (acodefixnumformp offset)) 4091 4091 (absptr (and offval (acodeabsoluteptrp ptr))) … … 4639 4639 cd)) 4640 4640 4641 (defun ppc2longconstantp (form) 4642 (setq form (acodeunwrappedform form)) 4643 (or (acodefixnumformp form) 4644 (and (acodep form) 4645 (eq (acodeoperator form) (%nx1operator immediate)) 4646 (setq form (%cadr form)) 4647 (if (integerp form) 4648 form 4649 (progn 4650 (if (symbolp form) (setq form (symbolname form))) 4651 (if (and (stringp form) (eql (length form) 4)) 4652 (logior (ash (%charcode (char form 0)) 24) 4653 (ash (%charcode (char form 1)) 16) 4654 (ash (%charcode (char form 2)) 8) 4655 (%charcode (char form 3))) 4656 (if (characterp form) (%charcode form)))))))) 4641 4657 4642 4658 4643 ;;; execute body, cleanup afterwards (if need to) … … 8352 8337 (let* ((valform (car vals)) 8353 8338 (spec (car specs)) 8354 (longval (ppc2longconstantp valform))8355 8339 (absptr (acodeabsoluteptrp valform))) 8356 8340 (case spec … … 8414 8398 (valreg :natural) 8415 8399 (let* ((reg valreg)) 8416 (if longval 8417 (ppc2lri seg valreg longval) 8418 (setq reg (ppc2unboxedintegerargtoreg seg valform valreg spec))) 8400 (setq reg (ppc2unboxedintegerargtoreg seg valform valreg spec)) 8419 8401 (! setcarg reg nextarg)))))) 8420 8402 (unless (eq spec :registers)(incf nextarg))))
Note: See TracChangeset
for help on using the changeset viewer.