Returns true if the specified register is allocatable.
(&self, reg: Reg)
| 116 | |
| 117 | /// Returns true if the specified register is allocatable. |
| 118 | pub fn named_reg_available(&self, reg: Reg) -> bool { |
| 119 | let bitset = &self[reg.class()]; |
| 120 | assert!(reg.hw_enc() < bitset.max); |
| 121 | let index = 1 << reg.hw_enc(); |
| 122 | |
| 123 | (!bitset.allocatable & index) == 0 |
| 124 | || self.is_non_allocatable(reg.class(), reg.hw_enc().try_into().unwrap()) |
| 125 | } |
| 126 | |
| 127 | fn available(&self, class: RegClass) -> bool { |
| 128 | let bitset = &self[class]; |
no test coverage detected