Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allocate R1 into r8d on amd64.

  • Loading branch information...
commit c2eb00e31005b82cdf9f09fa13459ac1b16951b5 1 parent d585e18
@nelhage authored
Showing with 8 additions and 2 deletions.
  1. +6 −2 bt.cpp
  2. +2 −0  bt_helper_64.S
View
8 bt.cpp
@@ -338,7 +338,9 @@ void bt_load_reg(X86Assembler *cc, uint8_t breg, X86Register reg) {
switch (breg) {
case 31: cc->xor_(reg, reg); break;
case 0: cc->mov(X86ESI, reg); break;
-#ifndef __x86_64__
+#ifdef __x86_64__
+ case 1: cc->mov(X86R8D, reg); break;
+#else
case 1: cc->mov(X86EDI, reg); break;
#endif
case SP: cc->mov(X86EBX, reg); break;
@@ -352,7 +354,9 @@ void bt_store_reg(X86Assembler *cc, T val, uint8_t breg) {
switch (breg) {
case 31: break;
case 0: cc->mov(val, X86ESI); break;
-#ifndef __x86_64__
+#ifdef __x86_64__
+ case 1: cc->mov(val, X86R8D); break;
+#else
case 1: cc->mov(val, X86EDI); break;
#endif
case SP: cc->mov(val, X86EBX); break;
View
2  bt_helper_64.S
@@ -23,6 +23,7 @@
mov (4*SP)(%rbp), %ebx
mov (4*BP)(%rbp), %edx
mov (4*0)(%rbp), %esi
+ mov (4*1)(%rbp), %r8d
mov (32*4 + 8)(%rbp), %rdi
// mov (4*1)(%rbp), %edi
.endm
@@ -34,6 +35,7 @@
mov %ebx, (4*SP)(%rbp)
mov %edx, (4*BP)(%rbp)
mov %esi, (4*0)(%rbp)
+ mov %r8d, (4*1)(%rbp)
// mov %edi, (4*1)(%rbp)
.endm
Please sign in to comment.
Something went wrong with that request. Please try again.