Mesa (master): nir/lower_double_ops: fix indentation

Jason Ekstrand jekstrand at kemper.freedesktop.org
Sat Apr 30 19:17:18 UTC 2016


Module: Mesa
Branch: master
Commit: cbcd7b60f573d027337a2390e67f6010e9992aaa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbcd7b60f573d027337a2390e67f6010e9992aaa

Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Fri Apr 29 20:32:00 2016 +0200

nir/lower_double_ops: fix indentation

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 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 *




More information about the mesa-commit mailing list