* optimization: stack frames are packed more efficiently on x86oids, which
ought to reduce the frequency of Methuselahn conservative references (it
certainly helps with gc.impure.lisp / BUG-936304 on x86).
+ * optimization: on x86 and x86-64, integer negation forms like (- x) are now
+ recognized in modular arithmetic contexts, and compile to native negate,
+ rather than going through bignums only to keep the low bits.
* bug fix: Compiling potential modularic arithmetic forms does not cause type
errors when some integer types lack lower or upper bounds. (lp#1199127)
* bug fix: Non-trivial modular arithmetic forms are always cut to the right
(def - t)
(def * t))
+(define-modular-fun %negate-mod64 (x) %negate :untagged nil 64)
+(define-vop (%negate-mod64)
+ (:translate %negate-mod64)
+ (:policy :fast-safe)
+ (:args (x :scs (unsigned-reg) :target r))
+ (:arg-types unsigned-num)
+ (:results (r :scs (unsigned-reg)))
+ (:result-types unsigned-num)
+ (:generator 3
+ (move r x)
+ (inst neg r)))
+
+(define-modular-fun %negate-modfx (x) %negate :tagged t #.(- n-word-bits
+ n-fixnum-tag-bits))
+(define-vop (%negate-modfx fast-negate/fixnum)
+ (:translate %negate-modfx))
+
(define-vop (fast-ash-left-mod64-c/unsigned=>unsigned
fast-ash-c/unsigned=>unsigned)
(:translate ash-left-mod64))
;; (no -C variant as x86 MUL instruction doesn't take an immediate)
(def * nil))
+(define-modular-fun %negate-mod32 (x) %negate :untagged nil 32)
+(define-vop (%negate-mod32)
+ (:translate %negate-mod32)
+ (:policy :fast-safe)
+ (:args (x :scs (unsigned-reg) :target r))
+ (:arg-types unsigned-num)
+ (:results (r :scs (unsigned-reg)))
+ (:result-types unsigned-num)
+ (:generator 3
+ (move r x)
+ (inst neg r)))
+
+(define-modular-fun %negate-modfx (x) %negate :tagged t #.(- n-word-bits
+ n-fixnum-tag-bits))
+(define-vop (%negate-modfx fast-negate/fixnum)
+ (:translate %negate-modfx))
(define-vop (fast-ash-left-mod32-c/unsigned=>unsigned
fast-ash-c/unsigned=>unsigned)