d-mod fx1 fx2)
    (assert-fixnum fx1 fx2)
    (div-and-mod fx1 fx2))

  (define (fxdiv0 fx1 fx2)
    (assert-fixnum fx1 fx2)
    (div0 fx1 fx2))
  
  (define (fxmod0 fx1 fx2)
    (assert-fixnum fx1 fx2)
    (mod0 fx1 fx2))

  (define (fxdiv0-and-mod0 fx1 fx2)
    (assert-fixnum fx1 fx2)
    (div0-and-mod0 fx1 fx2))

  (define (fx+/carry fx1 fx2 fx3)
    (assert-fixnum fx1 fx2 fx3)
    (let* ((s (+ fx1 fx2 fx3))
	   (s0 (mod0 s (expt 2 (fixnum-width))))
	   (s1 (div0 s (expt 2 (fixnum-width)))))
      (values s0 s1)))

  (define (fx-/carry fx1 fx2 fx3)
    (assert-fixnum fx1 fx2 fx3)
    (let* ((d (- fx1 fx2 fx3))
	   (d0 (mod0 d (expt 2 (fixnum-width))))
	   (d1 (div0 d (expt 2 (fixnum-width)))))
      (values d0 d1)))

  (define (fx*/carry fx1 fx2 fx3)
    (assert-fixnum fx1 fx2 fx3)
    (let* ((s (+ (* fx1 fx2) fx3))
	   (s0 (mod0 s (expt 2 (fixnum-width))))
	   (s1 (div0 s (expt 2 (fixnum-width)))))
      (values s0 s1)))

  (define (fxnot fx) (assert-fixnum fx) (lognot fx))
  (define-fxop* fxand logand)
  (define-fxop* fxior logior)
  (define-fxop* fxxor logxor)

  (define (fxif fx1 fx2 fx3) 
    (assert-fixnum fx1 fx2 fx3) 
    (bitwise-if fx1 fx2 fx3))

  (define (fxbit-count fx)
    (assert-fixnum fx)
    (if (negative? fx)
        (bitwise-not (logcount fx))
        (logcount fx)))

  (define (fxlength fx) (assert-fixnum fx) (bitwise-length fx))
  (define (fxfirst-bit-set fx) (assert-fixnum fx) (bitwise-first-bit-set fx))
  (define (fxbit-set? fx1 fx2) (assert-fixnum fx1 fx2) (logbit? fx2 fx1))

  (define (fxcopy-bit fx1 fx2 fx3) 
    (assert-fixnum fx1 fx2 fx3) 
    (unless (and (<= 0 fx2) (< fx2 (fixnum-width)))
      (raise (make-assertion-violation)))
    (bitwise-copy-bit fx1 fx2 fx3))

  (define (fxbit-field fx1 fx2 fx3)
    (assert-fixnum fx1 fx2 fx3)
    (unless (and (<= 0 fx2 fx3) (< fx3 (fixnum-width)))
      (raise (make-assertion-violation)))
    (bitwise-bit-field fx1 fx2 fx3))

  (define (fxcopy-bit-field fx1 fx2 fx3 fx4)
    (assert-fixnum fx1 fx2 fx3 fx4)
    (unless (and (<= 0 fx2 fx3) (< fx3 (fixnum-width)))
      (raise (make-assertion-violation)))
    (bitwise-copy-bit-field fx1 fx2 fx3 fx4))

  (define (fxarithmetic-shift fx1 fx2)
    (assert-fixnum fx1 fx2)
    (unless (< (abs fx2) (fixnum-width))
      (raise (make-assertion-violation)))
    (ash fx1 fx2))

  (define (fxarithmetic-shift-left fx1 fx2)
    (assert-fixnum fx1 fx2)
    (unless (and (<= 0 fx2) (< fx2 (fixnum-width)))
      (raise (make-assertion-violation)))
    (ash fx1 fx2))

  (define (fxarithmetic-shift-right fx1 fx2)
    (assert-fixnum fx1 fx2)
    (unless (and (<= 0 fx2) (< fx2 (fixnum-width)))
      (raise (make-assertion-violation)))
    (ash fx1 (- fx2)))

  (define (fxrotate-bit-field fx1 fx2 fx3 fx4)
    (assert-fixnum fx1 fx2 fx3 fx4)
    (unless (and (<= 0 fx2 fx3) (< fx3 (fixnum-width)) (< fx4 (- fx3 fx2)))
      (raise (make-assertion-violation)))
    (bitwise-rotate-bit-field fx1 fx2 fx3 fx4))
  
  (define (fxreverse-bit-field fx1 fx2 fx3)
    (assert-fixnum fx1 fx2 fx3)
    (unless (and (<= 0 fx2 fx3) (< fx3 (fixnum-width)))
      (raise (make-assertion-violation)))
    (bitwise-reverse-bit-field fx1 fx2 fx3))

)
