public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: libc-alpha@sourceware.org, libc-ports@sourceware.org,
	 Marcus Shawcroft <marcus.shawcroft@linaro.org>,
	Richard Henderson <rth@redhat.com>,
	 David Holsgrove <david.holsgrove@xilinx.com>,
	Chris Metcalf <cmetcalf@tilera.com>,
	 "David S. Miller" <davem@davemloft.net>
Subject: Re: Implement fma in soft-fp
Date: Tue, 25 Jun 2013 15:30:00 -0000	[thread overview]
Message-ID: <51C9B79D.8070303@twiddle.net> (raw)
In-Reply-To: <Pine.LNX.4.64.1306221707230.15367@digraph.polyomino.org.uk>

On 06/22/2013 10:17 AM, Joseph S. Myers wrote:
> * Using this code on an architecture that detects tininess after
>   rounding may require soft-fp support for after-rounding tininess
>   detection to be added to avoid failures of fma tests for that
>   particular case.  (In particular, this is relevant for alpha.  It's
>   not currently relevant for MIPS because of the general lack of
>   exceptions support in the cases where this code gets used.)

I'll give this a bit o testing for alpha and see what happens.

> -#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y)				\
> +#define _FP_MUL_MEAT_DW_1_hard(wfracbits, R, X, Y)			\
>    do {									\
> -    _FP_W_TYPE _xh, _xl, _yh, _yl, _z_f0, _z_f1, _a_f0, _a_f1;		\
> +    _FP_W_TYPE _xh, _xl, _yh, _yl;					\
> +    _FP_FRAC_DECL_2(_a);						\
>  									\
>      /* split the words in half */					\
>      _xh = X##_f >> (_FP_W_TYPE_SIZE/2);					\
> @@ -172,17 +184,23 @@ do {							\
>      _yl = Y##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1);		\
>  									\
>      /* multiply the pieces */						\
> -    _z_f0 = _xl * _yl;							\
> +    R##f0 = _xl * _yl;							\
>      _a_f0 = _xh * _yl;							\
>      _a_f1 = _xl * _yh;							\
> -    _z_f1 = _xh * _yh;							\
> +    R##f1 = _xh * _yh;							\

Missing _ before f[01] there.

I've been wondering from time to time about replacing all of this macro
nonsense with c++.  Overloaded functions in some cases, templates in others.
It might eliminate silly typos like this.  And be easier to debug.

I believe that all of this code pre-dates the SRA pass by a large margin,
so it's possible the compiler could do the same good structure splitting
job that we did here by hand.

Of course, that would require glibc to build parts with the c++ compiler,
so that may be a non-starter...


r~

  reply	other threads:[~2013-06-25 15:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-22 17:17 Joseph S. Myers
2013-06-25 15:30 ` Richard Henderson [this message]
2013-06-25 16:13   ` Joseph S. Myers
2013-06-25 16:23     ` Richard Henderson
2013-06-25 16:31 ` Richard Henderson
2013-06-25 16:45   ` Joseph S. Myers
2013-06-27 23:26 ` Joseph S. Myers
2013-07-02 12:57   ` Ping " Joseph S. Myers
2013-07-02 14:45     ` Richard Henderson

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=51C9B79D.8070303@twiddle.net \
    --to=rth@twiddle.net \
    --cc=cmetcalf@tilera.com \
    --cc=davem@davemloft.net \
    --cc=david.holsgrove@xilinx.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libc-ports@sourceware.org \
    --cc=marcus.shawcroft@linaro.org \
    --cc=rth@redhat.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).