(
fgen: &mut FunctionGenerator,
builder: &mut FunctionBuilder,
opcode: Opcode,
_: &[Type],
rets: &[Type],
)
| 391 | } |
| 392 | |
| 393 | fn insert_shuffle( |
| 394 | fgen: &mut FunctionGenerator, |
| 395 | builder: &mut FunctionBuilder, |
| 396 | opcode: Opcode, |
| 397 | _: &[Type], |
| 398 | rets: &[Type], |
| 399 | ) -> Result<()> { |
| 400 | let ctrl_type = *rets.first().unwrap(); |
| 401 | |
| 402 | let lhs = builder.use_var(fgen.get_variable_of_type(ctrl_type)?); |
| 403 | let rhs = builder.use_var(fgen.get_variable_of_type(ctrl_type)?); |
| 404 | |
| 405 | let mask = { |
| 406 | let mut lanes = [0u8; 16]; |
| 407 | for lane in lanes.iter_mut() { |
| 408 | *lane = fgen.u.int_in_range(0..=31)?; |
| 409 | } |
| 410 | let lanes = ConstantData::from(lanes.as_ref()); |
| 411 | builder.func.dfg.immediates.push(lanes) |
| 412 | }; |
| 413 | |
| 414 | // This function is called for any `InstructionFormat::Shuffle`. Which today is just |
| 415 | // `shuffle`, but lets assert that, just to be sure we don't accidentally insert |
| 416 | // something else. |
| 417 | assert_eq!(opcode, Opcode::Shuffle); |
| 418 | let res = builder.ins().shuffle(lhs, rhs, mask); |
| 419 | |
| 420 | let target_var = fgen.get_variable_of_type(ctrl_type)?; |
| 421 | builder.def_var(target_var, res); |
| 422 | |
| 423 | Ok(()) |
| 424 | } |
| 425 | |
| 426 | fn insert_ins_ext_lane( |
| 427 | fgen: &mut FunctionGenerator, |
nothing calls this directly
no test coverage detected