MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / decode

Method decode

src/internal/allocator/queue.rs:97–114  ·  view source on GitHub ↗

Decodes an entry.

(self)

Source from the content-addressed store, hash-verified

95
96 /// Decodes an entry.
97 fn decode(self) -> (VirtRegOrGroup, Stage) {
98 // Group size has 1 subtracted from it in the encoding to fit in 3 bits.
99 let group_size = ((self.bits >> 59) & 0b111) + 1;
100 let stage = if self.bits >> 63 != 0 {
101 Stage::Evict
102 } else {
103 Stage::Split
104 };
105 let index = self.bits as u32 as usize;
106 let vreg_or_group = if group_size == 1 {
107 let vreg = VirtReg::new(index);
108 VirtRegOrGroup::Reg(vreg)
109 } else {
110 let group = VirtRegGroup::new(index);
111 VirtRegOrGroup::Group(group)
112 };
113 (vreg_or_group, stage)
114 }
115}
116
117/// Priority queue of virtual registers and virtual register groups that need

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected