public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Michael Meissner <meissner@linux.vnet.ibm.com>
Cc: <gcc-patches@gcc.gnu.org>, <dje.gcc@gmail.com>,
	Steve Munroe	<sjmunroe@us.ibm.com>,
	Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com>
Subject: Re: [PATCH], PowerPC IEEE 128-bit patch #8 (libgcc bits, revised)
Date: Mon, 16 Nov 2015 23:06:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.10.1511162249210.32387@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20151114000223.GA14976@ibm-tiger.the-meissners.org>

On Fri, 13 Nov 2015, Michael Meissner wrote:

> This patch should address the following IEEE problems with the libgcc emulator
> with exceptions, etc.  Steve is working on patches to libdfp for Decimal
> conversions.

Are the libgcc2.c functions for KFmode and the corresponding complex mode 
KCmode (__divkc3 __mulkc3 __powikf2) also planned for GCC 6?

> 	* config/rs6000/sfp-machine.h (_FP_W_TYPE_SIZE): Update
> 	defintiions to use 64-bit types for 64-bit systems or 32-bit VSX
> 	systems with IEEE 128-bit floating point support.
> 	(_FP_W_TYPE): Likewise.
> 	(_FP_WS_TYPE): Likewise.
> 	(_FP_I_TYPE): Likewise.
> 	(TItype): Add defintions for IEEE 128-bit floating point support.
> 	(UTItype): Likewise.
> 	(TI_BITS): Likewise.
> 	(_FP_MUL_MEAT_Q): Use 64-bit types on 64-bit systems and for
> 	32-bit VSX systems with IEEE 128-bit floating point.
> 	(_FP_DIV_MEAT_Q): Likewise.
> 	(_FP_NANFRAC_Q): Likewise.

This ChangeLog entry doesn't seem to have been updated for the exceptions 
/ rounding modes support.

> +#define ISA_BIT(x) (1 << (63 - x))

I think all the new sfp-machine.h code for integration with hardware 
exceptions and rounding modes needs to be conditional on hard-float + 
FPRs, so it doesn't affect building for SFmode / DFmode for soft-float / 
e500.

