diff options
author | Kenneth Graunke <[email protected]> | 2010-10-30 21:59:52 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2010-11-03 13:39:41 -0700 |
commit | 91b72864b0b774a25712cf7e5196a22acc1693d9 (patch) | |
tree | 99deb4bfa8787afc69091f294375aa5e017edbcb | |
parent | 84566c770a8742638ff11fbae59756a50513d621 (diff) |
glsl/builtins: Clean up some ugly autogenerated code in atan.
In particular, calling the abs function is silly, since there's already
an expression opcode for that. Also, assigning to temporaries then
assigning those to the final location is rather redundant.
-rw-r--r-- | src/glsl/builtins/ir/atan | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/glsl/builtins/ir/atan b/src/glsl/builtins/ir/atan index 32f09d3c7a7..3f97e0d46f1 100644 --- a/src/glsl/builtins/ir/atan +++ b/src/glsl/builtins/ir/atan @@ -54,30 +54,15 @@ ) ( (declare () float r) - (declare ( ) float abs_retval) - (assign (constant bool (1)) (x) (var_ref abs_retval) (call abs ((var_ref x) )) -) - (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) ( - (declare ( ) float atan_retval) - (assign (constant bool (1)) (x) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) )) -) - (assign (constant bool (1)) (x) (var_ref r) (var_ref atan_retval) ) + (if (expression bool > (expression float abs (var_ref x)) (constant float (0.000100))) ( + (assign (constant bool (1)) (x) (var_ref r) (call atan ((expression float / (var_ref y) (var_ref x))))) (if (expression bool < (var_ref x) (constant float (0.000000)) ) ( - (if (expression bool >= (var_ref y) (constant float (0.000000)) ) ( - (declare ( ) float assignment_tmp) - (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) ) - (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) ) - ) - ( - (declare ( ) float assignment_tmp) - (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) ) - (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) ) - )) - + (if (expression bool >= (var_ref y) (constant float (0.000000)) ) + ((assign (constant bool (1)) (x) (var_ref r) (expression float + (var_ref r) (constant float (3.141593))))) + ((assign (constant bool (1)) (x) (var_ref r) (expression float - (var_ref r) (constant float (3.141593)))))) ) ( )) - ) ( (declare () float sgn) |