(
func: &mut ir::Function,
inst: ir::Inst,
opcode: ir::Opcode,
args: [ir::Value; 2],
)
| 131 | } |
| 132 | |
| 133 | fn expand_binary( |
| 134 | func: &mut ir::Function, |
| 135 | inst: ir::Inst, |
| 136 | opcode: ir::Opcode, |
| 137 | args: [ir::Value; 2], |
| 138 | ) -> WalkCommand { |
| 139 | let mut pos = FuncCursor::new(func); |
| 140 | pos.goto_inst(inst); |
| 141 | |
| 142 | // Legalize the fused bitwise-plus-not instructions into simpler |
| 143 | // instructions to assist with optimizations. Lowering will pattern match |
| 144 | // this sequence regardless when architectures support the instruction |
| 145 | // natively. |
| 146 | match opcode { |
| 147 | ir::Opcode::BandNot => { |
| 148 | let neg = pos.ins().bnot(args[1]); |
| 149 | pos.func.replace(inst).band(args[0], neg); |
| 150 | } |
| 151 | ir::Opcode::BorNot => { |
| 152 | let neg = pos.ins().bnot(args[1]); |
| 153 | pos.func.replace(inst).bor(args[0], neg); |
| 154 | } |
| 155 | ir::Opcode::BxorNot => { |
| 156 | let neg = pos.ins().bnot(args[1]); |
| 157 | pos.func.replace(inst).bxor(args[0], neg); |
| 158 | } |
| 159 | _ => {} |
| 160 | } |
| 161 | |
| 162 | WalkCommand::Continue |
| 163 | } |
| 164 | |
| 165 | fn expand_dynamic_stack_store( |
| 166 | isa: &dyn TargetIsa, |
no test coverage detected