(if (fixnump num)
(ash num (1- n-lowtag-bits))
(error "~W is too big for a fixnum." num)))
+
+;;; Determining whether a constant offset fits in an addressing mode.
+#!+(or x86 x86-64)
+(defun foldable-constant-offset-p (element-size lowtag data-offset offset)
+ (if (< element-size n-byte-bits)
+ nil
+ (multiple-value-bind (min max)
+ (sb!impl::displacement-bounds lowtag element-size data-offset)
+ (<= min offset max))))
+
\f
;;;; routines for dealing with static symbols