Mailinglist Archive: radeonhd (364 mails)

< Previous Next >
Re: [radeonhd] [PATCH] Fix OFFSET_[XYZ] macro in shader.h
  • From: Matthias Hopf <mhopf@xxxxxxx>
  • Date: Wed, 11 Mar 2009 16:22:00 +0100
  • Message-id: <20090311152200.GA27137@xxxxxxx>
On Mar 11, 09 08:13:54 -0700, Yang Zhao wrote:
2009/3/11 Matthias Hopf <mhopf@xxxxxxx>:
-#define OFFSET_X(x) (x)
+#define OFFSET_X(x) (((x) >= 0) ? ((x) & 0x0f) : (((-(x)-1) & 0x0f) ^
0x1f))

Shouldn't

#define OFFSET_X(x) ((x) & 0x1f) /* 5 bit signed two's
complement -16..15 */

be enough?...

Hm, you're right. I wrote this pretty early in the morning, and
apparently didn't think it through enough.

Not exactly. Your version is the only one 100% correct, and I'm *really*
unsure whether we should go for the 100% correct or the more readable
version here :-]

Anyway, committing the updated version now, if you think we should go
for the 100% correct way, we can change later ;)

CU

Matthias

--
Matthias Hopf <mhopf@xxxxxxx> __ __ __
Maxfeldstr. 5 / 90409 Nuernberg (_ | | (_ |__ mat@xxxxxxxxx
Phone +49-911-74053-715 __) |_| __) |__ R & D www.mshopf.de
--
To unsubscribe, e-mail: radeonhd+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: radeonhd+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups