public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Couple of minor tweaks to Eval_Fat.Succ
@ 2021-04-29  8:03 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-04-29  8:03 UTC (permalink / raw)
  To: gcc-patches; +Cc: Eric Botcazou

[-- Attachment #1: Type: text/plain, Size: 187 bytes --]

This saves a few cycles by using Ureal_Half instead of Ureal_1.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* eval_fat.adb (Succ): Use Ureal_Half in a couple of places.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 719 bytes --]

diff --git a/gcc/ada/eval_fat.adb b/gcc/ada/eval_fat.adb
--- a/gcc/ada/eval_fat.adb
+++ b/gcc/ada/eval_fat.adb
@@ -736,7 +736,7 @@ package body Eval_Fat is
          if Has_Denormals (RT) then
             Exp := Emin;
          else
-            return Scaling (RT, Ureal_1, Emin - 1);
+            return Scaling (RT, Ureal_Half, Emin);
          end if;
       end if;
 
@@ -755,7 +755,7 @@ package body Eval_Fat is
 
       if New_Frac = Frac then
          if New_Frac = Scaling (RT, -Ureal_1, Mantissa - 1) then
-            New_Frac := New_Frac + Scaling (RT, Ureal_1, Uint_Minus_1);
+            New_Frac := New_Frac + Ureal_Half;
          else
             New_Frac := New_Frac + Ureal_1;
          end if;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-29  8:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29  8:03 [Ada] Couple of minor tweaks to Eval_Fat.Succ Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).