[Mesa-dev] [PATCH 3/3] nir/lower_double_ops: fix indentation

Thomas Hindoe Paaboel Andersen phomes at gmail.com
Fri Apr 29 18:32:00 UTC 2016


---
 src/compiler/nir/nir_lower_double_ops.c | 60 ++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/compiler/nir/nir_lower_double_ops.c b/src/compiler/nir/nir_lower_double_ops.c
index e5cf094..3f831dc 100644
--- a/src/compiler/nir/nir_lower_double_ops.c
+++ b/src/compiler/nir/nir_lower_double_ops.c
@@ -267,36 +267,36 @@ lower_sqrt_rsq(nir_builder *b, nir_ssa_def *src, bool sqrt)
     * (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots).
     */
 
-    nir_ssa_def *one_half = nir_imm_double(b, 0.5);
-    nir_ssa_def *h_0 = nir_fmul(b, one_half, ra);
-    nir_ssa_def *g_0 = nir_fmul(b, src, ra);
-    nir_ssa_def *r_0 = nir_ffma(b, nir_fneg(b, h_0), g_0, one_half);
-    nir_ssa_def *h_1 = nir_ffma(b, h_0, r_0, h_0);
-    nir_ssa_def *res;
-    if (sqrt) {
-       nir_ssa_def *g_1 = nir_ffma(b, g_0, r_0, g_0);
-       nir_ssa_def *r_1 = nir_ffma(b, nir_fneg(b, g_1), g_1, src);
-       res = nir_ffma(b, h_1, r_1, g_1);
-    } else {
-       nir_ssa_def *y_1 = nir_fmul(b, nir_imm_double(b, 2.0), h_1);
-       nir_ssa_def *r_1 = nir_ffma(b, nir_fneg(b, y_1), nir_fmul(b, h_1, src),
-                                   one_half);
-       res = nir_ffma(b, y_1, r_1, y_1);
-    }
-
-    if (sqrt) {
-       /* Here, the special cases we need to handle are
-        * 0 -> 0 and
-        * +inf -> +inf
-        */
-       res = nir_bcsel(b, nir_ior(b, nir_feq(b, src, nir_imm_double(b, 0.0)),
-                                  nir_feq(b, src, nir_imm_double(b, INFINITY))),
-                       src, res);
-    } else {
-       res = fix_inv_result(b, res, src, new_exp);
-    }
-
-    return res;
+   nir_ssa_def *one_half = nir_imm_double(b, 0.5);
+   nir_ssa_def *h_0 = nir_fmul(b, one_half, ra);
+   nir_ssa_def *g_0 = nir_fmul(b, src, ra);
+   nir_ssa_def *r_0 = nir_ffma(b, nir_fneg(b, h_0), g_0, one_half);
+   nir_ssa_def *h_1 = nir_ffma(b, h_0, r_0, h_0);
+   nir_ssa_def *res;
+   if (sqrt) {
+      nir_ssa_def *g_1 = nir_ffma(b, g_0, r_0, g_0);
+      nir_ssa_def *r_1 = nir_ffma(b, nir_fneg(b, g_1), g_1, src);
+      res = nir_ffma(b, h_1, r_1, g_1);
+   } else {
+      nir_ssa_def *y_1 = nir_fmul(b, nir_imm_double(b, 2.0), h_1);
+      nir_ssa_def *r_1 = nir_ffma(b, nir_fneg(b, y_1), nir_fmul(b, h_1, src),
+                                  one_half);
+      res = nir_ffma(b, y_1, r_1, y_1);
+   }
+
+   if (sqrt) {
+      /* Here, the special cases we need to handle are
+       * 0 -> 0 and
+       * +inf -> +inf
+       */
+      res = nir_bcsel(b, nir_ior(b, nir_feq(b, src, nir_imm_double(b, 0.0)),
+                                 nir_feq(b, src, nir_imm_double(b, INFINITY))),
+                                 src, res);
+   } else {
+      res = fix_inv_result(b, res, src, new_exp);
+   }
+
+   return res;
 }
 
 static nir_ssa_def *
-- 
2.7.4



More information about the mesa-dev mailing list