[LLVMdev] Modeling 16-bit pointer registers for an 8-bit target
Dan Gohman
gohman at apple.com
Wed Aug 6 13:53:02 PDT 2008
Legalize uses two primary predicates, isTypeLegal and isOperationLegal.
I guess your target tells Legalize that i16 as a legal type. The next
step
is to tell legalize that loading a 16-bit GlobalAddress is not a legal
operation.
If you do that and it still doesn't work, it's a likely indication that
Legalize is making an assumption that isn't valid for your rather
unique architecture, and you should investigate correcting that
assumption.
Dan
On Aug 6, 2008, at 3:54 AM, Sanjiv.Gupta at microchip.com wrote:
> Pointer size on our target is 16-bits, and we have two 16-bit
> registers that can be used only to hold pointers (indirect addresses).
>
> All operations on the target are 8-bit operations, so it takes two 8-
> bit loads to load these pointer registers.
>
> We want LLVM to automatically expand all types to 8-bit values.
>
> The problem is that LLVM does not expand GlobalAddresses, which are
> 16-bit values.
> This in turn means that you have to specify a 16-bit register class,
> and once you specify a 16-bit register class, LLVM does not further
> expand 16-bit values.
>
> Any suggestions on how to model this into LLVM?
>
> TIA,
> Sanjiv
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list