[LLVMdev] LLD improvement plan

Rick Mann rmann at latencyzero.com
Wed May 6 13:48:39 PDT 2015


> On May 6, 2015, at 13:34 , Sean Silva <chisophugis at gmail.com> wrote:
> 
> 
> 
> On Wed, May 6, 2015 at 9:34 AM, Will Newton <will.newton at gmail.com> wrote:
> 
> Why would you want to put an object at the address of some registers?
> You would just want a cast would you not?
> 
> e.g. regs = (struct MyRegBlock *)0x1234
> 
> This causes you to have to be constantly dereferencing, which can result in a huge amount of syntactic overhead. CMSIS does this really consistently and do a good job at it: http://www.keil.com/pack/doc/CMSIS/Core/html/group__peripheral__gr.html
> But it's sort of an all-or-nothing thing to organize the peripheral headers like that, and many platforms don't (MSP430, AVR, smaller PIC's), instead preferring to have e.g. `volatile uint8_t Foo;` for each hardware register instead of putting things in structs.
> 
> -- Sean Silva

Having worked with both forms (struct vs. individual symbols), I really prefer the struct mechanism. Especially in more recent processors, the hardware register layout is very consistent from one peripheral to the next, and when using the struct, it can dramatically reduce the number of symbols one has to deal with.

So, my $0.02 (having only a cursory understanding of this thread) is to hopefully allow the struct mechanism.

-- 
Rick Mann
rmann at latencyzero.com






More information about the llvm-dev mailing list