mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-20 19:40:24 +01:00
nak/sm50: Properly legalize OpSel and drop an assert
While we're here, update sm70 to be a bit more modern. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
This commit is contained in:
parent
7f5c6642d8
commit
1a7e83c87f
2 changed files with 8 additions and 6 deletions
|
|
@ -285,8 +285,6 @@ impl SM50Instr {
|
|||
}
|
||||
|
||||
fn encode_sel(&mut self, op: &OpSel) {
|
||||
assert!(op.srcs[1].is_reg_or_zero());
|
||||
|
||||
match &op.srcs[1].src_ref {
|
||||
SrcRef::Imm32(imm32) => {
|
||||
self.set_opcode(0x38a0);
|
||||
|
|
|
|||
|
|
@ -261,7 +261,12 @@ fn legalize_sm50_instr(
|
|||
copy_alu_src_if_not_reg(b, &mut op.src, SrcType::GPR);
|
||||
}
|
||||
Op::Sel(op) => {
|
||||
copy_alu_src_if_not_reg(b, &mut op.srcs[1], SrcType::GPR);
|
||||
let [ref mut src0, ref mut src1] = op.srcs;
|
||||
if swap_srcs_if_not_reg(src0, src1) {
|
||||
op.cond = op.cond.bnot();
|
||||
}
|
||||
copy_alu_src_if_not_reg(b, src0, SrcType::ALU);
|
||||
copy_alu_src_if_i20_overflow(b, src1, SrcType::ALU);
|
||||
}
|
||||
Op::Shfl(op) => {
|
||||
copy_alu_src_if_not_reg(b, &mut op.src, SrcType::GPR);
|
||||
|
|
@ -529,9 +534,8 @@ fn legalize_sm70_instr(
|
|||
}
|
||||
Op::Sel(op) => {
|
||||
let [ref mut src0, ref mut src1] = op.srcs;
|
||||
if !src_is_reg(src0) && src_is_reg(src1) {
|
||||
std::mem::swap(src0, src1);
|
||||
op.cond.src_mod = op.cond.src_mod.bnot();
|
||||
if swap_srcs_if_not_reg(src0, src1) {
|
||||
op.cond = op.cond.bnot();
|
||||
}
|
||||
copy_alu_src_if_not_reg(b, src0, SrcType::ALU);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue