[llvm-dev] Support for byte sizes larger than 8 bits

Marek Surovič via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 17 06:47:33 PDT 2015

Hello LLVMdev,

lately the company I work for has bumped into a need for a way to 
specify a size of byte larger than the regular 8 bits for our targets. 
After a bit of research we found out that the feature would require 
changes across most of the LLVM framework (including clang) and 
maintaining such changes without involving the LLVM devs would be 
tedious to say the least.

So my first question would be if such a feature would be welcome in the 
LLVM framework. The motivation for implementing the feature is that 
certain embedded processors often use custom byte sizes, such as 12 
bits, to conserve power while addressing its memory.

The first solution sketch we came up with is to introduce a new field 
into the data layout string that would specify the size of a byte (or 
char). The default value of the field would be the regular 8 bits. This 
way, the information should be propagated through all the necessary 
parts of LLVM.

The second issue is how to find and modify the existing code that relies 
on the assumption that a byte (or char) in the target is always 8 bits.

The changes we would introduce, should the feature be accepted, would of 
course be tested against an existing LLVM target and test-suites to 
ensure that we didn't break anything.


Marek Surovic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150817/9c95b076/attachment.html>

More information about the llvm-dev mailing list