mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 01:50:10 +01:00
nak: Implement nir_op_b2b1 and nir_op_b2b32
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This commit is contained in:
parent
3bf0882ea8
commit
fa0891d37c
1 changed files with 17 additions and 7 deletions
|
|
@ -177,6 +177,23 @@ impl<'a> ShaderFromNir<'a> {
|
|||
let dst = self.get_dst(&alu.def);
|
||||
|
||||
match alu.op {
|
||||
nir_op_b2b1 => {
|
||||
assert!(alu.get_src(0).bit_size() > 1);
|
||||
self.instrs.push(Instr::new_isetp(
|
||||
dst,
|
||||
IntCmpType::I32,
|
||||
IntCmpOp::Ne,
|
||||
srcs[0],
|
||||
Src::new_zero(),
|
||||
));
|
||||
}
|
||||
nir_op_b2b32 | nir_op_b2i32 => {
|
||||
self.instrs.push(Instr::new(Op::Sel(OpSel {
|
||||
dst: dst,
|
||||
cond: srcs[0].bnot(),
|
||||
srcs: [Src::new_zero(), Src::new_imm_u32(1)],
|
||||
})));
|
||||
}
|
||||
nir_op_b2f32 => {
|
||||
self.instrs.push(Instr::new(Op::Sel(OpSel {
|
||||
dst: dst,
|
||||
|
|
@ -184,13 +201,6 @@ impl<'a> ShaderFromNir<'a> {
|
|||
srcs: [Src::new_zero(), Src::new_imm_u32(0x3f800000)],
|
||||
})));
|
||||
}
|
||||
nir_op_b2i32 => {
|
||||
self.instrs.push(Instr::new(Op::Sel(OpSel {
|
||||
dst: dst,
|
||||
cond: srcs[0].bnot(),
|
||||
srcs: [Src::new_zero(), Src::new_imm_u32(1)],
|
||||
})));
|
||||
}
|
||||
nir_op_bcsel => {
|
||||
self.instrs
|
||||
.push(Instr::new_sel(dst, srcs[0], srcs[1], srcs[2]));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue