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] Implement part of System.Fat_Gen more efficiently
Date: Mon, 14 Dec 2020 10:56:03 -0500	[thread overview]
Message-ID: <20201214155603.GA4072@adacore.com> (raw)

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

This reimplements the low-level primitives of System.Fat_Gen, i.e.
Copy_Sign, Decompose and Scaling more efficiently, by using the same
direct approach as the existing implementation of Valid; only the
normalization of denormalized numbers and the gradual underflow are
still left to the hardware.

This also speeds up Pred and Succ for denormalized numbers.

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

gcc/ada/

	* libgnat/s-fatgen.ads (Compose): Add pragma Inline.
	(Copy_Sign): Likewise.
	(Exponent): Likewise.
	(Fraction): Likewise.
	* libgnat/s-fatgen.adb: Remove with clause for System, add
	with and use clauses for System.Unsigned_Types.
	Add pragma Warnings (Off) for non-static constants.
	Remove precomputed tables of powers of radix and add a few
	constants describing the floating-point format.
	(Gradual_Scaling): Delete.
	(Copy_Sign): Reimplement directly.
	(Decompose): Likewise.
	(Scaling): Likewise.
	(Pred): Speed up.
	(Succ): Likewise.
	(Truncation): Tidy up.
	(Valid): Move constants to library level.

[-- Attachment #2: patch.diff.gz --]
[-- Type: application/gzip, Size: 7173 bytes --]

                 reply	other threads:[~2020-12-14 15:56 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=20201214155603.GA4072@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).