mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
nak: Implement nir_op_i(eq|ne) for booleans
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This commit is contained in:
parent
3fd47a68a1
commit
ed42571e83
1 changed files with 34 additions and 14 deletions
|
|
@ -273,13 +273,23 @@ impl<'a> ShaderFromNir<'a> {
|
|||
}
|
||||
}
|
||||
nir_op_ieq => {
|
||||
self.instrs.push(Instr::new_isetp(
|
||||
dst,
|
||||
IntCmpType::I32,
|
||||
IntCmpOp::Eq,
|
||||
srcs[0],
|
||||
srcs[1],
|
||||
));
|
||||
if alu.get_src(0).bit_size() == 1 {
|
||||
self.instrs.push(Instr::new_plop3(
|
||||
dst,
|
||||
LogicOp::new_lut(&|x, y, _| !(x ^ y)),
|
||||
srcs[0],
|
||||
srcs[1],
|
||||
Src::new_imm_bool(true),
|
||||
));
|
||||
} else {
|
||||
self.instrs.push(Instr::new_isetp(
|
||||
dst,
|
||||
IntCmpType::I32,
|
||||
IntCmpOp::Eq,
|
||||
srcs[0],
|
||||
srcs[1],
|
||||
));
|
||||
}
|
||||
}
|
||||
nir_op_ige => {
|
||||
self.instrs.push(Instr::new_isetp(
|
||||
|
|
@ -300,13 +310,23 @@ impl<'a> ShaderFromNir<'a> {
|
|||
));
|
||||
}
|
||||
nir_op_ine => {
|
||||
self.instrs.push(Instr::new_isetp(
|
||||
dst,
|
||||
IntCmpType::I32,
|
||||
IntCmpOp::Ne,
|
||||
srcs[0],
|
||||
srcs[1],
|
||||
));
|
||||
if alu.get_src(0).bit_size() == 1 {
|
||||
self.instrs.push(Instr::new_plop3(
|
||||
dst,
|
||||
LogicOp::new_lut(&|x, y, _| !(x ^ y)),
|
||||
srcs[0],
|
||||
srcs[1],
|
||||
Src::new_imm_bool(true),
|
||||
));
|
||||
} else {
|
||||
self.instrs.push(Instr::new_isetp(
|
||||
dst,
|
||||
IntCmpType::I32,
|
||||
IntCmpOp::Ne,
|
||||
srcs[0],
|
||||
srcs[1],
|
||||
));
|
||||
}
|
||||
}
|
||||
nir_op_ineg => {
|
||||
self.instrs.push(Instr::new(Op::IMov(OpIMov {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue