diff --git a/std/math/algebraic.d b/std/math/algebraic.d index 20dbb17e1..0b74ea067 100644 --- a/std/math/algebraic.d +++ b/std/math/algebraic.d @@ -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