Re: [Mesa-dev] [PATCH] mesa: Use signed math for possibly negative values

2011-05-19 Thread Chad Versace
On 05/19/2011 01:19 PM, Chad Versace wrote: > On 05/19/2011 05:13 AM, Ian Romanick wrote: >> From: Ian Romanick >> >> Since RowStride might be negative, we want a signed result. On 64-bit >> platforms, an unsigned 32-bit result added to a 64-bit pointer will >> give the wrong answer. > > Looks li

Re: [Mesa-dev] [PATCH] mesa: Use signed math for possibly negative values

2011-05-19 Thread Chad Versace
On 05/19/2011 05:13 AM, Ian Romanick wrote: > From: Ian Romanick > > Since RowStride might be negative, we want a signed result. On 64-bit > platforms, an unsigned 32-bit result added to a 64-bit pointer will > give the wrong answer. > > For x = y = 50, RowStride = -128, and format bytes = 4, t

Re: [Mesa-dev] [PATCH] mesa: Use signed math for possibly negative values

2011-05-19 Thread Adam Jackson
On Thu, 2011-05-19 at 14:13 +0200, Ian Romanick wrote: > From: Ian Romanick > > Since RowStride might be negative, we want a signed result. On 64-bit > platforms, an unsigned 32-bit result added to a 64-bit pointer will > give the wrong answer. Hah, saw this just as I sent my patch. Let's hear

[Mesa-dev] [PATCH] mesa: Use signed math for possibly negative values

2011-05-19 Thread Ian Romanick
From: Ian Romanick Since RowStride might be negative, we want a signed result. On 64-bit platforms, an unsigned 32-bit result added to a 64-bit pointer will give the wrong answer. For x = y = 50, RowStride = -128, and format bytes = 4, the difference is: Breakpoint 1, get_pointer_generic (ctx=