@@ -426,14 +426,13 @@ impl std::fmt::Display for OperandConstraint {
426
426
}
427
427
}
428
428
429
- /// The "kind" of the operand: whether it reads a vreg (Use), writes a
430
- /// vreg (Def), or reads and then writes (Mod, for "modify" ).
429
+ /// The "kind" of the operand: whether it reads a vreg (Use) or writes
430
+ /// a vreg (Def).
431
431
#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
432
432
#[ cfg_attr( feature = "enable-serde" , derive( Serialize , Deserialize ) ) ]
433
433
pub enum OperandKind {
434
434
Def = 0 ,
435
- Mod = 1 ,
436
- Use = 2 ,
435
+ Use = 1 ,
437
436
}
438
437
439
438
/// The "position" of the operand: where it has its read/write
@@ -488,7 +487,7 @@ pub enum OperandPos {
488
487
pub struct Operand {
489
488
/// Bit-pack into 32 bits.
490
489
///
491
- /// constraint:7 kind:2 pos:1 class:1 vreg:21
490
+ /// constraint:7 kind:1 pos:1 class:2 vreg:21
492
491
///
493
492
/// where `constraint` is an `OperandConstraint`, `kind` is an
494
493
/// `OperandKind`, `pos` is an `OperandPos`, `class` is a
@@ -532,8 +531,8 @@ impl Operand {
532
531
Operand {
533
532
bits : vreg. vreg ( ) as u32
534
533
| ( class_field << 21 )
535
- | ( pos_field << 22 )
536
- | ( kind_field << 23 )
534
+ | ( pos_field << 23 )
535
+ | ( kind_field << 24 )
537
536
| ( constraint_field << 25 ) ,
538
537
}
539
538
}
@@ -719,23 +718,22 @@ impl Operand {
719
718
/// Get the register class used by this operand.
720
719
#[ inline( always) ]
721
720
pub fn class ( self ) -> RegClass {
722
- let class_field = ( self . bits >> 21 ) & 1 ;
721
+ let class_field = ( self . bits >> 21 ) & 3 ;
723
722
match class_field {
724
723
0 => RegClass :: Int ,
725
724
1 => RegClass :: Float ,
726
725
_ => unreachable ! ( ) ,
727
726
}
728
727
}
729
728
730
- /// Get the "kind" of this operand: a definition (write), a use
731
- /// (read), or a "mod" / modify (a read followed by a write) .
729
+ /// Get the "kind" of this operand: a definition (write) or a use
730
+ /// (read).
732
731
#[ inline( always) ]
733
732
pub fn kind ( self ) -> OperandKind {
734
- let kind_field = ( self . bits >> 23 ) & 3 ;
733
+ let kind_field = ( self . bits >> 24 ) & 1 ;
735
734
match kind_field {
736
735
0 => OperandKind :: Def ,
737
- 1 => OperandKind :: Mod ,
738
- 2 => OperandKind :: Use ,
736
+ 1 => OperandKind :: Use ,
739
737
_ => unreachable ! ( ) ,
740
738
}
741
739
}
@@ -746,7 +744,7 @@ impl Operand {
746
744
/// at "after", though there are cases where this is not true.
747
745
#[ inline( always) ]
748
746
pub fn pos ( self ) -> OperandPos {
749
- let pos_field = ( self . bits >> 22 ) & 1 ;
747
+ let pos_field = ( self . bits >> 23 ) & 1 ;
750
748
match pos_field {
751
749
0 => OperandPos :: Early ,
752
750
1 => OperandPos :: Late ,
@@ -808,8 +806,7 @@ impl std::fmt::Debug for Operand {
808
806
impl std:: fmt:: Display for Operand {
809
807
fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
810
808
match ( self . kind ( ) , self . pos ( ) ) {
811
- ( OperandKind :: Def , OperandPos :: Late )
812
- | ( OperandKind :: Mod | OperandKind :: Use , OperandPos :: Early ) => {
809
+ ( OperandKind :: Def , OperandPos :: Late ) | ( OperandKind :: Use , OperandPos :: Early ) => {
813
810
write ! ( f, "{:?}" , self . kind( ) ) ?;
814
811
}
815
812
_ => {
@@ -1058,8 +1055,8 @@ pub trait Function {
1058
1055
/// it in a given PReg chosen by the client prior to regalloc.
1059
1056
///
1060
1057
/// Every register written by an instruction must either
1061
- /// correspond to (be assigned to) an Operand of kind `Def` or
1062
- /// `Mod`, or else must be a "clobber".
1058
+ /// correspond to (be assigned to) an Operand of kind `Def`, or
1059
+ /// else must be a "clobber".
1063
1060
///
1064
1061
/// This can be used to, for example, describe ABI-specified
1065
1062
/// registers that are not preserved by a call instruction, or
0 commit comments