mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
nak: Encode LDC directly
This instruction is so restricted that encode_alu() really isn't gaining us much so we may as well just type it out. Also, the bindless version is quite a bit different and doesn't follow the ALU patterns so it'll make more sense to do it this way long-term. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29393>
This commit is contained in:
parent
4366d4d181
commit
67a3c81286
1 changed files with 14 additions and 7 deletions
|
|
@ -1817,13 +1817,20 @@ impl SM70Instr {
|
|||
}
|
||||
|
||||
fn encode_ldc(&mut self, op: &OpLdc) {
|
||||
self.encode_alu(
|
||||
0x182,
|
||||
Some(op.dst),
|
||||
ALUSrc::from_src(&op.offset),
|
||||
ALUSrc::from_src(&op.cb),
|
||||
ALUSrc::None,
|
||||
);
|
||||
let SrcRef::CBuf(cb) = &op.cb.src_ref else {
|
||||
panic!("LDC must take a cbuf source");
|
||||
};
|
||||
let CBuf::Binding(idx) = cb.buf else {
|
||||
todo!("Implement bindless LDC");
|
||||
};
|
||||
|
||||
self.set_opcode(0xb82);
|
||||
|
||||
self.set_dst(op.dst);
|
||||
|
||||
self.set_reg_src(24..32, op.offset);
|
||||
self.set_field(38..54, cb.offset);
|
||||
self.set_field(54..59, idx);
|
||||
|
||||
self.set_mem_type(73..76, op.mem_type);
|
||||
self.set_field(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue