glsl: Add support for ldexp.

v2: Drop frexp. Rebase on builtins rewrite.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
Matt Turner
2013-08-22 13:31:18 -07:00
parent 4b0488ef4e
commit b2ab840130
10 changed files with 51 additions and 0 deletions
+14
View File
@@ -510,6 +510,7 @@ private:
B1(findLSB)
B1(findMSB)
B1(fma)
B2(ldexp)
#undef B0
#undef B1
#undef B2
@@ -1822,6 +1823,13 @@ builtin_builder::create_builtins()
IU(findLSB)
IU(findMSB)
F(fma)
add_function("ldexp",
_ldexp(glsl_type::float_type, glsl_type::int_type),
_ldexp(glsl_type::vec2_type, glsl_type::ivec2_type),
_ldexp(glsl_type::vec3_type, glsl_type::ivec3_type),
_ldexp(glsl_type::vec4_type, glsl_type::ivec4_type),
NULL);
#undef F
#undef FI
#undef FIU
@@ -3514,6 +3522,12 @@ builtin_builder::_fma(const glsl_type *type)
return sig;
}
ir_function_signature *
builtin_builder::_ldexp(const glsl_type *x_type, const glsl_type *exp_type)
{
return binop(ir_binop_ldexp, gpu_shader5, x_type, x_type, exp_type);
}
/** @} */
/******************************************************************************/