Mesa (master): radeonsi: Fix VGPR_BIT() definition.

Michel Dänzer daenzer at kemper.freedesktop.org
Thu Apr 19 18:01:21 UTC 2012


Module: Mesa
Branch: master
Commit: dbf48e88eb11270e080eced8468008ed2c3329cc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dbf48e88eb11270e080eced8468008ed2c3329cc

Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Apr 19 19:14:45 2012 +0200

radeonsi: Fix VGPR_BIT() definition.

Fixes encoding of VOP3 shader instructions.

The shift was wrong for source registers 2 and 3, and the resulting value was
only 32 bits, so the shift in SICodeEmitter::VOPPostEncode() didn't work as
intended.

---

 src/gallium/drivers/radeon/SICodeEmitter.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/radeon/SICodeEmitter.cpp b/src/gallium/drivers/radeon/SICodeEmitter.cpp
index 0553f0e..ad494fa 100644
--- a/src/gallium/drivers/radeon/SICodeEmitter.cpp
+++ b/src/gallium/drivers/radeon/SICodeEmitter.cpp
@@ -25,7 +25,7 @@
 #include <stdio.h>
 
 #define LITERAL_REG 255
-#define VGPR_BIT(src_idx) (1 << (8 * (src_idx)))
+#define VGPR_BIT(src_idx) (1ULL << (9 * src_idx - 1))
 using namespace llvm;
 
 namespace {




More information about the mesa-commit mailing list