mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-27 04:30:37 +02:00
brw: Avoid regioning restrictions for u2u16/i2i16 narrowing conversions
Cuts 0.83% of instructions on Alchemist in affected fossil-db shaders (nearly all of which are in parallel-rdp). Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31833>
This commit is contained in:
parent
86f8b8860e
commit
51c67ad7cf
1 changed files with 10 additions and 0 deletions
|
|
@ -1124,6 +1124,16 @@ brw_from_nir_emit_alu(nir_to_brw_state &ntb, nir_alu_instr *instr,
|
|||
}
|
||||
}
|
||||
|
||||
/* If narrowing (e.g. 32 -> 16), don't do a D -> W or UD -> UW mov,
|
||||
* instead just read the source as W/UW with a stride (discarding
|
||||
* the top bits). This avoids the need for the destination to be
|
||||
* DWord aligned due to regioning restrictions.
|
||||
*/
|
||||
if (brw_type_size_bits(result.type) < brw_type_size_bits(op[0].type)) {
|
||||
const unsigned bits = brw_type_size_bits(result.type);
|
||||
op[0] = subscript(op[0], brw_type_with_size(op[0].type, bits), 0);
|
||||
}
|
||||
|
||||
bld.MOV(result, op[0]);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue