[Mesa-dev] [PATCH 04/47] nir: Add rounding modes enum

Alejandro PiƱeiro apinheiro at igalia.com
Thu Aug 24 13:54:19 UTC 2017


From: Jose Maria Casanova Crespo <jmcasanova at igalia.com>

v2: Added comments describing each of the rounding modes. (Jason
    Ekstrand)
---
 src/compiler/nir/nir.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 835e18fe6dd..e6e4dff480a 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -106,6 +106,16 @@ typedef enum {
    nir_var_all             = ~0,
 } nir_variable_mode;
 
+/**
+ * Rounding modes.
+ */
+typedef enum {
+   nir_rounding_mode_undef = 0,
+   nir_rounding_mode_rtne  = 1, /* round to nearest even */
+   nir_rounding_mode_ru    = 2, /* round up */
+   nir_rounding_mode_rd    = 3, /* round down */
+   nir_rounding_mode_rtz   = 4, /* round towards zero */
+} nir_rounding_mode;
 
 typedef union {
    float f32[4];
-- 
2.11.0



More information about the mesa-dev mailing list