Displaying 1 result from an estimated 1 matches for "set_stack_pointer_addr".
Did you mean:
get_stack_pointer_addr
2014 Mar 28
9
[LLVMdev] Named Register Implementation
...ind of agree that some named registers could be
implemented, and that it should be an intrinsic that passes the name
of the register down.
This C code:
register unsigned long current_stack_pointer asm("sp");
unsigned long get_stack_pointer_addr() {
return current_stack_pointer;
}
void set_stack_pointer_addr(unsigned long addr) {
current_stack_pointer = addr;
}
Would become something like:
define i32 @get_stack_pointer_addr() nounwind {
entry:
%0 = call i32 @llvm.read_register("sp")
ret i32 %0
}
define void @set_stack_pointer_addr(i32 %addr) nounwind {
entry:
call void @llvm.write_...