Skip to main content

halves

Function halves 

Source
pub fn halves(func: &mut Func, names: &mut Interner, conv: &CallRegs) -> bool
Expand description

Splits every integer the machine holds in two registers into the two halves it holds it in.

Gives back whether it changed anything, which is what a test asks and what tells a reader of a dump that the function the selector saw is not the one the middle end produced.

The function is left exactly as it was when there is nothing at that width, when something at that width is reached by an instruction this does not understand, and when a half would cross the function’s boundary somewhere the convention has no register for it. All three leave the refusal to the passes below, which name the construct they could not lower, rather than rewriting into something that guessed.