     ]
     jit-conditional* ;
 
-[ [ ADDO. ] "overflow_fixnum_add" jit-overflow ] \ fixnum+ define-sub-primitive
-
-[ [ SUBFO. ] "overflow_fixnum_subtract" jit-overflow ] \ fixnum- define-sub-primitive
-
-[
-    ds-reg ds-reg cell-size SUBI
-    jit-save-context
-    3 ds-reg 0 jit-load-cell
-    3 3 jit-shift-tag-bits
-    4 ds-reg cell-size jit-load-cell
-    0 0 LI
-    0 MTXER
-    6 3 4 jit-multiply-low-ov-rc
-    6 ds-reg 0 jit-save-cell
-    [ 0 swap BNS ]
-    [
-        4 4 jit-shift-tag-bits
-        5 vm-reg MR
-        "overflow_fixnum_multiply" jit-call
-    ]
-    jit-conditional*
-] \ fixnum* define-sub-primitive
-
 ! Contexts
 :: jit-switch-context ( reg -- )
     7 0 LI

[ jit-call-quot ]
[ jit-jump-quot ]
\ lazy-jit-compile define-combinator-primitive

! Objects
[
    3 ds-reg 0 jit-load-cell
    3 3 tag-mask get ANDI.
    3 3 tag-bits get jit-shift-left-logical-imm
    3 ds-reg 0 jit-save-cell
] \ tag define-sub-primitive

[
    3 ds-reg 0 jit-load-cell   ! Load m
    4 ds-reg cell-size neg jit-load-cell-update ! Load obj
    3 3 jit-shift-fixnum-slot  ! Shift to a cell-size multiple
    4 4 jit-mask-tag-bits      ! Clear tag bits on obj
    3 4 3 jit-load-cell-x      ! Load cell at &obj[m]
    3 ds-reg 0 jit-save-cell   ! Push the result to the stack
] \ slot define-sub-primitive

[
    ! load string index from stack
    3 ds-reg cell-size neg jit-load-cell
    3 3 jit-shift-tag-bits
    ! load string from stack
    4 ds-reg 0 jit-load-cell
    ! load character
    4 4 string-offset ADDI
    3 3 4 LBZX
    3 3 tag-bits get jit-shift-left-logical-imm
    ! store character to stack
    ds-reg ds-reg cell-size SUBI
    3 ds-reg 0 jit-save-cell
] \ string-nth-fast define-sub-primitive

! Shufflers
[
    ds-reg dup cell-size SUBI
] \ drop define-sub-primitive

[
    ds-reg dup 2 cell-size * SUBI
] \ 2drop define-sub-primitive

[
    ds-reg dup 3 cell-size * SUBI
] \ 3drop define-sub-primitive

[
    3 ds-reg 0 jit-load-cell
    3 ds-reg cell-size jit-save-cell-update
] \ dup define-sub-primitive

[
    3 ds-reg 0 jit-load-cell
    4 ds-reg cell-size neg jit-load-cell
    ds-reg dup 2 cell-size * ADDI
    3 ds-reg 0 jit-save-cell
    4 ds-reg cell-size neg jit-save-cell
] \ 2dup define-sub-primitive

[
    3 ds-reg 0 jit-load-cell
    4 ds-reg cell-size neg jit-load-cell
    5 ds-reg cell-size neg 2 * jit-load-cell
    ds-reg dup cell-size 3 * ADDI
    3 ds-reg 0 jit-save-cell
    4 ds-reg cell-size neg jit-save-cell
    5 ds-reg cell-size neg 2 * jit-save-cell
] \ 3dup define-sub-primitive

[
    3 ds-reg 0 jit-load-cell
    ds-reg dup cell-size SUBI
    3 ds-reg 0 jit-save-cell
] \ nip define-sub-primitive

[
    3 ds-reg 0 jit-load-cell
    ds-reg dup cell-size 2 * SUBI
    3 ds-reg 0 jit-save-cell
] \ 2nip define-sub-primitive

[
    3 ds-reg cell-size neg jit-load-cell
    3 ds-reg cell-size jit-save-cell-update
] \ over define-sub-primitive

[
    3 ds-reg cell-size neg 2 * jit-load-cell
    3 ds-reg cell-size jit-save-cell-update
] \ pick define-sub-primitive

[
    3 ds-reg 0 jit-load-cell
    4 ds-reg cell-size neg jit-load-cell
    4 ds-reg 0 jit-save-cell
    3 ds-reg cell-size jit-save-cell-update
] \ dupd define-sub-primitive

[
    3 ds-reg 0 jit-load-cell
    4 ds-reg cell-size neg jit-load-cell
    3 ds-reg cell-size neg jit-save-cell
    4 ds-reg 0 jit-save-cell
] \ swap define-sub-primitive

[
    3 ds-reg cell-size neg jit-load-cell
    4 ds-reg cell-size neg 2 * jit-load-cell
    3 ds-reg cell-size neg 2 * jit-save-cell
    4 ds-reg cell-size neg jit-save-cell
] \ swapd define-sub-primitive

[
    3 ds-reg 0 jit-load-cell
    4 ds-reg cell-size neg jit-load-cell
    5 ds-reg cell-size neg 2 * jit-load-cell
    4 ds-reg cell-size neg 2 * jit-save-cell
    3 ds-reg cell-size neg jit-save-cell
    5 ds-reg 0 jit-save-cell
] \ rot define-sub-primitive

[
    3 ds-reg 0 jit-load-cell
    4 ds-reg cell-size neg jit-load-cell
    5 ds-reg cell-size neg 2 * jit-load-cell
    3 ds-reg cell-size neg 2 * jit-save-cell
    5 ds-reg cell-size neg jit-save-cell
    4 ds-reg 0 jit-save-cell
] \ -rot define-sub-primitive

[ jit->r ] \ load-local define-sub-primitive

! Comparisons
: jit-compare ( insn -- )

    jit-save-context
    3 jit-switch-context
    jit-push-param ;

: jit-pop-quot-and-param ( -- )
    3 ds-reg 0 jit-load-cell
