X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fgeneric%2Futils.lisp;h=7b433a21b61c2dcdb62c140b2efe469ffce09a6c;hb=4d9fb924ec5e084743813bf30528af87ce87c41e;hp=7095f61f079ace77542c03953145b703b9fbec5c;hpb=f1ffbf976aaa50b7b22f126b97e34afe06a91210;p=sbcl.git diff --git a/src/compiler/generic/utils.lisp b/src/compiler/generic/utils.lisp index 7095f61..7b433a2 100644 --- a/src/compiler/generic/utils.lisp +++ b/src/compiler/generic/utils.lisp @@ -17,6 +17,16 @@ (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)))) + ;;;; routines for dealing with static symbols