public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <derodat@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Eric Botcazou <ebotcazou@adacore.com>
Subject: [Ada] Couple of minor tweaks to Eval_Fat.Succ
Date: Thu, 29 Apr 2021 04:03:47 -0400	[thread overview]
Message-ID: <20210429080347.GA133902@adacore.com> (raw)

[-- 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;



                 reply	other threads:[~2021-04-29  8:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210429080347.GA133902@adacore.com \
    --to=derodat@adacore.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).