@@ -880,7 +880,7 @@ impl Assembler {
880880 // It's split here to support IncrCounter in compile_exits.
881881 assert ! ( matches!( mem, Opnd :: UImm ( _) ) ) ;
882882 asm. load_into ( SCRATCH0_OPND , mem) ;
883- asm. lea_into ( SCRATCH0_OPND , Opnd :: mem ( 64 , SCRATCH0_OPND , 0 ) ) ;
883+ asm. lea_into ( SCRATCH0_OPND , Opnd :: mem ( VALUE_BITS , SCRATCH0_OPND , 0 ) ) ;
884884
885885 // Create a local loop to atomically increment a counter using SCRATCH1_OPND to check if it succeeded.
886886 // Note that arm64_emit will peek at the next Cmp to set a status into SCRATCH1_OPND on IncrCounter.
@@ -1741,13 +1741,13 @@ mod tests {
17411741 asm. frame_setup ( JIT_PRESERVED_REGS ) ;
17421742
17431743 let val64 = asm. add ( CFP , Opnd :: UImm ( 64 ) ) ;
1744- asm. store ( Opnd :: mem ( 64 , SP , 0x10 ) , val64) ;
1744+ asm. store ( Opnd :: mem ( VALUE_BITS , SP , 0x10 ) , val64) ;
17451745 let side_exit = Target :: SideExit { reason : SideExitReason :: Interrupt , exit : SideExit { pc : Opnd :: const_ptr ( 0 as * const u8 ) , stack : vec ! [ ] , locals : vec ! [ ] } } ;
17461746 asm. push_insn ( Insn :: Joz ( val64, side_exit) ) ;
1747- asm. parallel_mov ( vec ! [ ( C_ARG_OPNDS [ 0 ] , C_RET_OPND . with_num_bits( 32 ) ) , ( C_ARG_OPNDS [ 1 ] , Opnd :: mem( 64 , SP , -8 ) ) ] ) ;
1747+ asm. parallel_mov ( vec ! [ ( C_ARG_OPNDS [ 0 ] , C_RET_OPND . with_num_bits( 32 ) ) , ( C_ARG_OPNDS [ 1 ] , Opnd :: mem( VALUE_BITS , SP , -8 ) ) ] ) ;
17481748
17491749 let val32 = asm. sub ( Opnd :: Value ( Qtrue ) , Opnd :: Imm ( 1 ) ) ;
1750- asm. store ( Opnd :: mem ( 64 , EC , 0x10 ) . with_num_bits ( 32 ) , val32. with_num_bits ( 32 ) ) ;
1750+ asm. store ( Opnd :: mem ( VALUE_BITS , EC , 0x10 ) . with_num_bits ( 32 ) , val32. with_num_bits ( 32 ) ) ;
17511751 asm. je ( label) ;
17521752 asm. cret ( val64) ;
17531753
@@ -1861,7 +1861,7 @@ mod tests {
18611861 fn no_dead_mov_from_vreg ( ) {
18621862 let ( mut asm, mut cb) = setup_asm ( ) ;
18631863
1864- let ret_val = asm. load ( Opnd :: mem ( 64 , C_RET_OPND , 0 ) ) ;
1864+ let ret_val = asm. load ( Opnd :: mem ( VALUE_BITS , C_RET_OPND , 0 ) ) ;
18651865 asm. cret ( ret_val) ;
18661866
18671867 asm. compile_with_num_regs ( & mut cb, 1 ) ;
@@ -1877,7 +1877,7 @@ mod tests {
18771877 let ( mut asm, mut cb) = setup_asm ( ) ;
18781878
18791879 let opnd = asm. add ( Opnd :: Reg ( X0_REG ) , Opnd :: Reg ( X1_REG ) ) ;
1880- asm. store ( Opnd :: mem ( 64 , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
1880+ asm. store ( Opnd :: mem ( VALUE_BITS , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
18811881 asm. compile_with_regs ( & mut cb, vec ! [ X3_REG ] ) . unwrap ( ) ;
18821882
18831883 // Assert that only 2 instructions were written.
@@ -2046,7 +2046,7 @@ mod tests {
20462046 // - 16 bit MOV family shifted immediates
20472047 // - bit mask immediates
20482048 for displacement in [ i32:: MAX , 0x10008 , 0x1800 , 0x208 , -0x208 , -0x1800 , -0x10008 , i32:: MIN ] {
2049- let mem = Opnd :: mem ( 64 , NATIVE_STACK_PTR , displacement) ;
2049+ let mem = Opnd :: mem ( VALUE_BITS , NATIVE_STACK_PTR , displacement) ;
20502050 asm. lea_into ( Opnd :: Reg ( X0_REG ) , mem) ;
20512051 }
20522052
@@ -2078,7 +2078,7 @@ mod tests {
20782078 fn test_load_larg_disp_mem ( ) {
20792079 let ( mut asm, mut cb) = setup_asm ( ) ;
20802080
2081- let extended_ivars = asm. load ( Opnd :: mem ( 64 , NATIVE_STACK_PTR , 0 ) ) ;
2081+ let extended_ivars = asm. load ( Opnd :: mem ( VALUE_BITS , NATIVE_STACK_PTR , 0 ) ) ;
20822082 let result = asm. load ( Opnd :: mem ( VALUE_BITS , extended_ivars, 1000 * SIZEOF_VALUE_I32 ) ) ;
20832083 asm. store ( Opnd :: mem ( VALUE_BITS , NATIVE_STACK_PTR , 0 ) , result) ;
20842084
@@ -2098,8 +2098,8 @@ mod tests {
20982098 let ( mut asm, mut cb) = setup_asm ( ) ;
20992099
21002100 // Large memory offsets in combinations of destination and source
2101- let large_mem = Opnd :: mem ( 64 , NATIVE_STACK_PTR , -0x305 ) ;
2102- let small_mem = Opnd :: mem ( 64 , C_RET_OPND , 0 ) ;
2101+ let large_mem = Opnd :: mem ( VALUE_BITS , NATIVE_STACK_PTR , -0x305 ) ;
2102+ let small_mem = Opnd :: mem ( VALUE_BITS , C_RET_OPND , 0 ) ;
21032103 asm. store ( small_mem, large_mem) ;
21042104 asm. store ( large_mem, small_mem) ;
21052105 asm. store ( large_mem, large_mem) ;
@@ -2148,7 +2148,7 @@ mod tests {
21482148 let ( mut asm, scratch_reg) = Assembler :: new_with_scratch_reg ( ) ;
21492149 asm. new_block_without_id ( ) ;
21502150 let mut cb = CodeBlock :: new_dummy ( ) ;
2151- asm. store ( Opnd :: mem ( 64 , scratch_reg, 0 ) , 0x83902 . into ( ) ) ;
2151+ asm. store ( Opnd :: mem ( VALUE_BITS , scratch_reg, 0 ) , 0x83902 . into ( ) ) ;
21522152
21532153 asm. compile_with_num_regs ( & mut cb, 0 ) ;
21542154 assert_disasm_snapshot ! ( cb. disasm( ) , @r"
@@ -2165,7 +2165,7 @@ mod tests {
21652165 let ( _, scratch_reg) = Assembler :: new_with_scratch_reg ( ) ;
21662166 let ( mut asm, mut cb) = setup_asm ( ) ;
21672167 // This would put the source into scratch_reg, messing up the destination
2168- asm. store ( Opnd :: mem ( 64 , scratch_reg, 0 ) , 0x83902 . into ( ) ) ;
2168+ asm. store ( Opnd :: mem ( VALUE_BITS , scratch_reg, 0 ) , 0x83902 . into ( ) ) ;
21692169
21702170 asm. compile_with_num_regs ( & mut cb, 0 ) ;
21712171 }
@@ -2190,7 +2190,7 @@ mod tests {
21902190
21912191 asm. write_label ( label) ;
21922192 asm. bake_string ( "Hello, world!" ) ;
2193- asm. store ( Opnd :: mem ( 64 , SP , 0 ) , opnd) ;
2193+ asm. store ( Opnd :: mem ( VALUE_BITS , SP , 0 ) , opnd) ;
21942194
21952195 asm. compile_with_num_regs ( & mut cb, 1 ) ;
21962196 assert_disasm_snapshot ! ( cb. disasm( ) , @r"
@@ -2209,8 +2209,8 @@ mod tests {
22092209 fn test_emit_load_mem_disp_fits_into_load ( ) {
22102210 let ( mut asm, mut cb) = setup_asm ( ) ;
22112211
2212- let opnd = asm. load ( Opnd :: mem ( 64 , SP , 0 ) ) ;
2213- asm. store ( Opnd :: mem ( 64 , SP , 0 ) , opnd) ;
2212+ let opnd = asm. load ( Opnd :: mem ( VALUE_BITS , SP , 0 ) ) ;
2213+ asm. store ( Opnd :: mem ( VALUE_BITS , SP , 0 ) , opnd) ;
22142214 asm. compile_with_num_regs ( & mut cb, 1 ) ;
22152215
22162216 // Assert that two instructions were written: LDUR and STUR.
@@ -2225,8 +2225,8 @@ mod tests {
22252225 fn test_emit_load_mem_disp_fits_into_add ( ) {
22262226 let ( mut asm, mut cb) = setup_asm ( ) ;
22272227
2228- let opnd = asm. load ( Opnd :: mem ( 64 , SP , 1 << 10 ) ) ;
2229- asm. store ( Opnd :: mem ( 64 , SP , 0 ) , opnd) ;
2228+ let opnd = asm. load ( Opnd :: mem ( VALUE_BITS , SP , 1 << 10 ) ) ;
2229+ asm. store ( Opnd :: mem ( VALUE_BITS , SP , 0 ) , opnd) ;
22302230 asm. compile_with_num_regs ( & mut cb, 1 ) ;
22312231
22322232 // Assert that three instructions were written: ADD, LDUR, and STUR.
@@ -2242,8 +2242,8 @@ mod tests {
22422242 fn test_emit_load_mem_disp_does_not_fit_into_add ( ) {
22432243 let ( mut asm, mut cb) = setup_asm ( ) ;
22442244
2245- let opnd = asm. load ( Opnd :: mem ( 64 , SP , 1 << 12 | 1 ) ) ;
2246- asm. store ( Opnd :: mem ( 64 , SP , 0 ) , opnd) ;
2245+ let opnd = asm. load ( Opnd :: mem ( VALUE_BITS , SP , 1 << 12 | 1 ) ) ;
2246+ asm. store ( Opnd :: mem ( VALUE_BITS , SP , 0 ) , opnd) ;
22472247 asm. compile_with_num_regs ( & mut cb, 1 ) ;
22482248
22492249 // Assert that three instructions were written: MOVZ, ADD, LDUR, and STUR.
@@ -2261,7 +2261,7 @@ mod tests {
22612261 let ( mut asm, mut cb) = setup_asm ( ) ;
22622262
22632263 let opnd = asm. load ( Opnd :: Value ( Qnil ) ) ;
2264- asm. store ( Opnd :: mem ( 64 , SP , 0 ) , opnd) ;
2264+ asm. store ( Opnd :: mem ( VALUE_BITS , SP , 0 ) , opnd) ;
22652265 asm. compile_with_num_regs ( & mut cb, 1 ) ;
22662266
22672267 // Assert that only two instructions were written since the value is an
@@ -2278,7 +2278,7 @@ mod tests {
22782278 let ( mut asm, mut cb) = setup_asm ( ) ;
22792279
22802280 let opnd = asm. load ( Opnd :: Value ( VALUE ( 0xCAFECAFECAFE0000 ) ) ) ;
2281- asm. store ( Opnd :: mem ( 64 , SP , 0 ) , opnd) ;
2281+ asm. store ( Opnd :: mem ( VALUE_BITS , SP , 0 ) , opnd) ;
22822282 asm. compile_with_num_regs ( & mut cb, 1 ) ;
22832283
22842284 // Assert that five instructions were written since the value is not an
@@ -2325,7 +2325,7 @@ mod tests {
23252325 let ( mut asm, mut cb) = setup_asm ( ) ;
23262326
23272327 let opnd = asm. or ( Opnd :: Reg ( X0_REG ) , Opnd :: Reg ( X1_REG ) ) ;
2328- asm. store ( Opnd :: mem ( 64 , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
2328+ asm. store ( Opnd :: mem ( VALUE_BITS , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
23292329 asm. compile_with_num_regs ( & mut cb, 1 ) ;
23302330
23312331 assert_disasm_snapshot ! ( cb. disasm( ) , @r"
@@ -2340,7 +2340,7 @@ mod tests {
23402340 let ( mut asm, mut cb) = setup_asm ( ) ;
23412341
23422342 let opnd = asm. lshift ( Opnd :: Reg ( X0_REG ) , Opnd :: UImm ( 5 ) ) ;
2343- asm. store ( Opnd :: mem ( 64 , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
2343+ asm. store ( Opnd :: mem ( VALUE_BITS , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
23442344 asm. compile_with_num_regs ( & mut cb, 1 ) ;
23452345
23462346 assert_disasm_snapshot ! ( cb. disasm( ) , @r"
@@ -2355,7 +2355,7 @@ mod tests {
23552355 let ( mut asm, mut cb) = setup_asm ( ) ;
23562356
23572357 let opnd = asm. rshift ( Opnd :: Reg ( X0_REG ) , Opnd :: UImm ( 5 ) ) ;
2358- asm. store ( Opnd :: mem ( 64 , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
2358+ asm. store ( Opnd :: mem ( VALUE_BITS , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
23592359 asm. compile_with_num_regs ( & mut cb, 1 ) ;
23602360
23612361 assert_disasm_snapshot ! ( cb. disasm( ) , @r"
@@ -2370,7 +2370,7 @@ mod tests {
23702370 let ( mut asm, mut cb) = setup_asm ( ) ;
23712371
23722372 let opnd = asm. urshift ( Opnd :: Reg ( X0_REG ) , Opnd :: UImm ( 5 ) ) ;
2373- asm. store ( Opnd :: mem ( 64 , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
2373+ asm. store ( Opnd :: mem ( VALUE_BITS , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
23742374 asm. compile_with_num_regs ( & mut cb, 1 ) ;
23752375
23762376 assert_disasm_snapshot ! ( cb. disasm( ) , @r"
@@ -2509,7 +2509,7 @@ mod tests {
25092509 let ( mut asm, mut cb) = setup_asm ( ) ;
25102510
25112511 let opnd = asm. xor ( Opnd :: Reg ( X0_REG ) , Opnd :: Reg ( X1_REG ) ) ;
2512- asm. store ( Opnd :: mem ( 64 , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
2512+ asm. store ( Opnd :: mem ( VALUE_BITS , Opnd :: Reg ( X2_REG ) , 0 ) , opnd) ;
25132513
25142514 asm. compile_with_num_regs ( & mut cb, 1 ) ;
25152515
@@ -2548,7 +2548,7 @@ mod tests {
25482548 fn test_replace_mov_with_ldur ( ) {
25492549 let ( mut asm, mut cb) = setup_asm ( ) ;
25502550
2551- asm. mov ( Opnd :: Reg ( TEMP_REGS [ 0 ] ) , Opnd :: mem ( 64 , CFP , 8 ) ) ;
2551+ asm. mov ( Opnd :: Reg ( TEMP_REGS [ 0 ] ) , Opnd :: mem ( VALUE_BITS , CFP , 8 ) ) ;
25522552 asm. compile_with_num_regs ( & mut cb, 1 ) ;
25532553
25542554 assert_disasm_snapshot ! ( cb. disasm( ) , @" 0x0: ldur x1, [x19, #8]" ) ;
@@ -2888,7 +2888,7 @@ mod tests {
28882888 fn test_split_load64_mem_mem_with_large_displacement ( ) {
28892889 let ( mut asm, mut cb) = setup_asm ( ) ;
28902890
2891- let _ = asm. load ( Opnd :: mem ( 64 , C_RET_OPND , 0x200 ) ) ;
2891+ let _ = asm. load ( Opnd :: mem ( VALUE_BITS , C_RET_OPND , 0x200 ) ) ;
28922892 asm. compile ( & mut cb) . unwrap ( ) ;
28932893
28942894 assert_disasm_snapshot ! ( cb. disasm( ) , @r"
0 commit comments