mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
nak/legalize: Handle RA instructions up-front
This pulls them out of the per-SM flow. They're also all no-ops to legalize since they don't take vectors and are handled directly by RA. This also means these instructions are now getting properly handled on Maxwell where we previously trusted in the (probably broken) maxwell legalizing code. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
This commit is contained in:
parent
9d8d928a59
commit
f20b1c50b4
1 changed files with 30 additions and 8 deletions
|
|
@ -539,7 +539,6 @@ fn legalize_sm50_instr(b: &mut LegalizeBuilder, instr: &mut Instr) {
|
|||
// TODO: cb must be a bound constant buffer
|
||||
b.copy_alu_src_if_not_reg(&mut op.offset, GPR, SrcType::GPR);
|
||||
}
|
||||
Op::Copy(_) => (), // Nothing to do
|
||||
Op::SuLd(op) => {
|
||||
b.copy_alu_src_if_not_reg(&mut op.handle, GPR, SrcType::GPR);
|
||||
b.copy_alu_src_if_not_reg(&mut op.coord, GPR, SrcType::GPR);
|
||||
|
|
@ -598,7 +597,7 @@ fn legalize_sm70_instr(b: &mut LegalizeBuilder, instr: &mut Instr) {
|
|||
RegFile::GPR
|
||||
};
|
||||
|
||||
if !matches!(&instr.op, Op::Ldc(_) | Op::Copy(_)) && instr.is_uniform() {
|
||||
if !matches!(&instr.op, Op::Ldc(_)) && instr.is_uniform() {
|
||||
// Uniform instructions can't support cbufs
|
||||
let src_types = instr.src_types();
|
||||
for (i, src) in instr.srcs_mut().iter_mut().enumerate() {
|
||||
|
|
@ -908,9 +907,6 @@ fn legalize_sm70_instr(b: &mut LegalizeBuilder, instr: &mut Instr) {
|
|||
Op::Vote(op) => {
|
||||
b.copy_src_if_upred(&mut op.pred);
|
||||
}
|
||||
Op::Copy(_) => (), // Nothing to do
|
||||
Op::Pin(_) | Op::Unpin(_) => (), // Nothing to do
|
||||
Op::PhiSrcs(_) | Op::PhiDsts(_) => (), // Nothing to do
|
||||
_ => {
|
||||
let src_types = instr.src_types();
|
||||
for (i, src) in instr.srcs_mut().iter_mut().enumerate() {
|
||||
|
|
@ -951,9 +947,35 @@ fn legalize_instr(
|
|||
ip: usize,
|
||||
instr: &mut Instr,
|
||||
) {
|
||||
if matches!(&instr.op, Op::PhiDsts(_)) {
|
||||
debug_assert!(instr.pred.is_true());
|
||||
} else if !instr.is_uniform() {
|
||||
// Handle a few no-op cases up-front
|
||||
match &instr.op {
|
||||
Op::Undef(_)
|
||||
| Op::PhiSrcs(_)
|
||||
| Op::PhiDsts(_)
|
||||
| Op::Pin(_)
|
||||
| Op::Unpin(_)
|
||||
| Op::FSOut(_) => {
|
||||
// These are implemented by RA and can take pretty much anything
|
||||
// you can throw at them.
|
||||
debug_assert!(instr.pred.is_true());
|
||||
return;
|
||||
}
|
||||
Op::Copy(_) => {
|
||||
// OpCopy is implemented in a lowering pass and can handle anything
|
||||
return;
|
||||
}
|
||||
Op::SrcBar(_) => {
|
||||
// This is turned into a nop by calc_instr_deps
|
||||
return;
|
||||
}
|
||||
Op::Swap(_) | Op::ParCopy(_) => {
|
||||
// These are generated by RA and should not exist yet
|
||||
panic!("Unsupported instruction");
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
if !instr.is_uniform() {
|
||||
b.copy_pred_if_upred(&mut instr.pred);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue