(ucode-primitive weak-car 1)
(ucode-primitive weak-cdr 1)))
\f
+;; These primitives vary from machine to machine in the microcode. We
+;; could emulate them based on the system characteristics, but for now
+;; it will be easier to just avoid constant-folding them.
+;;
+;; XXX If we ever transition to a system where flonums are not IEEE 754
+;; binary64 floating-point, we'll have to list all the flonum
+;; primitives here too.
+
+(define machine-dependent-primitives
+ (list (ucode-primitive primitive-object-ref 2)
+ (ucode-primitive system-vector-ref 2)
+ (ucode-primitive system-vector-size 1)))
+\f
;;;; "Foldable" and side-effect-free operators
(define boolean-valued-function-variables)
(define-integrable (boolean-valued-function-primitive? operator)
(memq operator boolean-valued-function-primitives))
-(define-integrable (constant-foldable-primitive? operator)
- (memq operator function-primitives))
+(define (constant-foldable-primitive? operator)
+ (and (memq operator function-primitives)
+ (or (not compiler:cross-compiling?))
+ (not (memq operator machine-dependent-primitives))))
(define-integrable (side-effect-free-primitive? operator)
(memq operator side-effect-free-primitives))