summaryrefslogtreecommitdiff
path: root/lib/Target/Sparc/SparcRegisterInfo.td
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-26 00:28:19 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-26 00:28:19 +0000
commit6a45d681e53a99b4c4f63e0b1664626a596a8151 (patch)
tree93f2e7b40f4ff7487a536b62da8f6dd2e2531b87 /lib/Target/Sparc/SparcRegisterInfo.td
parent6d37a29588e9a48d81480501f895ac627bf60201 (diff)
downloadllvm-6a45d681e53a99b4c4f63e0b1664626a596a8151.tar.gz
llvm-6a45d681e53a99b4c4f63e0b1664626a596a8151.tar.bz2
llvm-6a45d681e53a99b4c4f63e0b1664626a596a8151.tar.xz
Replace the SubRegSet tablegen class with a less error-prone mechanism.
A Register with subregisters must also provide SubRegIndices for adressing the subregisters. TableGen automatically inherits indices for sub-subregisters to minimize typing. CompositeIndices may be specified for the weirder cases such as the XMM sub_sd index that returns the same register, and ARM NEON Q registers where both D subregs have ssub_0 and ssub_1 sub-subregs. It is now required that all subregisters are named by an index, and a future patch will also require inherited subregisters to be named. This is necessary to allow composite subregister indices to be reduced to a single index. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/SparcRegisterInfo.td')
-rw-r--r--lib/Target/Sparc/SparcRegisterInfo.td6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/Sparc/SparcRegisterInfo.td b/lib/Target/Sparc/SparcRegisterInfo.td
index 2b05c19bf1..fede9299cc 100644
--- a/lib/Target/Sparc/SparcRegisterInfo.td
+++ b/lib/Target/Sparc/SparcRegisterInfo.td
@@ -20,6 +20,11 @@ class SparcCtrlReg<string n>: Register<n> {
let Namespace = "SP";
}
+let Namespace = "SP" in {
+def sub_even : SubRegIndex;
+def sub_odd : SubRegIndex;
+}
+
// Registers are identified with 5-bit ID numbers.
// Ri - 32-bit integer registers
class Ri<bits<5> num, string n> : SparcReg<n> {
@@ -33,6 +38,7 @@ class Rf<bits<5> num, string n> : SparcReg<n> {
class Rd<bits<5> num, string n, list<Register> subregs> : SparcReg<n> {
let Num = num;
let SubRegs = subregs;
+ let SubRegIndices = [sub_even, sub_odd];
}
// Control Registers