Const constructor: create a new Reg from a regalloc2 VReg.
(vreg: regalloc2::VReg)
| 54 | impl Reg { |
| 55 | /// Const constructor: create a new Reg from a regalloc2 VReg. |
| 56 | pub const fn from_virtual_reg(vreg: regalloc2::VReg) -> Reg { |
| 57 | let bits = vreg.bits() as u32; |
| 58 | debug_assert!(bits <= REG_SPILLSLOT_MASK); |
| 59 | Reg(bits) |
| 60 | } |
| 61 | |
| 62 | /// Const constructor: create a new Reg from a regalloc2 PReg. |
| 63 | pub const fn from_real_reg(preg: regalloc2::PReg) -> Reg { |