Mesa (master): glsl: Add constant expression handling for asinh, acosh, and atanh.

Kenneth Graunke kwg at kemper.freedesktop.org
Mon Nov 15 22:11:01 UTC 2010


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Nov 15 14:08:58 2010 -0800

glsl: Add constant expression handling for asinh, acosh, and atanh.

---

 src/glsl/ir_constant_expression.cpp |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index ce13a06..1e9360f 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -990,10 +990,18 @@ ir_call::constant_expression_value()
       assert(op[0]->type->is_float());
       for (unsigned c = 0; c < op[0]->type->components(); c++)
 	 data.f[c] = acosf(op[0]->value.f[c]);
+   } else if (strcmp(callee, "acosh") == 0) {
+      assert(op[0]->type->is_float());
+      for (unsigned c = 0; c < op[0]->type->components(); c++)
+	 data.f[c] = acoshf(op[0]->value.f[c]);
    } else if (strcmp(callee, "asin") == 0) {
       assert(op[0]->type->is_float());
       for (unsigned c = 0; c < op[0]->type->components(); c++)
 	 data.f[c] = asinf(op[0]->value.f[c]);
+   } else if (strcmp(callee, "asinh") == 0) {
+      assert(op[0]->type->is_float());
+      for (unsigned c = 0; c < op[0]->type->components(); c++)
+	 data.f[c] = asinhf(op[0]->value.f[c]);
    } else if (strcmp(callee, "atan") == 0) {
       assert(op[0]->type->is_float());
       if (num_parameters == 2) {
@@ -1004,6 +1012,10 @@ ir_call::constant_expression_value()
 	 for (unsigned c = 0; c < op[0]->type->components(); c++)
 	    data.f[c] = atanf(op[0]->value.f[c]);
       }
+   } else if (strcmp(callee, "atanh") == 0) {
+      assert(op[0]->type->is_float());
+      for (unsigned c = 0; c < op[0]->type->components(); c++)
+	 data.f[c] = atanhf(op[0]->value.f[c]);
    } else if (strcmp(callee, "dFdx") == 0 || strcmp(callee, "dFdy") == 0) {
       return ir_constant::zero(mem_ctx, this->type);
    } else if (strcmp(callee, "ceil") == 0) {




More information about the mesa-commit mailing list