(define-integrable addressing-granularity 8)
(define-integrable scheme-type-width 6)
(define-integrable scheme-type-limit #x40)
-(define-integrable scheme-object-width 32) ;could be 64 too
+(define-integrable scheme-object-width (if (fix:fixnum? #x100000000) 64 32))
(define-integrable scheme-datum-width
- ;; See "***" below.
(- scheme-object-width scheme-type-width))
(define-integrable float-width 64)
(define-integrable address-units-per-object
(quotient scheme-object-width addressing-granularity))
-(define-integrable signed-fixnum/upper-limit
- ;; *** This is (expt 2 (-1+ scheme-datum-width)), manually constant-folded.
- #x02000000)
+;; No 64-bit constants in the instruction stream.
+(define-integrable min-long-width 32)
-(define-integrable signed-fixnum/lower-limit
+(define signed-fixnum/upper-limit
+ (expt 2 (- min-long-width scheme-type-width 1)))
+(define signed-fixnum/lower-limit
(- signed-fixnum/upper-limit))
(define-integrable unsigned-fixnum/upper-limit
(define (load-immediate-operand? n)
(or (and (exact-integer? n)
- (<= #x-80000000 n) (<= n #x7FFFFFFF))
+ (<= signed-fixnum/lower-limit n) (< n signed-fixnum/upper-limit))
(flo:flonum? n)))
;; TYPE and DATUM can be constants or registers; address is a register.
(define (ea:address label)
(ea:pc-relative `(- ,label *PC*)))
-(define (ea:uuo-entry-address label)
- ;; LABEL is the uuo-link-label, but the PC to jump to is AFTER the u16
- ;; frame-size.
- (ea:pc-relative `(- (+ ,label 2) *PC*)))
+(define ea:uuo-entry-address
+ (let ((offset
+ ;; LABEL is the uuo-link-label, but the PC to jump to is two
+ ;; opcode bytes before the following word (the link address).
+ (- address-units-per-object 2)))
+ (named-lambda (ea:uuo-entry-address label)
+ (ea:pc-relative `(- (+ ,label ,offset) *PC*)))))
(define (ea:stack-pop)
(ea:post-increment rref:stack-pointer 'WORD))