diff options
author | Bryan Cain <[email protected]> | 2011-08-27 18:32:58 -0500 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2011-08-31 12:02:18 -0700 |
commit | 478034f34a59969103237eb78bc82f9e70fe81c2 (patch) | |
tree | 124922638fd8c7f981331cc6dbb5e1ceda6bd07f /src/glsl/ir_optimization.h | |
parent | 87679e2ea10836d89f47a37b8e94cce0d319622e (diff) |
glsl: Use a separate div_to_mul_rcp lowering flag for integers.
Using multiply and reciprocal for integer division involves potentially
lossy floating point conversions. This is okay for older GPUs that
represent integers as floating point, but undesirable for GPUs with
native integer division instructions.
TGSI, for example, has UDIV/IDIV instructions for integer division,
so it makes sense to handle this directly. Likewise for i965.
Reviewed-by: Ian Romanick <[email protected]>
Signed-off-by: Bryan Cain <[email protected]>
Signed-off-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ir_optimization.h')
-rw-r--r-- | src/glsl/ir_optimization.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h index f7808bdda9a..48448d4a16a 100644 --- a/src/glsl/ir_optimization.h +++ b/src/glsl/ir_optimization.h @@ -29,12 +29,13 @@ */ /* Operations for lower_instructions() */ -#define SUB_TO_ADD_NEG 0x01 -#define DIV_TO_MUL_RCP 0x02 -#define EXP_TO_EXP2 0x04 -#define POW_TO_EXP2 0x08 -#define LOG_TO_LOG2 0x10 -#define MOD_TO_FRACT 0x20 +#define SUB_TO_ADD_NEG 0x01 +#define DIV_TO_MUL_RCP 0x02 +#define EXP_TO_EXP2 0x04 +#define POW_TO_EXP2 0x08 +#define LOG_TO_LOG2 0x10 +#define MOD_TO_FRACT 0x20 +#define INT_DIV_TO_MUL_RCP 0x40 bool do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iterations); |