diff options
author | Thomas Hindoe Paaboel Andersen <[email protected]> | 2016-04-29 20:32:00 +0200 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-04-30 12:16:32 -0700 |
commit | cbcd7b60f573d027337a2390e67f6010e9992aaa (patch) | |
tree | 7cb0ed4ef99bcb6fc85f5eab568c41463df96fc6 | |
parent | 21424e019d29424e2c09cf8ac197d294cf2edb5f (diff) |
nir/lower_double_ops: fix indentation
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/compiler/nir/nir_lower_double_ops.c | 60 |
1 files 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 e5cf094bad0..3f831dcf304 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 * |