[LLVMdev] LLVMdev Digest, Vol 76, Issue 45

Peter Lawrence peterl95124 at sbcglobal.net
Tue Oct 26 14:28:45 PDT 2010


>
> Consider an operating system.  I write some code that does the  
> following:
>
> a) Load registers into some LLVM IR registers (using inline asm)
> b) Modify the registers slightly
> c) Use volatile stores to save the registers into a stack-allocated  
> area
> d) Context switch
> e) Use volatile loads to reload the registers from the stack- 
> allocated area
>


the register save/restore code should be in the assembly written  
context-switch
part, not in high level C part.

think analogously about setjmp/longjmp, no one would ever factor the  
register
save/restore out of the rest of the setjmp/longjmp logic.


Peter Lawrence.



More information about the llvm-dev mailing list