mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 15:10:46 +03:00
OpenBSD: Add polyImpl implementation for x86
Fix Issue 22393 - OpenBSD: Add polyImpl implementation for x86
This commit is contained in:
parent
b114d3f1a1
commit
36eeb42292
1 changed files with 27 additions and 0 deletions
|
@ -711,6 +711,33 @@ private real polyImpl(real x, in real[] A) @trusted pure nothrow @nogc
|
||||||
return_ST: ;
|
return_ST: ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else version (OpenBSD)
|
||||||
|
{
|
||||||
|
asm pure nothrow @nogc // assembler by W. Bright
|
||||||
|
{
|
||||||
|
// EDX = (A.length - 1) * real.sizeof
|
||||||
|
mov ECX,A[EBP] ; // ECX = A.length
|
||||||
|
dec ECX ;
|
||||||
|
lea EDX,[ECX*8] ;
|
||||||
|
lea EDX,[EDX][ECX*4] ;
|
||||||
|
add EDX,A+4[EBP] ;
|
||||||
|
fld real ptr [EDX] ; // ST0 = coeff[ECX]
|
||||||
|
jecxz return_ST ;
|
||||||
|
fld x[EBP] ; // ST0 = x
|
||||||
|
fxch ST(1) ; // ST1 = x, ST0 = r
|
||||||
|
align 4 ;
|
||||||
|
L2: fmul ST,ST(1) ; // r *= x
|
||||||
|
fld real ptr -12[EDX] ;
|
||||||
|
sub EDX,12 ; // deg--
|
||||||
|
faddp ST(1),ST ;
|
||||||
|
dec ECX ;
|
||||||
|
jne L2 ;
|
||||||
|
fxch ST(1) ; // ST1 = r, ST0 = x
|
||||||
|
fstp ST(0) ; // dump x
|
||||||
|
align 4 ;
|
||||||
|
return_ST: ;
|
||||||
|
}
|
||||||
|
}
|
||||||
else version (Solaris)
|
else version (Solaris)
|
||||||
{
|
{
|
||||||
asm pure nothrow @nogc // assembler by W. Bright
|
asm pure nothrow @nogc // assembler by W. Bright
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue