[LLVMdev] Patch: More data types

Villmow, Micah Micah.Villmow at amd.com
Fri Feb 6 16:59:43 PST 2009


I've patched valuetypes.td/h to add data types that my backend needs to
support. There seems to be a lot of assumptions made in other spots of
the code that limit the number of data types to 32. I need to add a few
more types, but once I go over this limit llvm starts acting wonky. I
found all the items that are hard coded to 32 and a section that isn't,
but I cannot figure out how to expand it so that there can be up to 64
data types.

 

The section in question is TargetLowering.h and seems to be these two
functions.

LegalizeAction getTypeAction(MVT VT) const {

      if (VT.isExtended()) {

        if (VT.isVector()) return Expand;

        if (VT.isInteger())

          // First promote to a power-of-two size, then expand if
necessary.

          return VT == VT.getRoundIntegerType() ? Expand : Promote;

        assert(0 && "Unsupported extended type!");

        return Legal;

      }

      unsigned I = VT.getSimpleVT();

 
assert(I<4*array_lengthof(ValueTypeActions)*sizeof(ValueTypeActions[0]))
;

      return (LegalizeAction)((ValueTypeActions[I>>4] >> ((2*I) & 31)) &
3);

    }

void setTypeAction(MVT VT, LegalizeAction Action) {

      unsigned I = VT.getSimpleVT();

 
assert(I<4*array_lengthof(ValueTypeActions)*sizeof(ValueTypeActions[0]))
;

      ValueTypeActions[I>>4] |= Action << ((I*2) & 31);

    }

 

I am not really sure what is going on here, but would be happy if
someone could get it to expand to allow 64 datatypes.

Thanks,

 

Micah Villmow

Systems Engineer

Advanced Technology & Performance

Advanced Micro Devices Inc.

S1-609 One AMD Place

Sunnyvale, CA. 94085

P: 408-749-3966

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090206/fc9e4639/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: datatypes.diff
Type: application/octet-stream
Size: 10160 bytes
Desc: datatypes.diff
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090206/fc9e4639/attachment.obj>


More information about the llvm-dev mailing list