Marks the specified register as available, utilizing the register class to determine the bitset that requires updating.
(&mut self, reg: Reg)
| 105 | /// Marks the specified register as available, utilizing the |
| 106 | /// register class to determine the bitset that requires updating. |
| 107 | pub fn free(&mut self, reg: Reg) { |
| 108 | let bitset = &self[reg.class()]; |
| 109 | let index = reg.hw_enc(); |
| 110 | assert!(index < bitset.max); |
| 111 | let index = u64::try_from(index).unwrap(); |
| 112 | if !self.is_non_allocatable(reg.class(), index) { |
| 113 | self[reg.class()].allocatable |= 1 << index; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /// Returns true if the specified register is allocatable. |
| 118 | pub fn named_reg_available(&self, reg: Reg) -> bool { |