Skip to content

Commit

Permalink
1.0.5.53: cleanup LOAD-TYPE macros
Browse files Browse the repository at this point in the history
	* when the LOAD-TYPE macros in the various backends hardcoded '3',
	  they really meant (1- N-WORD-BYTES)--a little reflection on
	  widetags, lowtags, and endian orderings should make this clear
	  (we don't have a 64-bit big-endian port to drive it home, though);
	* catch the spread of magic constants in code/array.lisp.
  • Loading branch information
Nathan Froyd committed May 19, 2007
1 parent dd5b34f commit 9105a2e
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion make.sh
Expand Up @@ -65,7 +65,7 @@ if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ] ; then
else
DEVNULL=/dev/null
fi
SBCL_XC_HOST="${1:-sbcl --disable-debugger --userinit $DEVNULL --sysinit $DEVNULL}"
SBCL_XC_HOST="${1:-sbcl --userinit $DEVNULL --sysinit $DEVNULL}"
export DEVNULL
export SBCL_XC_HOST
echo //SBCL_XC_HOST=\"$SBCL_XC_HOST\"
Expand Down
6 changes: 1 addition & 5 deletions src/code/array.lisp
Expand Up @@ -349,11 +349,7 @@ of specialized arrays is supported."
(:little-endian
(- sb!vm:other-pointer-lowtag))
(:big-endian
;; I'm not completely sure of what this
;; 3 represents symbolically. It's
;; just what all the LOAD-TYPE vops
;; are doing.
(- 3 sb!vm:other-pointer-lowtag)))))
(- (1- n-word-bytes) sb!vm:other-pointer-lowtag)))))
;; WIDETAG-OF needs extra code to handle
;; LIST and FUNCTION lowtags. We're only
;; dispatching on other pointers, so let's
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/hppa/macros.lisp
Expand Up @@ -52,7 +52,7 @@
(:little-endian
`(inst ldb ,offset ,source ,target))
(:big-endian
`(inst ldb (+ ,offset 3) ,source ,target))))
`(inst ldb (+ ,offset (1- n-word-bytes)) ,source ,target))))

;;; Macros to handle the fact that we cannot use the machine native call and
;;; return instructions.
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/mips/macros.lisp
Expand Up @@ -70,7 +70,7 @@
(:little-endian
`(inst lbu ,n-target ,n-source ,n-offset))
(:big-endian
`(inst lbu ,n-target ,n-source (+ ,n-offset 3))))))
`(inst lbu ,n-target ,n-source (+ ,n-offset (1- n-word-bytes)))))))


;;; Macros to handle the fact that we cannot use the machine native call and
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/ppc/macros.lisp
Expand Up @@ -67,7 +67,7 @@
(:little-endian
`(inst lbz ,n-target ,n-source ,n-offset))
(:big-endian
`(inst lbz ,n-target ,n-source (+ ,n-offset 3))))))
`(inst lbz ,n-target ,n-source (+ ,n-offset (1- n-word-bytes)))))))

;;; Macros to handle the fact that we cannot use the machine native call and
;;; return instructions.
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/sparc/macros.lisp
Expand Up @@ -70,7 +70,7 @@
(:little-endian
`(inst ldub ,n-target ,n-source ,n-offset))
(:big-endian
`(inst ldub ,n-target ,n-source (+ ,n-offset 3))))))
`(inst ldub ,n-target ,n-source (+ ,n-offset (1- n-word-bytes)))))))

;;; Macros to handle the fact that we cannot use the machine native call and
;;; return instructions.
Expand Down
3 changes: 2 additions & 1 deletion src/compiler/x86-64/macros.lisp
Expand Up @@ -125,7 +125,8 @@
(make-ea :byte :base ,n-source :disp ,n-offset)))
(:big-endian
`(inst mov ,n-target
(make-ea :byte :base ,n-source :disp (+ ,n-offset 4)))))))
(make-ea :byte :base ,n-source
:disp (+ ,n-offset (1- n-word-bytes))))))))

;;;; allocation helpers

Expand Down
3 changes: 2 additions & 1 deletion src/compiler/x86/macros.lisp
Expand Up @@ -160,7 +160,8 @@
(make-ea :byte :base ,n-source :disp ,n-offset)))
(:big-endian
`(inst mov ,n-target
(make-ea :byte :base ,n-source :disp (+ ,n-offset 3)))))))
(make-ea :byte :base ,n-source
:disp (+ ,n-offset (1- n-word-bytes))))))))

;;;; allocation helpers

Expand Down
2 changes: 1 addition & 1 deletion version.lisp-expr
Expand Up @@ -17,4 +17,4 @@
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
"1.0.5.52"
"1.0.5.53"

0 comments on commit 9105a2e

Please sign in to comment.