Lines Matching refs:bx

112         bx: &mut FunctionBuilder,  in build_search_tree()
122 bx, in build_search_tree()
136 bx.switch_to_block(block); in build_search_tree()
141 bx, in build_search_tree()
152 let left_block = bx.create_block(); in build_search_tree()
153 let right_block = bx.create_block(); in build_search_tree()
155 let should_take_right_side = bx.ins().icmp_imm( in build_search_tree()
160 bx.ins().brnz(should_take_right_side, right_block, &[]); in build_search_tree()
161 bx.ins().jump(left_block, &[]); in build_search_tree()
163 bx.seal_block(left_block); in build_search_tree()
164 bx.seal_block(right_block); in build_search_tree()
176 bx: &mut FunctionBuilder, in build_search_branches()
183 let ins_fallthrough_jump = |was_branch: bool, bx: &mut FunctionBuilder| { in build_search_branches()
185 let block = bx.create_block(); in build_search_branches()
186 bx.ins().jump(block, &[]); in build_search_branches()
187 bx.seal_block(block); in build_search_branches()
188 bx.switch_to_block(block); in build_search_branches()
198 ins_fallthrough_jump(was_branch, bx); in build_search_branches()
199 bx.ins().brz(val, blocks[0], &[]); in build_search_branches()
202 ins_fallthrough_jump(was_branch, bx); in build_search_branches()
203 let is_good_val = bx.ins().icmp_imm(IntCC::Equal, val, first_index as i64); in build_search_branches()
204 bx.ins().brnz(is_good_val, blocks[0], &[]); in build_search_branches()
208 let jt_block = bx.create_block(); in build_search_branches()
209 bx.ins().jump(jt_block, &[]); in build_search_branches()
210 bx.seal_block(jt_block); in build_search_branches()
218 ins_fallthrough_jump(was_branch, bx); in build_search_branches()
219 let jt_block = bx.create_block(); in build_search_branches()
220 let is_good_val = bx.ins().icmp_imm( in build_search_branches()
225 bx.ins().brnz(is_good_val, jt_block, &[]); in build_search_branches()
226 bx.seal_block(jt_block); in build_search_branches()
233 bx.ins().jump(otherwise, &[]); in build_search_branches()
238 bx: &mut FunctionBuilder, in build_jump_tables()
248 let jump_table = bx.create_jump_table(jt_data); in build_jump_tables()
250 bx.switch_to_block(jt_block); in build_jump_tables()
254 bx.ins().iadd_imm(val, (first_index as i64).wrapping_neg()) in build_jump_tables()
256 bx.ins().br_table(discr, otherwise, jump_table); in build_jump_tables()
267 pub fn emit(self, bx: &mut FunctionBuilder, val: Value, otherwise: Block) { in emit()
269 let val = match bx.func.dfg.value_type(val) { in emit()
270 types::I8 | types::I16 => bx.ins().uextend(types::I32, val), in emit()
276 Self::build_search_tree(bx, val, otherwise, contiguous_case_ranges); in emit()
277 Self::build_jump_tables(bx, val, otherwise, cases_and_jt_blocks); in emit()
321 let mut bx = FunctionBuilder::new(&mut func, &mut func_ctx); localVariable
322 let block = bx.create_block();
323 bx.switch_to_block(block);
324 let val = bx.ins().iconst(types::I8, 0);
327 let block = bx.create_block();
330 switch.emit(&mut bx, val, Block::with_number($default).unwrap());