a-numaux-x86.adb (Logarithmic_Pow): Do not silently clobber x87 registers.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 10 Sep 2007 10:10:58 +0000 (10:10 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 10 Sep 2007 10:10:58 +0000 (10:10 +0000)
* a-numaux-x86.adb (Logarithmic_Pow): Do not silently clobber
x87 registers.

From-SVN: r128329

gcc/ada/ChangeLog
gcc/ada/a-numaux-x86.adb

index b4824a9d5ce601bdf1d2f9104d84bbebdabaa682..e2b0849774abf16c97775920b8ba9b4575e03afd 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-10  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * a-numaux-x86.adb (Logarithmic_Pow): Do not silently clobber
+       x87 registers.
+
 2007-09-10  Eric Botcazou  <ebotcazou@adacore.com>
 
        * decl.c (gnat_to_gnu_entity) <object>: Deal with variable built for
index 5c85661eeb92dd7bf656cbbc6f488afd003985c7..77a1acc3e245bdf35a641166bcc84b122576ed3d 100644 (file)
@@ -302,15 +302,14 @@ package body Ada.Numerics.Aux is
    begin
       Asm (Template => ""             --  X                  : Y
        & "fyl2x                " & NL --  Y * Log2 (X)
-       & "fst     %%st(1)      " & NL --  Y * Log2 (X)       : Y * Log2 (X)
+       & "fld     %%st(0)      " & NL --  Y * Log2 (X)       : Y * Log2 (X)
        & "frndint              " & NL --  Int (...)          : Y * Log2 (X)
        & "fsubr   %%st, %%st(1)" & NL --  Int (...)          : Fract (...)
        & "fxch                 " & NL --  Fract (...)        : Int (...)
        & "f2xm1                " & NL --  2**Fract (...) - 1 : Int (...)
        & "fld1                 " & NL --  1 : 2**Fract (...) - 1 : Int (...)
        & "faddp   %%st, %%st(1)" & NL --  2**Fract (...)     : Int (...)
-       & "fscale               " & NL --  2**(Fract (...) + Int (...))
-       & "fstp    %%st(1)      ",
+       & "fscale               ",     --  2**(Fract (...) + Int (...))
          Outputs  => Double'Asm_Output ("=t", Result),
          Inputs   =>
            (Double'Asm_Input  ("0", X),