aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target/Target.td
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2013-05-31 23:45:26 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2013-05-31 23:45:26 +0000
commit23ed37a6b76e79272194fb46597f7280661b828f (patch)
treea2c447458a013a1f1bcbdc84d43fe3c55c416a0d /include/llvm/Target/Target.td
parentcd8e3c4dcf4383b8b1c16827c6326f6e9bc49d51 (diff)
downloadexternal_llvm-23ed37a6b76e79272194fb46597f7280661b828f.zip
external_llvm-23ed37a6b76e79272194fb46597f7280661b828f.tar.gz
external_llvm-23ed37a6b76e79272194fb46597f7280661b828f.tar.bz2
Make SubRegIndex size mandatory, following r183020.
This also makes TableGen able to compute sizes/offsets of synthesized indices representing tuples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/Target.td')
-rw-r--r--include/llvm/Target/Target.td9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td
index c201f6b..a9644d4 100644
--- a/include/llvm/Target/Target.td
+++ b/include/llvm/Target/Target.td
@@ -22,13 +22,16 @@ include "llvm/IR/Intrinsics.td"
class RegisterClass; // Forward def
// SubRegIndex - Use instances of SubRegIndex to identify subregisters.
-class SubRegIndex<int size = -1, int offset = 0> {
+class SubRegIndex<int size, int offset = 0> {
string Namespace = "";
// Size - Size (in bits) of the sub-registers represented by this index.
int Size = size;
// Offset - Offset of the first bit that is part of this sub-register index.
+ // Set it to -1 if the same index is used to represent sub-registers that can
+ // be at different offsets (for example when using an index to access an
+ // element in a register tuple).
int Offset = offset;
// ComposedOf - A list of two SubRegIndex instances, [A, B].
@@ -58,7 +61,9 @@ class SubRegIndex<int size = -1, int offset = 0> {
// ComposedSubRegIndex - A sub-register that is the result of composing A and B.
// Offset is set to the sum of A and B's Offsets. Size is set to B's Size.
class ComposedSubRegIndex<SubRegIndex A, SubRegIndex B>
- : SubRegIndex<B.Size, -1> {
+ : SubRegIndex<B.Size, !if(!eq(A.Offset, -1), -1,
+ !if(!eq(B.Offset, -1), -1,
+ !add(A.Offset, B.Offset)))> {
// See SubRegIndex.
let ComposedOf = [A, B];
}