OpenBSD: Add polyImpl implementation for x86

Fix Issue 22393 - OpenBSD: Add polyImpl implementation for x86
This commit is contained in:
Brian Callahan 2021-10-16 08:05:02 -04:00
parent b114d3f1a1
commit 36eeb42292

View file

@ -711,6 +711,33 @@ private real polyImpl(real x, in real[] A) @trusted pure nothrow @nogc
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)
{
asm pure nothrow @nogc // assembler by W. Bright