nir: Drop imov/fmov in favor of one mov instruction
The difference between imov and fmov has been a constant source of confusion in NIR for years. No one really knows why we have two or when to use one vs. the other. The real reason is that they do different things in the presence of source and destination modifiers. However, without modifiers (which many back-ends don't have), they are identical. Now that we've reworked nir_lower_to_source_mods to leave one abs/neg instruction in place rather than replacing them with imov or fmov instructions, we don't need two different instructions at all anymore. Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com> Acked-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
@@ -711,8 +711,7 @@ fs_visitor::prepare_alu_destination_and_sources(const fs_builder &bld,
|
||||
* instructions.
|
||||
*/
|
||||
switch (instr->op) {
|
||||
case nir_op_imov:
|
||||
case nir_op_fmov:
|
||||
case nir_op_mov:
|
||||
case nir_op_vec2:
|
||||
case nir_op_vec3:
|
||||
case nir_op_vec4:
|
||||
@@ -991,8 +990,7 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr)
|
||||
fs_reg result = prepare_alu_destination_and_sources(bld, instr, op, true);
|
||||
|
||||
switch (instr->op) {
|
||||
case nir_op_imov:
|
||||
case nir_op_fmov:
|
||||
case nir_op_mov:
|
||||
case nir_op_vec2:
|
||||
case nir_op_vec3:
|
||||
case nir_op_vec4: {
|
||||
@@ -1011,7 +1009,7 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr)
|
||||
if (!(instr->dest.write_mask & (1 << i)))
|
||||
continue;
|
||||
|
||||
if (instr->op == nir_op_imov || instr->op == nir_op_fmov) {
|
||||
if (instr->op == nir_op_mov) {
|
||||
inst = bld.MOV(offset(temp, bld, i),
|
||||
offset(op[0], bld, instr->src[0].swizzle[i]));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user