anchor.diff:                         :lhs lhs
                          :rhs rhs)))
   
  +(define-builtin sys.int::%single-float-as-integer ((value) result :early t)
  +  (let ((temp (make-instance 'virtual-register :kind :integer)))
  +    (emit (make-instance 'unbox-single-float-instruction
  +                         :source value
  +                         :destination temp))
  +    (emit (make-instance 'box-fixnum-instruction
  +                         :source temp
  +                         :destination result))))
  +
   (define-builtin sys.int::%integer-as-single-float ((value) result :early t)
     (let ((temp (make-instance 'virtual-register :kind :integer)))
       (emit (make-instance 'unbox-fixnum-instruction
  
positive.code:                          :destination rhs-unboxed))
      (emit (make-instance 'x86-fake-three-operand-instruction
                           :opcode 'lap:addss
                           :result result-unboxed
                           :lhs lhs-unboxed
                           :rhs rhs-unboxed))
  
negative.code:                          :destination temp))
      (emit (make-instance 'box-single-float-instruction
                           :source temp
                           :destination result))))
  
  (define-builtin mezzano.runtime::%%coerce-fixnum-to-single-float ((value) result :early t)
    (let ((temp (make-instance 'virtual-register :kind :integer))
          (result-unboxed (make-instance 'virtual-register :kind :single-float)))
      (emit (make-instance 'unbox-fixnum-instruction
                           :source value
                           :destination temp))
      (emit (make-instance 'x86-instruction
                           :opcode 'lap:cvtsi2ss64
                           :operands (list result-unboxed temp)
                           :inputs (list temp)
                           :outputs (list result-unboxed)))
      (emit (make-instance 'box-single-float-instruction
                           :source result-unboxed
                           :destination result))))
  
  (define-builtin sys.int::%%single-float-< ((lhs rhs) :b :early t)
    (let ((lhs-unboxed (make-instance 'virtual-register :kind :single-float))
          (rhs-unboxed (make-instance 'virtual-register :kind :single-float)))
      (emit (make-instance 'unbox-single-float-instruction
                           :source lhs
                           :destination lhs-unboxed))
      (emit (make-instance 'unbox-single-float-instruction
                           :source rhs
                           :destination rhs-unboxed))
      (emit (make-instance 'x86-instruction
                           :opcode 'lap:ucomiss
                           :operands (list lhs-unboxed rhs-unboxed)
                           :inputs (list lhs-unboxed rhs-unboxed)
                           :outputs '()))))
  
  ;; TODO: This needs to check two conditions (P & NE), which the
  ;; compiler can't currently do efficiently.
  (define-builtin sys.int::%%single-float-= ((lhs rhs) result :early t)
    (let ((lhs-unboxed (make-instance 'virtual-register :kind :single-float))
          (rhs-unboxed (make-instance 'virtual-register :kind :single-float))
          (temp-result1 (make-instance 'virtual-register))
          (temp-result2 (make-instance 'virtual-register)))
      (emit (make-instance 'unbox-single-float-instruction
                           :source lhs
                           :destination lhs-unboxed))
      (emit (make-instance 'unbox-single-float-instruction
                           :source rhs
                           :destination rhs-unboxed))
      (emit (make-instance 'x86-instruction
                           :opcode 'lap:ucomiss
                           :operands (list lhs-unboxed rhs-unboxed)
                           :inputs (list lhs-unboxed rhs-unboxed)
                           :outputs '()))
      (emit (make-instance 'constant-instruction
                           :destination temp-result1
                           :value t))
      (emit (make-instance 'x86-fake-three-operand-instruction
                           :opcode 'lap:cmov64p
                           :result temp-result2
                           :lhs temp-result1
                           :rhs `(:constant nil)))
      (emit (make-instance 'x86-fake-three-operand-instruction
                           :opcode 'lap:cmov64ne
                           :result result
                           :lhs temp-result2
                           :rhs `(:constant nil)))))
  
  (define-builtin sys.int::%%truncate-single-float ((value) result :early t)
    (let ((value-unboxed (make-instance 'virtual-register :kind :single-float))
          (result-unboxed (make-instance 'virtual-register :kind :integer)))
      (emit (make-instance 'unbox-single-float-instruction
                           :source value
                           :destination value-unboxed))
      (emit (make-instance 'x86-instruction
                           :opcode 'lap:cvttss2si64
                           :operands (list result-unboxed value-unboxed)
                           :inputs (list value-unboxed)
                           :outputs (list result-unboxed)))
      (emit (make-instance 'box-fixnum-instruction
                           :source result-unboxed
                           :destination result))))
  
  (define-builtin sys.int::%%single-float-/ ((lhs rhs) result :early t)
    (let ((lhs-unboxed (make-instance 'virtual-register :kind :single-float))
          (rhs-unboxed (make-instance 'virtual-register :kind :single-float))
          (result-unboxed (make-instance 'virtual-register :kind :single-float)))
      (emit (make-instance 'unbox-single-float-instruction
                           :source lhs
                           :destination lhs-unboxed))
      (emit (make-instance 'unbox-single-float-instruction
                           :source rhs
                           :destination rhs-unboxed))
      (emit (make-instance 'x86-fake-three-operand-instruction
                           :opcode 'lap:divss
                           :result result-unboxed
                           :lhs lhs-unboxed
                           :rhs rhs-unboxed))
      (emit (make-instance 'box-single-float-instruction
                           :source result-unboxed
                           :destination result))))
  
  (define-builtin sys.int::%%single-float-+ ((lhs rhs) result :early t)
  