 M: x86 immediate-bitwise? ( n -- ? )
     -0x80000000 0x7fffffff between? ;
 
-: %cmov-float= ( dst src -- )
-    [
-        "no-move" define-label
-
-        "no-move" get [ JNE ] [ JP ] bi
-        MOV
-        "no-move" resolve-label
-    ] with-scope ;
-
-: %cmov-float/= ( dst src -- )
-    [
-        "no-move" define-label
-        "move" define-label
-
-        "move" get JP
-        "no-move" get JE
-        "move" resolve-label
-        MOV
-        "no-move" resolve-label
-    ] with-scope ;
+:: %cmov-float= ( dst src -- )
+    <label> :> no-move
+    no-move [ JNE ] [ JP ] bi
+    dst src MOV
+    no-move resolve-label ;
+
+:: %cmov-float/= ( dst src -- )
+    <label> :> no-move
+    <label> :> move
+    move JP
+    no-move JE
+    move resolve-label
+    dst src MOV
+    no-move resolve-label ;
 
 :: (%compare-float) ( dst src1 src2 cc temp compare -- )
     cc {

    alien-offset [+] MOV ;

M:: x86 %unbox-any-c-ptr ( dst src -- )
    [
        "end" define-label
        dst dst XOR
        ! Is the object f?
        src \ f type-number CMP
        "end" get JE
        ! Compute tag in dst register
        dst src MOV
        dst tag-mask get AND
        ! Is the object an alien?
        dst alien type-number CMP
        ! Add an offset to start of byte array's data
        dst src byte-array-offset [+] LEA
        "end" get JNE
        ! If so, load the offset and add it to the address
        dst src alien-offset [+] MOV
        "end" resolve-label
    ] with-scope ;

: alien@ ( reg n -- op ) cells alien type-number - [+] ;

M:: x86 %box-alien ( dst src temp -- )
    [
        "end" define-label
        dst \ f type-number MOV
        src src TEST
        "end" get JE
        dst 5 cells alien temp %allot
        dst 1 alien@ \ f type-number MOV ! base
        dst 2 alien@ \ f type-number MOV ! expired
        dst 3 alien@ src MOV ! displacement
        dst 4 alien@ src MOV ! address
        "end" resolve-label
    ] with-scope ;

:: %box-displaced-alien/f ( dst displacement -- )
    dst 1 alien@ \ f type-number MOV

        { cc/<>= [ src1 src2 compare call( a b -- ) dst temp \ CMOVP (%boolean) ] }
    } case ; inline

:: %jump-float= ( label -- )
    <label> :> no-jump
    no-jump JP
    label JE
    no-jump resolve-label ;

: %jump-float/= ( label -- )
    [ JNE ] [ JP ] bi ;
