Skip to content

Commit

Permalink
yl2x asm, remove finit and fwait
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Stepanov committed Oct 7, 2014
1 parent e308d06 commit 5b62b0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
16 changes: 4 additions & 12 deletions src/root/port.c
Expand Up @@ -266,11 +266,9 @@ void Port::yl2x_impl(longdouble* x, longdouble* y, longdouble* res)
mov eax, y
mov ebx, x
mov ecx, res
finit
fld tbyte ptr [eax]
fld tbyte ptr [ebx]
fyl2x
fwait
fstp tbyte ptr [ecx]
}
}
Expand All @@ -282,11 +280,9 @@ void Port::yl2xp1_impl(longdouble* x, longdouble* y, longdouble* res)
mov eax, y
mov ebx, x
mov ecx, res
finit
fld tbyte ptr [eax]
fld tbyte ptr [ebx]
fyl2xp1
fwait
fstp tbyte ptr [ecx]
}
}
Expand Down Expand Up @@ -949,10 +945,9 @@ void Port::yl2x_impl(long double* x, long double* y, long double* res)
__asm__ volatile("movl %0, %%eax;" // move x, y, res to registers
"movl %1, %%ebx;"
"movl %2, %%ecx;"
"finit;" // initialize FPU
"fldt (%%ebx);" // push *y and *x to the FPU stack
"fldt (%%eax);" // "t" suffix means tbyte
"fyl2x; fwait;" // do operation and wait
"fyl2x;" // do operation and wait
"fstpt (%%ecx)" // pop result to a *res
: // output: empty
:"r"(x), "r"(y), "r"(res) // input: x => %0, y => %1, res => %2
Expand All @@ -964,10 +959,9 @@ void Port::yl2xp1_impl(long double* x, long double* y, long double* res)
__asm__ volatile("movl %0, %%eax;" // move x, y, res to registers
"movl %1, %%ebx;"
"movl %2, %%ecx;"
"finit;" // initialize FPU
"fldt (%%ebx);" // push *y and *x to the FPU stack
"fldt (%%eax);" // "t" suffix means tbyte
"yl2xp1; fwait;" // do operation and wait
"yl2xp1;" // do operation and wait
"fstpt (%%ecx)" // pop result to a *res
: // output: empty
:"r"(x), "r"(y), "r"(res) // input: x => %0, y => %1, res => %2
Expand All @@ -978,10 +972,9 @@ void Port::yl2x_impl(long double* x, long double* y, long double* res)
__asm__ volatile("movq %0, %%rcx;" // move x, y, res to registers
"movq %1, %%rdx;"
"movq %2, %%r8;"
"finit;" // initialize FPU
"fldt (%%rdx);" // push *y and *x to the FPU stack
"fldt (%%rcx);" // "t" suffix means tbyte
"fyl2x; fwait;" // do operation and wait
"fyl2x;" // do operation and wait
"fstpt (%%r8)" // pop result to a *res
: // output: empty
:"r"(x), "r"(y), "r"(res) // input: x => %0, y => %1, res => %2
Expand All @@ -993,10 +986,9 @@ void Port::yl2xp1_impl(long double* x, long double* y, long double* res)
__asm__ volatile("movq %0, %%rcx;" // move x, y, res to registers
"movq %1, %%rdx;"
"movq %2, %%r8;"
"finit;" // initialize FPU
"fldt (%%rdx);" // push *y and *x to the FPU stack
"fldt (%%rcx);" // "t" suffix means tbyte
"yl2xp1; fwait;" // do operation and wait
"yl2xp1;" // do operation and wait
"fstpt (%%r8)" // pop result to a *res
: // output: empty
:"r"(x), "r"(y), "r"(res) // input: x => %0, y => %1, res => %2
Expand Down
2 changes: 0 additions & 2 deletions src/vcbuild/ldfpu.asm
Expand Up @@ -325,7 +325,6 @@ ld_yl2x PROC
fld tbyte ptr [rdx]
fld tbyte ptr [rcx]
fyl2x
fwait
fstp tbyte ptr [r8]
ret
ld_yl2x ENDP
Expand All @@ -338,7 +337,6 @@ ld_yl2xp1 PROC
fld tbyte ptr [rdx]
fld tbyte ptr [rcx]
fyl2xp1
fwait
fstp tbyte ptr [r8]
ret
ld_yl2xp1 ENDP
Expand Down

0 comments on commit 5b62b0d

Please sign in to comment.