- (inst mov al-tn (make-ea :byte :base value :disp (- lowtag)))
- (do ((remaining headers (cdr remaining)))
+ (do ((remaining headers (cdr remaining))
+ ;; It is preferable (smaller and faster code) to directly
+ ;; compare the value in memory instead of loading it into
+ ;; a register first. Find out if this is possible and set
+ ;; WIDETAG-TN accordingly. If impossible, generate the
+ ;; register load.
+ ;; Compared to x86 we additionally optimize the cases of a
+ ;; range starting with BIGNUM-WIDETAG or ending with
+ ;; COMPLEX-ARRAY-WIDETAG.
+ (widetag-tn (if (and (null (cdr headers))
+ (or (atom (car headers))
+ (= (caar headers) bignum-widetag)
+ (= (cdar headers) complex-array-widetag)))
+ (make-ea :byte :base value :disp (- lowtag))
+ (progn
+ (inst mov eax-tn (make-ea :dword :base value
+ :disp (- lowtag)))
+ al-tn))))