5 ;;;; Moves and coercions:
7 ;;; Move a tagged char to an untagged representation.
9 (define-vop (move-to-base-char)
10 (:args (x :scs (any-reg descriptor-reg)))
11 (:results (y :scs (base-char-reg)))
13 (inst srl y x n-widetag-bits)))
15 (define-move-vop move-to-base-char :move
16 (any-reg descriptor-reg) (base-char-reg))
19 ;;; Move an untagged char to a tagged representation.
21 (define-vop (move-from-base-char)
22 (:args (x :scs (base-char-reg)))
23 (:results (y :scs (any-reg descriptor-reg)))
25 (inst sll y x n-widetag-bits)
26 (inst or y y base-char-widetag)))
28 (define-move-vop move-from-base-char :move
29 (base-char-reg) (any-reg descriptor-reg))
31 ;;; Move untagged base-char values.
33 (define-vop (base-char-move)
36 :load-if (not (location= x y))))
37 (:results (y :scs (base-char-reg)
38 :load-if (not (location= x y))))
44 (define-move-vop base-char-move :move
45 (base-char-reg) (base-char-reg))
48 ;;; Move untagged base-char arguments/return-values.
50 (define-vop (move-base-char-arg)
54 :load-if (not (sc-is y base-char-reg))))
61 (storew x fp (tn-offset y))))))
63 (define-move-vop move-base-char-arg :move-arg
64 (any-reg base-char-reg) (base-char-reg))
67 ;;; Use standard MOVE-ARGUMENT + coercion to move an untagged base-char
68 ;;; to a descriptor passing location.
70 (define-move-vop move-arg :move-arg
71 (base-char-reg) (any-reg descriptor-reg))
75 ;;;; Other operations:
77 (define-vop (char-code)
78 (:translate char-code)
80 (:args (ch :scs (base-char-reg) :target res))
81 (:arg-types base-char)
82 (:results (res :scs (any-reg)))
83 (:result-types positive-fixnum)
87 (define-vop (code-char)
88 (:translate code-char)
90 (:args (code :scs (any-reg) :target res))
91 (:arg-types positive-fixnum)
92 (:results (res :scs (base-char-reg)))
93 (:result-types base-char)
95 (inst srl res code 2)))
98 ;;; Comparison of base-chars.
100 (define-vop (base-char-compare pointer-compare)
101 (:args (x :scs (base-char-reg))
102 (y :scs (base-char-reg)))
103 (:arg-types base-char base-char))
105 (define-vop (fast-char=/base-char base-char-compare)
109 (define-vop (fast-char</base-char base-char-compare)
113 (define-vop (fast-char>/base-char base-char-compare)