libroot/x86[_64]: relax asm constraints in tls_*() functions

This commit is contained in:
Pawel Dziepak
2014-05-04 02:40:04 +02:00
parent e08c932315
commit 634bc98a3c
3 changed files with 21 additions and 21 deletions
+7 -7
View File
@@ -30,8 +30,8 @@ tls_get(int32 index)
{
void *ret;
__asm__ __volatile__ (
"movl %%fs:(,%%edx, 4), %%eax \n\t"
: "=a"(ret) : "d"(index) );
"movl %%fs:(, %1, 4), %0"
: "=r" (ret) : "r" (index));
return ret;
}
@@ -40,9 +40,9 @@ tls_address(int32 index)
{
void **ret;
__asm__ __volatile__ (
"movl %%fs:0, %%eax \n\t"
"leal (%%eax, %%edx, 4), %%eax \n\t"
: "=a"(ret) : "d"(index) );
"movl %%fs:0, %0\n\t"
"leal (%0, %1, 4), %0\n\t"
: "=&r" (ret) : "r" (index));
return ret;
}
@@ -50,8 +50,8 @@ static inline void
tls_set(int32 index, void *value)
{
__asm__ __volatile__ (
"movl %%eax, %%fs:(,%%edx, 4) \n\t"
: : "d"(index), "a"(value) );
"movl %1, %%fs:(, %0, 4)"
: : "r" (index), "r" (value));
}
#else
+7 -7
View File
@@ -32,8 +32,8 @@ tls_get(int32 index)
{
void *ret;
__asm__ __volatile__ (
"movl %%fs:(,%%edx, 4), %%eax \n\t"
: "=a"(ret) : "d"(index) );
"movl %%fs:(, %1, 4), %0"
: "=r" (ret) : "r" (index));
return ret;
}
@@ -43,9 +43,9 @@ tls_address(int32 index)
{
void **ret;
__asm__ __volatile__ (
"movl %%fs:0, %%eax \n\t"
"leal (%%eax, %%edx, 4), %%eax \n\t"
: "=a"(ret) : "d"(index) );
"movl %%fs:0, %0\n\t"
"leal (%0, %1, 4), %0\n\t"
: "=&r" (ret) : "r" (index));
return ret;
}
@@ -54,7 +54,7 @@ void
tls_set(int32 index, void *value)
{
__asm__ __volatile__ (
"movl %%eax, %%fs:(,%%edx, 4) \n\t"
: : "d"(index), "a"(value) );
"movl %1, %%fs:(, %0, 4)"
: : "r" (index), "r" (value));
}
+7 -7
View File
@@ -35,8 +35,8 @@ tls_get(int32 _index)
void* ret;
__asm__ __volatile__ (
"movq %%fs:(, %%rdi, 8), %%rax"
: "=a" (ret) : "D" (index));
"movq %%fs:(, %1, 8), %0"
: "=r" (ret) : "r" (index));
return ret;
}
@@ -48,9 +48,9 @@ tls_address(int32 _index)
void** ret;
__asm__ __volatile__ (
"movq %%fs:0, %%rax\n\t"
"leaq (%%rax, %%rdi, 8), %%rax\n\t"
: "=a" (ret) : "D" (index));
"movq %%fs:0, %0\n\t"
"leaq (%0, %1, 8), %0\n\t"
: "=&r" (ret) : "r" (index));
return ret;
}
@@ -60,6 +60,6 @@ tls_set(int32 _index, void* value)
{
int64 index = _index;
__asm__ __volatile__ (
"movq %%rsi, %%fs:(, %%rdi, 8)"
: : "D" (index), "S" (value));
"movq %1, %%fs:(, %0, 8)"
: : "r" (index), "r" (value));
}