[Mesa-dev] [PATCH] glsl: use a separate div_to_mul_rcp lowering flag for integers

2011-08-27 Thread Bryan Cain
TGSI, at the very least, has UDIV/IDIV instructions for integer division. --- src/glsl/ir_optimization.h | 13 +++-- src/glsl/lower_instructions.cpp|4 +++- src/mesa/drivers/dri/i965/brw_shader.cpp |1 + src/mesa/program/ir_to_mesa.cpp|

[Mesa-dev] [PATCH] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-27 Thread Kenneth Graunke
From: Bryan Cain 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

Re: [Mesa-dev] [PATCH] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-28 Thread Bryan Cain
On 08/27/2011 10:18 PM, Kenneth Graunke wrote: > From: Bryan Cain > > 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

Re: [Mesa-dev] [PATCH] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-28 Thread Eric Anholt
On Sat, 27 Aug 2011 20:18:55 -0700, Kenneth Graunke wrote: > From: Bryan Cain > > 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 >

Re: [Mesa-dev] [PATCH] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-28 Thread Bryan Cain
On 08/28/2011 07:38 PM, Eric Anholt wrote: > On Sat, 27 Aug 2011 20:18:55 -0700, Kenneth Graunke > wrote: >> From: Bryan Cain >> >> Using multiply and reciprocal for integer division involves potentially >> lossy floating point conversions. This is okay for older GPUs that >> represent integers

Re: [Mesa-dev] [PATCH] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-29 Thread Eric Anholt
On Sun, 28 Aug 2011 20:51:10 -0500, Bryan Cain wrote: > On 08/28/2011 07:38 PM, Eric Anholt wrote: > > On Sat, 27 Aug 2011 20:18:55 -0700, Kenneth Graunke > > wrote: > >> From: Bryan Cain > >> > >> Using multiply and reciprocal for integer division involves potentially > >> lossy floating point

Re: [Mesa-dev] [PATCH] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/28/2011 06:51 PM, Bryan Cain wrote: > On 08/28/2011 07:38 PM, Eric Anholt wrote: >> On Sat, 27 Aug 2011 20:18:55 -0700, Kenneth Graunke >> wrote: >>> From: Bryan Cain >>> >>> Using multiply and reciprocal for integer division involves potentia