Skip to content

Commit

Permalink
Add reg_fixed_use_at_end and reg_fixed_use_at_end
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Dec 6, 2023
1 parent b637108 commit 977600e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,28 @@ impl Operand {
)
}

/// Same as `reg_fixed_use` but at `OperandPos::Late`.
#[inline(always)]
pub fn reg_fixed_use_at_end(vreg: VReg, preg: PReg) -> Self {
Operand::new(
vreg,
OperandConstraint::FixedReg(preg),
OperandKind::Use,
OperandPos::Late,
)
}

/// Same as `reg_fixed_def` but at `OperandPos::Early`.
#[inline(always)]
pub fn reg_fixed_def_at_start(vreg: VReg, preg: PReg) -> Self {
Operand::new(
vreg,
OperandConstraint::FixedReg(preg),
OperandKind::Def,
OperandPos::Early,
)
}

/// Create an `Operand` that designates a use of a vreg and places
/// no constraints on its location (i.e., it can be allocated into
/// either a register or on the stack).
Expand Down

0 comments on commit 977600e

Please sign in to comment.