i965/fs: set rounding mode when emitting the flrp instruction
authorAndres Gomez <agomez@igalia.com>
Mon, 23 Sep 2019 22:37:57 +0000 (01:37 +0300)
committerAndres Gomez <agomez@igalia.com>
Tue, 24 Sep 2019 09:06:59 +0000 (12:06 +0300)
flrp was forgotten when already adding the rounding mode for other
instructions.

Fixes: ba1e25e1aa6 ("i965/fs: set rounding mode when emitting fadd, fmul and ffma instructions")
Suggested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/intel/compiler/brw_fs_nir.cpp

index 5b37f4dc382806446e907e75b80eee2b8317c2ae..6a9a2548b6ce5754cb41da47adf35447ae41249b 100644 (file)
@@ -1817,6 +1817,13 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr,
       break;
 
    case nir_op_flrp:
+      if (nir_has_any_rounding_mode_enabled(execution_mode)) {
+         brw_rnd_mode rnd =
+            brw_rnd_mode_from_execution_mode(execution_mode);
+         bld.emit(SHADER_OPCODE_RND_MODE, bld.null_reg_ud(),
+                  brw_imm_d(rnd));
+      }
+
       inst = bld.LRP(result, op[0], op[1], op[2]);
       inst->saturate = instr->dest.saturate;
       break;