summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/R600GenRegisterInfo.pl
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-05-09 11:50:02 -0400
committerTom Stellard <[email protected]>2012-05-09 12:49:44 -0400
commit788fd04dacb9eb1e32010050c57cd2f49779311b (patch)
tree9f8e1fc97efc4ff8c6a7ba180258ee5931933c51 /src/gallium/drivers/radeon/R600GenRegisterInfo.pl
parentc2e081030e5c6f96ea3eb9948e5c0d0d2ed79a3d (diff)
radeon/llvm: Remove AMDGPUConstants.pm
Diffstat (limited to 'src/gallium/drivers/radeon/R600GenRegisterInfo.pl')
-rw-r--r--src/gallium/drivers/radeon/R600GenRegisterInfo.pl24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/R600GenRegisterInfo.pl b/src/gallium/drivers/radeon/R600GenRegisterInfo.pl
index 409e34548df..a7f6ce1c9a7 100644
--- a/src/gallium/drivers/radeon/R600GenRegisterInfo.pl
+++ b/src/gallium/drivers/radeon/R600GenRegisterInfo.pl
@@ -14,7 +14,8 @@
use strict;
use warnings;
-use AMDGPUConstants;
+use constant CONST_REG_COUNT => 256;
+use constant TEMP_REG_COUNT => 128;
my $CREG_MAX = CONST_REG_COUNT - 1;
my $TREG_MAX = TEMP_REG_COUNT - 1;
@@ -170,3 +171,24 @@ sub print_reg_defs {
return @reg_list;
}
+#Helper functions
+sub get_hw_index {
+ my ($index) = @_;
+ return int($index / 4);
+}
+
+sub get_chan_str {
+ my ($index) = @_;
+ my $chan = $index % 4;
+ if ($chan == 0 ) {
+ return 'X';
+ } elsif ($chan == 1) {
+ return 'Y';
+ } elsif ($chan == 2) {
+ return 'Z';
+ } elsif ($chan == 3) {
+ return 'W';
+ } else {
+ die("Unknown chan value: $chan");
+ }
+}