[llvm-commits] [llvm-gcc] BITWIDTH.patch (for review only)

Reid Spencer rspencer at reidspencer.com
Mon Jan 15 20:49:01 PST 2007


Here's a patch to give llvm-gcc the ability to specify arbitrary bit
widths with a new "bitwidth" attribute. The attribute is used like this:

int __attribute__((bitwidth(17)));

int __attribute__((bitwidth(23))) My32BitInt;

struct MyStruct {
  int __attribute__((bitwidth(5))) My5BitField;
  My32BitInt My32BitField;
};

void func(int __attribute__((bitwidth(23))) ) {...}

etc.

Note that no LLVM backend can currently handle this. I will be working
on making either the CBackEnd or LLI handle these correctly. Other
targets may or may not get implemented.

This patch has not been tested well (just Dejagnu) so please do not
apply it.

Reid.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: BITWIDTH.patch
Type: text/x-patch
Size: 8061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070116/a571ff5f/attachment.bin>


More information about the llvm-commits mailing list