diff options
author | Ian Romanick <[email protected]> | 2010-09-13 17:53:32 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-09-13 17:53:32 -0700 |
commit | 309cd4115b7cba669a0bf858e7809cb6dae90ddf (patch) | |
tree | 9418cb206bbe92695682bd855128a9e616f559cc /src/glsl/builtin_function.cpp | |
parent | 4dfb89904c0a3d2166e9a3fc0253a254680e91bc (diff) |
glsl2: Port equal() and notEqual() to ir_unop_all_equal and ir_unop_any_nequal
Diffstat (limited to 'src/glsl/builtin_function.cpp')
-rw-r--r-- | src/glsl/builtin_function.cpp | 144 |
1 files changed, 24 insertions, 120 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 05b2bc43911..1e633e3f3a8 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -787,121 +787,73 @@ static const char *builtin_equal = " (parameters\n" " (declare (in) vec2 arg0)\n" " (declare (in) vec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec3\n" " (parameters\n" " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec4\n" " (parameters\n" " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (w) (var_ref temp) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec2\n" " (parameters\n" " (declare (in) bvec2 arg0)\n" " (declare (in) bvec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec3\n" " (parameters\n" " (declare (in) bvec3 arg0)\n" " (declare (in) bvec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec4\n" " (parameters\n" " (declare (in) bvec4 arg0)\n" " (declare (in) bvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (w) (var_ref temp) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec2\n" " (parameters\n" " (declare (in) ivec2 arg0)\n" " (declare (in) ivec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec3\n" " (parameters\n" " (declare (in) ivec3 arg0)\n" " (declare (in) ivec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec4\n" " (parameters\n" " (declare (in) ivec4 arg0)\n" " (declare (in) ivec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (w) (var_ref temp) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec2\n" " (parameters\n" " (declare (in) uvec2 arg0)\n" " (declare (in) uvec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec3\n" " (parameters\n" " (declare (in) uvec3 arg0)\n" " (declare (in) uvec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec4\n" " (parameters\n" " (declare (in) uvec4 arg0)\n" " (declare (in) uvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (w) (var_ref temp) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))\n" "))\n" "" ; @@ -2359,121 +2311,73 @@ static const char *builtin_notEqual = " (parameters\n" " (declare (in) vec2 arg0)\n" " (declare (in) vec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec3\n" " (parameters\n" " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec4\n" " (parameters\n" " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (w) (var_ref temp) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec2\n" " (parameters\n" " (declare (in) bvec2 arg0)\n" " (declare (in) bvec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec3\n" " (parameters\n" " (declare (in) bvec3 arg0)\n" " (declare (in) bvec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec4\n" " (parameters\n" " (declare (in) bvec4 arg0)\n" " (declare (in) bvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (w) (var_ref temp) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec2\n" " (parameters\n" " (declare (in) ivec2 arg0)\n" " (declare (in) ivec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec3\n" " (parameters\n" " (declare (in) ivec3 arg0)\n" " (declare (in) ivec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec4\n" " (parameters\n" " (declare (in) ivec4 arg0)\n" " (declare (in) ivec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (w) (var_ref temp) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec2\n" " (parameters\n" " (declare (in) uvec2 arg0)\n" " (declare (in) uvec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec3\n" " (parameters\n" " (declare (in) uvec3 arg0)\n" " (declare (in) uvec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature bvec4\n" " (parameters\n" " (declare (in) uvec4 arg0)\n" " (declare (in) uvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (w) (var_ref temp) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))\n" "))\n" "" ; |