[PATCH] Add a way to define the bit range covered by a SubRegIndex.

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu May 30 16:26:31 PDT 2013


On May 30, 2013, at 2:44 PM, Ahmed Bougacha <ahmed.bougacha at gmail.com> wrote:

> On Tue, May 28, 2013 at 1:48 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
>> 
>>> -class SubRegIndex<list<SubRegIndex> comps = []> {
>>> +class SubRegIndex<list<SubRegIndex> comps = [], int offset = -1, int size = -1> {
>> 
>> 
>> I think we should flip these arguments around to be (size, offset, comps). That is more convenient for most targets. You can also make the offset default = 0, that is usually the right thing.
>> 
>> In a second patch, I think it would make sense to make the size argument mandatory.
> 
> OK then - quick update on the patch - what about this: Instead of
> having the comps list, let ComposedOf only be settable by
> ComposedSubRegIndex, a subclass of SubRegIndex. That way, SubRegIndex
> only has size/offset, whereas ComposedSubRegIndex only has the A and B
> elements of comps. (By the way, this lets us do some cleanup in
> TableGen).

I’m OK with removing the ‘comps’ argument, but we should just use:

def foo : SubRegIndex<32, 32> { let ComposedOf = [a,b]; }

/jakob





More information about the llvm-commits mailing list