unix: Add asm statements needed to read registers with clang. Code generated by gcc 4.9.0 is unchanged (same statements, different order).
Both are inefficient, saving unmodified registers on the stack.
This commit is contained in:
parent
1b901c320b
commit
ceac71f1f5
|
@ -43,11 +43,17 @@ typedef machine_uint_t regs_t[6];
|
|||
|
||||
void gc_helper_get_regs(regs_t arr) {
|
||||
register long rbx asm ("rbx");
|
||||
asm("" : "=r"(rbx));
|
||||
register long rbp asm ("rbp");
|
||||
asm("" : "=r"(rbp));
|
||||
register long r12 asm ("r12");
|
||||
asm("" : "=r"(r12));
|
||||
register long r13 asm ("r13");
|
||||
asm("" : "=r"(r13));
|
||||
register long r14 asm ("r14");
|
||||
asm("" : "=r"(r14));
|
||||
register long r15 asm ("r15");
|
||||
asm("" : "=r"(r15));
|
||||
arr[0] = rbx;
|
||||
arr[1] = rbp;
|
||||
arr[2] = r12;
|
||||
|
|
Loading…
Reference in New Issue