summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins/ir
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-09-13 17:53:32 -0700
committerIan Romanick <[email protected]>2010-09-13 17:53:32 -0700
commit309cd4115b7cba669a0bf858e7809cb6dae90ddf (patch)
tree9418cb206bbe92695682bd855128a9e616f559cc /src/glsl/builtins/ir
parent4dfb89904c0a3d2166e9a3fc0253a254680e91bc (diff)
glsl2: Port equal() and notEqual() to ir_unop_all_equal and ir_unop_any_nequal
Diffstat (limited to 'src/glsl/builtins/ir')
-rw-r--r--src/glsl/builtins/ir/equal72
-rw-r--r--src/glsl/builtins/ir/notEqual72
2 files changed, 24 insertions, 120 deletions
diff --git a/src/glsl/builtins/ir/equal b/src/glsl/builtins/ir/equal
index a3c9acfff96..f6578dc1e32 100644
--- a/src/glsl/builtins/ir/equal
+++ b/src/glsl/builtins/ir/equal
@@ -3,119 +3,71 @@
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (w) (var_ref temp) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) bvec2 arg0)
(declare (in) bvec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) bvec3 arg0)
(declare (in) bvec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) bvec4 arg0)
(declare (in) bvec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (w) (var_ref temp) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) ivec2 arg0)
(declare (in) ivec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) ivec3 arg0)
(declare (in) ivec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) ivec4 arg0)
(declare (in) ivec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (w) (var_ref temp) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (w) (var_ref temp) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))
))
diff --git a/src/glsl/builtins/ir/notEqual b/src/glsl/builtins/ir/notEqual
index 34a74e44047..d07cdbf41f1 100644
--- a/src/glsl/builtins/ir/notEqual
+++ b/src/glsl/builtins/ir/notEqual
@@ -3,119 +3,71 @@
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (w) (var_ref temp) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) bvec2 arg0)
(declare (in) bvec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) bvec3 arg0)
(declare (in) bvec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) bvec4 arg0)
(declare (in) bvec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (w) (var_ref temp) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) ivec2 arg0)
(declare (in) ivec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) ivec3 arg0)
(declare (in) ivec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) ivec4 arg0)
(declare (in) ivec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (w) (var_ref temp) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (x) (var_ref temp) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (y) (var_ref temp) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (z) (var_ref temp) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (w) (var_ref temp) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))
))