[LLVMdev] How to bind a register variable with a given general purpose register?

Heyu Zhu zhu.heyu at gmail.com
Sun Jan 3 18:59:40 PST 2010


Hi everyone,

There are 16 GPRs in my RISC, but in fact GPR13 is read-only and connected
to output of an A/D converter.
It would be very convenient if i could bind a register variable with GPR13.

Because i am a newbie i don't know how my llvm backend can support that.

I plan to implement it as below.

A.  first declare a global variable in c-code
     int  ADC  asm("GPR13");
B.  If backend finds a variable is loaded from "GPR13"  use GPR13 instead.
C.  backend can't allocate GPR13 to other variable

Is it a foolish method? Is there a better one? Please give me some guidance

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100104/4fe5ac84/attachment.html>


More information about the llvm-dev mailing list