@@ -124,7 +124,7 @@ call_primitive_6_args_test() ->
124124 State0 = ? BACKEND :new (? JIT_VARIANT_PIC , jit_stream_binary , jit_stream_binary :new (0 )),
125125 % Get bin_ptr from x_reg 0 (similar to get_list_test pattern)
126126 {State1 , RegA } = ? BACKEND :move_to_native_register (State0 , {x_reg , 0 }),
127- State2 = ? BACKEND :and_ (State1 , RegA , ? TERM_PRIMARY_CLEAR_MASK ),
127+ { State2 , RegA } = ? BACKEND :and_ (State1 , { free , RegA } , ? TERM_PRIMARY_CLEAR_MASK ),
128128 % Get another register for the last parameter to test {free, Reg} handling
129129 {State3 , OtherReg } = ? BACKEND :move_to_native_register (State2 , {x_reg , 1 }),
130130 % Call PRIM_BITSTRING_EXTRACT_INTEGER with 6 arguments
@@ -1310,7 +1310,7 @@ call_bif_with_large_literal_integer_test() ->
13101310get_list_test () ->
13111311 State0 = ? BACKEND :new (? JIT_VARIANT_PIC , jit_stream_binary , jit_stream_binary :new (0 )),
13121312 {State1 , Reg } = ? BACKEND :move_to_native_register (State0 , {x_reg , 0 }),
1313- State2 = ? BACKEND :and_ (State1 , Reg , ? TERM_PRIMARY_CLEAR_MASK ),
1313+ { State2 , Reg } = ? BACKEND :and_ (State1 , { free , Reg } , ? TERM_PRIMARY_CLEAR_MASK ),
13141314 State3 = ? BACKEND :move_array_element (State2 , Reg , 1 , {y_reg , 1 }),
13151315 State4 = ? BACKEND :move_array_element (State3 , Reg , 0 , {y_reg , 0 }),
13161316 State5 = ? BACKEND :free_native_registers (State4 , [Reg ]),
@@ -1343,7 +1343,7 @@ is_integer_test() ->
13431343 ? BACKEND :jump_to_label (BSt0 , Label )
13441344 end
13451345 ),
1346- MSt2 = ? BACKEND :and_ (MSt1 , Reg , ? TERM_PRIMARY_CLEAR_MASK ),
1346+ { MSt2 , Reg } = ? BACKEND :and_ (MSt1 , { free , Reg } , ? TERM_PRIMARY_CLEAR_MASK ),
13471347 MSt3 = ? BACKEND :move_array_element (MSt2 , Reg , 0 , Reg ),
13481348 ? BACKEND :if_block (
13491349 MSt3 ,
@@ -1403,7 +1403,7 @@ is_number_test() ->
14031403 BSt1 = cond_jump_to_label (
14041404 {Reg , '&' , ? TERM_PRIMARY_MASK , '!=' , ? TERM_PRIMARY_BOXED }, Label , ? BACKEND , BSt0
14051405 ),
1406- BSt2 = ? BACKEND :and_ (BSt1 , Reg , ? TERM_PRIMARY_CLEAR_MASK ),
1406+ { BSt2 , Reg } = ? BACKEND :and_ (BSt1 , { free , Reg } , ? TERM_PRIMARY_CLEAR_MASK ),
14071407 BSt3 = ? BACKEND :move_array_element (BSt2 , Reg , 0 , Reg ),
14081408 cond_jump_to_label (
14091409 {'and' , [
@@ -1810,7 +1810,7 @@ call_fun_test() ->
18101810 ])
18111811 end
18121812 ),
1813- State5 = ? BACKEND :and_ (State4 , RegCopy , ? TERM_PRIMARY_CLEAR_MASK ),
1813+ { State5 , RegCopy } = ? BACKEND :and_ (State4 , { free , RegCopy } , ? TERM_PRIMARY_CLEAR_MASK ),
18141814 State6 = ? BACKEND :move_array_element (State5 , RegCopy , 0 , RegCopy ),
18151815 State7 = ? BACKEND :if_block (
18161816 State6 , {RegCopy , '&' , ? TERM_BOXED_TAG_MASK , '!=' , ? TERM_BOXED_FUN }, fun (BSt0 ) ->
@@ -2814,7 +2814,7 @@ and_register_exhaustion_negative_test() ->
28142814 {State5 , t2 } = ? BACKEND :move_to_native_register (State4 , {x_reg , 4 }),
28152815 {StateNoRegs , t1 } = ? BACKEND :move_to_native_register (State5 , {x_reg , 5 }),
28162816 % Test negative immediate (-4) which should use NOT+AND with t0 as temp
2817- StateResult = ? BACKEND :and_ (StateNoRegs , t6 , - 4 ),
2817+ { StateResult , t6 } = ? BACKEND :and_ (StateNoRegs , { free , t6 } , - 4 ),
28182818 Stream = ? BACKEND :stream (StateResult ),
28192819 ExpectedDump = <<
28202820 " 0: 01852f83 lw t6,24(a0)\n "
@@ -2839,7 +2839,7 @@ and_register_exhaustion_positive_test() ->
28392839 {State5 , t2 } = ? BACKEND :move_to_native_register (State4 , {x_reg , 4 }),
28402840 {StateNoRegs , t1 } = ? BACKEND :move_to_native_register (State5 , {x_reg , 5 }),
28412841 % Test positive immediate (0x3F) which should use AND with t0 as temp
2842- StateResult = ? BACKEND :and_ (StateNoRegs , t6 , 16#3F ),
2842+ { StateResult , t6 } = ? BACKEND :and_ (StateNoRegs , { free , t6 } , 16#3F ),
28432843 Stream = ? BACKEND :stream (StateResult ),
28442844 ExpectedDump = <<
28452845 " 0: 01852f83 lw t6,24(a0)\n "
0 commit comments