- (unless (= start bignum-widetag)
- (inst cmp al-tn start)
- (inst jmp :b when-false)) ; was :l
- (inst cmp al-tn end)
- (if last
- (inst jmp less-or-equal target)
- (inst jmp :be when-true))))))) ; was :le
+ (cond
+ ;; LAST = don't need al-tn later
+ ((and last (not (= start bignum-widetag))
+ (= (+ start 4) end) (= (logcount (logxor start end)) 1))
+ ;; SIMPLE-STRING
+ (inst and al-tn (ldb (byte 8 0) (logeqv start end)))
+ (inst cmp al-tn (ldb (byte 8 0) (logand start end)))
+ (inst jmp equal target))
+ ((and (not last) (null (cddr remaining))
+ (= (+ start 4) end) (= (logcount (logxor start end)) 1)
+ (listp (cadr remaining))
+ (= (+ (caadr remaining) 4) (cdadr remaining))
+ (= (logcount (logxor (caadr remaining) (cdadr remaining))) 1)
+ (= (logcount (logxor (caadr remaining) start)) 1))
+ ;; STRING
+ (inst and al-tn (ldb (byte 8 0) (logeqv start (cdadr remaining))))
+ (inst cmp al-tn (ldb (byte 8 0) (logand start (cdadr remaining))))
+ (inst jmp equal target)
+ ;; we've shortcircuited the DO, so we must return.
+ ;; It's OK to do so, because (NULL (CDDR REMAINING))
+ ;; was true.
+ (return))
+ (t
+ (unless (= start bignum-widetag)
+ (inst cmp al-tn start)
+ (if (= end complex-array-widetag)
+ (progn
+ (aver last)
+ (inst jmp greater-or-equal target))
+ (inst jmp :b when-false))) ; was :l
+ (unless (= end complex-array-widetag)
+ (inst cmp al-tn end)
+ (if last
+ (inst jmp less-or-equal target)
+ (inst jmp :be when-true)))))))))) ; was :le