Implement exp2() and log2(), and make ir_unop_exp and ir_unop_log be base e.
Making the base e functions IR operations is not a clear win. i965 doesn't support it, it doesn't look like r600 supports it, but r500 does. It should be easily supportable as a lowering pass, though.
This commit is contained in:
committed by
Ian Romanick
parent
53afc3609d
commit
01665262e5
+18
-2
@@ -76,6 +76,22 @@ generate_log(exec_list *instructions,
|
||||
generate_unop(instructions, declarations, type, ir_unop_log);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_exp2(exec_list *instructions,
|
||||
ir_variable **declarations,
|
||||
const glsl_type *type)
|
||||
{
|
||||
generate_unop(instructions, declarations, type, ir_unop_exp2);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_log2(exec_list *instructions,
|
||||
ir_variable **declarations,
|
||||
const glsl_type *type)
|
||||
{
|
||||
generate_unop(instructions, declarations, type, ir_unop_log2);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_rsq(exec_list *instructions,
|
||||
ir_variable **declarations,
|
||||
@@ -278,8 +294,8 @@ generate_110_functions(glsl_symbol_table *symtab, exec_list *instructions)
|
||||
make_gentype_function(symtab, instructions, "pow", 2, generate_pow);
|
||||
make_gentype_function(symtab, instructions, "exp", 1, generate_exp);
|
||||
make_gentype_function(symtab, instructions, "log", 1, generate_log);
|
||||
/* FINISHME: exp2() */
|
||||
/* FINISHME: log2() */
|
||||
make_gentype_function(symtab, instructions, "exp2", 1, generate_exp2);
|
||||
make_gentype_function(symtab, instructions, "log2", 1, generate_log2);
|
||||
make_gentype_function(symtab, instructions, "sqrt", 1, generate_sqrt);
|
||||
make_gentype_function(symtab, instructions, "inversesqrt", 1, generate_rsq);
|
||||
make_gentype_function(symtab, instructions, "abs", 1, generate_abs);
|
||||
|
||||
Reference in New Issue
Block a user