mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 22:30:24 +01:00
nir: Add a lower_fdiv option and use it in i965
This commit is contained in:
parent
f32d16a9f0
commit
7174d155e9
3 changed files with 3 additions and 0 deletions
|
|
@ -1433,6 +1433,7 @@ typedef struct nir_function {
|
|||
|
||||
typedef struct nir_shader_compiler_options {
|
||||
bool lower_ffma;
|
||||
bool lower_fdiv;
|
||||
bool lower_flrp;
|
||||
bool lower_fpow;
|
||||
bool lower_fsat;
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ optimizations = [
|
|||
(('imul', a, 1), a),
|
||||
(('fmul', a, -1.0), ('fneg', a)),
|
||||
(('imul', a, -1), ('ineg', a)),
|
||||
(('fdiv', a, b), ('fmul', a, ('frcp', b)), 'options->lower_fdiv'),
|
||||
(('ffma', 0.0, a, b), b),
|
||||
(('ffma', a, 0.0, b), b),
|
||||
(('ffma', a, b, 0.0), ('fmul', a, b)),
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ brw_compiler_create(void *mem_ctx, const struct brw_device_info *devinfo)
|
|||
*/
|
||||
nir_options->lower_ffma = true;
|
||||
nir_options->lower_sub = true;
|
||||
nir_options->lower_fdiv = true;
|
||||
|
||||
/* We want the GLSL compiler to emit code that uses condition codes */
|
||||
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue