[Mesa-dev] [PATCH v3 32/44] i965/fs: add nir_op_ffract_{rtne, rtz} support

Samuel Iglesias Gonsálvez siglesias at igalia.com
Wed Feb 6 10:45:01 UTC 2019


According to the PRMs:

"The frc instruction computes, component-wise, the
truncate-to-minus-infinity fractional values of src0 and stores the
results in dst. The results, in the range of [0.0, 1.0], are the
fractional portion of the source data. The result is in the range
[0.0, 1.0] irrespective of the rounding mode."

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
 src/intel/compiler/brw_fs_nir.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index ac5067f7ecc..ef1ed9b7f0a 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -1301,6 +1301,8 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr)
       inst = bld.RNDD(result, op[0]);
       inst->saturate = instr->dest.saturate;
       break;
+   case nir_op_ffract_rtne:
+   case nir_op_ffract_rtz:
    case nir_op_ffract:
       inst = bld.FRC(result, op[0]);
       inst->saturate = instr->dest.saturate;
-- 
2.19.1



More information about the mesa-dev mailing list