anchor.diff:              from-array from-offset from-width
               to-array to-offset to-width)))
   
  -(defun %bitset-argb-xrgb-mask-1 (nrows ncols colour mask mask-offset mask-stride to to-offset to-stride)
  -  (dotimes (y nrows)
  -    (dotimes (x ncols)
  -      (unless (zerop (row-major-aref mask (+ mask-offset x (* y mask-stride))))
  -        (alpha-blend-one-argb8888-xrgb8888 to (+ to-offset x (* y to-stride)) colour)))))
  -
  -(defun %bitset-xrgb-xrgb-mask-1 (nrows ncols colour mask mask-offset mask-stride to to-offset to-stride)
  -  (dotimes (y nrows)
  -    (dotimes (x ncols)
  -      (unless (zerop (row-major-aref mask (+ mask-offset x (* y mask-stride))))
  -        (set-one-argb8888-xrgb8888 to (+ to-offset x (* y to-stride)) colour)))))
  +;;; SETTER NCOLS COLOUR MASK MASK-OFFSET TO TO-OFFSET
  +(sys.int::define-lap-function %bitset-mask-1-line ()
  +  (sys.lap-x86:mov64 :rsi :r11)
  +  (sys.lap-x86:sar64 :rsi 3) ; RSI = MASK address (byte address)
  +  (sys.lap-x86:mov64 :rdi (:lsp 0))
  +  (sys.lap-x86:sar64 :rdi 3) ; RSI = TO address (byte address)
  +  (sys.lap-x86:sar64 (:lsp 8) 1) ; (:lsp 8) = TO-OFFSET (*4)
  +  (sys.lap-x86:add64 :rdi (:lsp 8)) ; RDI = TO + TO-OFFSET, first pixel on the line.
  +  (sys.lap-x86:sar64 :r10 3) ; R10 = colour (raw)
  +  (sys.lap-x86:sar64 :r12 3) ; R12 = MASK-OFFEST (raw)
  +  (sys.lap-x86:mov64 :rcx :r12)
  +  (sys.lap-x86:and8 :cl #b111111) ; CL = current bit in mask.
  +  (sys.lap-x86:mov32 :eax 1)
  +  (sys.lap-x86:shl64 :rax :cl)
  +  (sys.lap-x86:mov64 :rcx :rax) ; RAX = mask mask.
  +  (sys.lap-x86:sar64 :r12 6) ; R12 = offset to mask word.
  +  (sys.lap-x86:lea64 :rsi (:rsi (:r12 8))) ; (RSI) = current mask word.
  +  (sys.lap-x86:test64 :r9 :r9)
  +  (sys.lap-x86:jmp test)
  +  head
  +  (sys.lap-x86:test64 (:rsi) :rcx)
  +  (sys.lap-x86:jz next)
  +  (sys.lap-x86:mov32 :eax :r10d)
  +  (sys.lap-x86:call :r8)
  +  next
  +  (sys.lap-x86:add64 :rdi 4)
  +  (sys.lap-x86:add64 :rcx :rcx)
  +  (sys.lap-x86:jnc no-carry)
  +  (sys.lap-x86:mov32 :ecx 1)
  +  (sys.lap-x86:add64 :rsi 8)
  +  no-carry
  +  (sys.lap-x86:sub64 :r9 8)
  +  test
  +  (sys.lap-x86:jnz head)
  +  ;; Clear the two data registers that got smashed.
  +  (sys.lap-x86:xor32 :r10d :r10d)
  +  (sys.lap-x86:xor32 :r12d :r12d)
  +  (sys.lap-x86:xor32 :ecx :ecx)
  +  (sys.lap-x86:lea64 :rbx (:lsp 16))
  +  (sys.lap-x86:ret))
  +
  +(declaim (inline bitset-mask-1-whole))
  +(defun %bitset-mask-1-whole (setter nrows ncols colour mask mask-offset mask-stride to to-offset to-stride)
  +  (sys.int::with-deferred-gc ()
  +    (when (sys.int::%array-header-p to)
  +      (setf to (sys.int::%array-header-storage to)))
  +    (unless (integerp to)
  +      (assert (typep to 'simple-array))
  +      (setf to (+ (sys.int::lisp-object-address to) (- sys.int::+tag-array-like+) 8)))
  +    (when (sys.int::%array-header-p mask)
  +      (setf mask (sys.int::%array-header-storage mask)))
  +    (unless (integerp mask)
  +      (assert (typep mask 'simple-array))
  +      (setf mask (+ (sys.int::lisp-object-address mask) (- sys.int::+tag-array-like+) 8)))
  +    (dotimes (y nrows)
  +      (%bitset-mask-1-line setter ncols colour mask mask-offset to to-offset)
  +      (incf mask-offset mask-stride)
  +      (incf to-offset to-stride))))
   
   (defun bitset-argb-xrgb-mask-1 (nrows ncols colour mask-array mask-row mask-col to-array to-row to-col)
     "Fill a rectangle with COLOUR using a 1-bit mask."
  
positive.code:   (sys.lap-x86:movd :eax :mm0)
    ;; EAX = Final pixel.
    set-result
    (sys.lap-x86:mov32 (:rdi :rbx) :eax) ; rdx = pixel (XRGB)
    out
    (sys.lap-x86:mov32 :ecx 8)
    (sys.lap-x86:mov64 :rbx :lsp)
    (sys.lap-x86:ret)
    ;(:align 4) ; 16 byte alignment for XMM. (TODO)
    alpha-shuffle
  
negative.code: ;;;; Optimized pluggable blitter functions.
  ;;;; The low-level pixel blending functions use a custom calling
  ;;;; convetion and must not be called directly from lisp.
  ;;;; RAX contains the source pixel.
  ;;;; RDI contains the address of the destination pixel.
  ;;;; RAX, RBX, RDX and MMX/SSE registers are caller save.
  ;;;; All other registers are callee save.
  ;;;; Higher-level line blenders must be called with the GC deferred.
  
  (in-package #:sys.graphics)
  
  (defun compute-blit-info-dest-src (nrows ncols from-array from-row from-col to-array to-row to-col)
  