> +  /* First do the unordered comparison.  */
> +  FP_CMP_UNORD_Q (r, A, B, 1);
> +  if (r)
> +    r2 = PPC_UNORDERED;
> +
> +  else
> +    {
> +      /* If the value is not unordered, do the normal comparison.  */
> +      FP_CMP_Q (r, A, B, 2, 2);
> +      if (r == CMP_INVALID)
> +	FP_SET_EXCEPTION (FP_EX_INVALID);
> +
> +      r2 = ((r < CMP_LOW || r > CMP_HIGH)
> +	    ? PPC_UNORDERED
> +	    : ppc_cr_map[r-CMP_LOW]);

This may be correct, but it's overly complicated.  All the handling in the 
"else" case for exceptions / unordered is dead code, since in that case 
you know that the values aren't unordered.  And you can more simply do

  FP_CMP_Q (r, A, B, 2, 1);

at which point "invalid" has been raised if appropriate (for signaling 
NaNs but not for other arguments), and r contains one of the values -1, 0, 
1, 2, which you can map directly to the appropriate return value.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2015-11-16 23:06 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 20:14 [PATCH], PowerPC IEEE 128-bit patch #4 Michael Meissner
2015-07-29 22:38 ` Segher Boessenkool
2015-07-29 22:48   ` Michael Meissner
2015-07-29 22:56     ` Segher Boessenkool
2015-07-29 23:48       ` Michael Meissner
2015-07-30 19:57 ` [PATCH], PowerPC IEEE 128-bit patch #4c (revised) Michael Meissner
2015-08-01 19:48   ` David Edelsohn
2015-07-31  2:49 ` [PATCH], PowerPC IEEE 128-bit patch #4 Joseph Myers
2015-08-03 19:02   ` Michael Meissner
2015-08-03 21:18     ` Joseph Myers
2015-08-14 15:47 ` [PATCH], PowerPC IEEE 128-bit patch #5 Michael Meissner
2015-08-19 12:47   ` Segher Boessenkool
2015-08-25 23:33     ` Michael Meissner
2015-08-26 13:16       ` David Edelsohn
2015-08-14 15:49 ` [PATCH], PowerPC IEEE 128-bit patch #6 Michael Meissner
2015-08-26 13:57   ` David Edelsohn
2015-08-14 15:56 ` [PATCH], PowerPC IEEE 128-bit patch #7 Michael Meissner
2015-08-14 16:24   ` Michael Meissner
2015-10-23 17:24   ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2) Michael Meissner
2015-10-23 17:30     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #01 Michael Meissner
2015-10-29 14:28       ` David Edelsohn
2015-10-23 17:31     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #02 Michael Meissner
2015-10-29 14:29       ` David Edelsohn
2015-10-23 17:35     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #03 Michael Meissner
2015-10-29 14:29       ` David Edelsohn
2015-10-23 17:38     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #04 Michael Meissner
2015-10-23 20:24       ` Michael Meissner
2015-10-29 14:29       ` David Edelsohn
2015-10-23 17:39     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #05 Michael Meissner
2015-10-23 18:08       ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #05 (patch included) Michael Meissner
2015-10-29 14:33       ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #05 David Edelsohn
2015-10-23 17:44     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #06 Michael Meissner
2015-10-29 14:36       ` David Edelsohn
2015-10-29 17:56         ` Michael Meissner
2015-10-23 17:45     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #07 Michael Meissner
2015-10-29 14:36       ` David Edelsohn
2015-10-23 17:47     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #08 Michael Meissner
2015-10-29 14:38       ` David Edelsohn
2015-10-23 17:47     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #09 Michael Meissner
2015-10-23 20:17       ` Joseph Myers
2015-10-23 20:23         ` Michael Meissner
2015-10-29 14:39       ` David Edelsohn
2015-10-23 17:52     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #10 Michael Meissner
2015-10-29 14:40       ` David Edelsohn
2015-10-23 17:57     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #11 Michael Meissner
2015-10-29 14:42       ` David Edelsohn
2015-10-23 17:58     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #12 Michael Meissner
2015-10-29 14:44       ` David Edelsohn
2015-10-23 18:00     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #13 Michael Meissner
2015-10-29 14:46       ` David Edelsohn
2015-10-23 18:01     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #14 Michael Meissner
2015-10-29 14:46       ` David Edelsohn
2015-10-23 18:03     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #15 Michael Meissner
2015-10-29 14:50       ` David Edelsohn
2015-10-23 18:04     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #16 Michael Meissner
2015-10-29 15:02       ` David Edelsohn
2015-10-23 20:06     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2) Segher Boessenkool
2015-10-23 20:25       ` Michael Meissner
2015-10-27 19:48     ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised #2), Subpatch #17 Michael Meissner
2015-11-04 15:47       ` David Edelsohn
2015-10-27 22:27     ` [PATCH], PowerPC IEEE 128-bit patch #8 (libgcc bits) Michael Meissner
2015-10-27 23:39       ` Joseph Myers
2015-11-03 22:17         ` Michael Meissner
2015-11-03 22:53           ` Michael Meissner
2015-11-14  0:02             ` [PATCH], PowerPC IEEE 128-bit patch #8 (libgcc bits, revised) Michael Meissner
2015-11-16 23:06               ` Joseph Myers [this message]
2015-11-03 22:55           ` [PATCH], PowerPC IEEE 128-bit patch #8 (libgcc bits) Mike Stump
2015-11-03 23:41           ` Joseph Myers
2015-10-27 22:35     ` [PATCH], PowerPC IEEE 128-bit patch #9 (enable __float128 by default on VSX systems) Michael Meissner
2015-10-29 14:08       ` Segher Boessenkool
2015-10-29 19:02         ` Joseph Myers
2015-10-29 21:09         ` Michael Meissner
2015-09-16 22:50 ` [PATCH], PowerPC IEEE 128-bit patch #7 (revised) Michael Meissner
2015-09-22  0:19   ` Michael Meissner
2015-10-08 19:04   ` [Patch] PowerPC IEEE 128-bit patch #7 (revised #2) Michael Meissner
2015-10-08 21:30     ` Joseph Myers
2015-10-13 18:11       ` Michael Meissner
2015-10-13 23:44         ` Joseph Myers

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=alpine.DEB.2.10.1511162249210.32387@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=meissner@linux.vnet.ibm.com \
    --cc=sjmunroe@us.ibm.com \
    --cc=tulioqm@br.ibm.com \
    /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).