@@ -152,14 +152,14 @@ pub struct Mem
152152
153153impl fmt:: Display for Mem {
154154 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
155- if self . num_bits != 64 {
155+ if self . num_bits != VALUE_BITS {
156156 write ! ( f, "Mem{}" , self . num_bits) ?;
157157 }
158158 write ! ( f, "[" ) ?;
159159 match self . base {
160160 MemBase :: Reg ( reg_no) => write ! ( f, "{}" , mem_base_reg( reg_no) ) ?,
161161 MemBase :: VReg ( idx) => write ! ( f, "v{idx}" ) ?,
162- MemBase :: Stack { stack_idx, num_bits } if num_bits == 64 => write ! ( f, "Stack[{stack_idx}]" ) ?,
162+ MemBase :: Stack { stack_idx, num_bits } if num_bits == VALUE_BITS => write ! ( f, "Stack[{stack_idx}]" ) ?,
163163 MemBase :: Stack { stack_idx, num_bits } => write ! ( f, "Stack{num_bits}[{stack_idx}]" ) ?,
164164 }
165165 if self . disp != 0 {
@@ -212,7 +212,7 @@ impl fmt::Display for Opnd {
212212 None => write ! ( f, "None" ) ,
213213 Value ( VALUE ( value) ) if * value < 10 => write ! ( f, "Value({value:x})" ) ,
214214 Value ( VALUE ( value) ) => write ! ( f, "Value(0x{value:x})" ) ,
215- VReg { idx, num_bits } if * num_bits == 64 => write ! ( f, "v{idx}" ) ,
215+ VReg { idx, num_bits } if * num_bits == VALUE_BITS => write ! ( f, "v{idx}" ) ,
216216 VReg { idx, num_bits } => write ! ( f, "VReg{num_bits}(v{idx})" ) ,
217217 Imm ( value) if value. abs ( ) < 10 => write ! ( f, "Imm({value:x})" ) ,
218218 Imm ( value) => write ! ( f, "Imm(0x{value:x})" ) ,
@@ -230,7 +230,7 @@ impl fmt::Debug for Opnd {
230230 match self {
231231 Self :: None => write ! ( fmt, "None" ) ,
232232 Value ( val) => write ! ( fmt, "Value({val:?})" ) ,
233- VReg { idx, num_bits } if * num_bits == 64 => write ! ( fmt, "VReg({idx})" ) ,
233+ VReg { idx, num_bits } if * num_bits == VALUE_BITS => write ! ( fmt, "VReg({idx})" ) ,
234234 VReg { idx, num_bits } => write ! ( fmt, "VReg{num_bits}({idx})" ) ,
235235 Imm ( signed) => write ! ( fmt, "{signed:x}_i64" ) ,
236236 UImm ( unsigned) => write ! ( fmt, "{unsigned:x}_u64" ) ,
@@ -247,7 +247,7 @@ impl Opnd
247247 pub fn mem ( num_bits : u8 , base : Opnd , disp : i32 ) -> Self {
248248 match base {
249249 Opnd :: Reg ( base_reg) => {
250- assert ! ( base_reg. num_bits == 64 ) ;
250+ assert ! ( base_reg. num_bits == VALUE_BITS ) ;
251251 Opnd :: Mem ( Mem {
252252 base : MemBase :: Reg ( base_reg. reg_no ) ,
253253 disp,
@@ -302,7 +302,7 @@ impl Opnd
302302 /// Return Opnd with a given num_bits if self has num_bits. Panic otherwise.
303303 #[ track_caller]
304304 pub fn with_num_bits ( & self , num_bits : u8 ) -> Opnd {
305- assert ! ( num_bits == 8 || num_bits == 16 || num_bits == 32 || num_bits == 64 ) ;
305+ assert ! ( num_bits == 8 || num_bits == 16 || num_bits == 32 || num_bits == VALUE_BITS ) ;
306306 match * self {
307307 Opnd :: Reg ( reg) => Opnd :: Reg ( reg. with_num_bits ( num_bits) ) ,
308308 Opnd :: Mem ( Mem { base, disp, .. } ) => Opnd :: Mem ( Mem { base, disp, num_bits } ) ,
@@ -332,7 +332,7 @@ impl Opnd
332332
333333 /// When there aren't any operands to check against, this is the number of
334334 /// bits that should be used for any given output variable.
335- const DEFAULT_NUM_BITS : u8 = 64 ;
335+ const DEFAULT_NUM_BITS : u8 = VALUE_BITS ;
336336
337337 /// Determine the size in bits from the iterator of operands. If any of them
338338 /// are different sizes this will panic.
0 commit comments