public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, Paolo Bonzini <bonzini@gnu.org>,
	       Ian Lance Taylor <iant@google.com>,
	       Richard Sandiford <rdsandiford@googlemail.com>
Subject: Re: CFT: [build] Move fp-bit support to toplevel libgcc
Date: Fri, 22 Jul 2011 15:30:00 -0000	[thread overview]
Message-ID: <yddwrfaicvk.fsf@manam.CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <Pine.LNX.4.64.1107211550510.11368@digraph.polyomino.org.uk>	(Joseph S. Myers's message of "Thu, 21 Jul 2011 15:59:07 +0000 (UTC)")

Joseph,

>> -tp-bit.c: $(srcdir)/config/fp-bit.c
>> -	echo '#ifdef __MIPSEL__' > tp-bit.c
>> -	echo '# define FLOAT_BIT_ORDER_MISMATCH' >> tp-bit.c
>> -	echo '#endif' >> tp-bit.c
>> -	echo '#if __LDBL_MANT_DIG__ == 113' >> tp-bit.c
>> -	echo '#define QUIET_NAN_NEGATED' >> tp-bit.c
>> -	echo '# define TFLOAT' >> tp-bit.c
>> -	cat $(srcdir)/config/fp-bit.c >> tp-bit.c
>> -	echo '#endif' >> tp-bit.c
>
> How does your code replace the "#if __LDBL_MANT_DIG__ == 113" condition 
> that stops tp-bit.c being built for o32 multilibs that don't have TFmode?

Richard Sandiford already pointed this out in private mail.  My initial
analysis was based on the IRIX case, where long double has
__LDBL_MANT_DIG__ = 106 (ibm extended format), which is used for all
supported ABIs.  Unfortunately, I forgot that at least Linux/MIPS still
supports (or even defaults to) the O32 ABI, where double and long double
are both 64-bit.

> (The best way would I think be configure tests in libgcc that cause 
> tp-bit.c only to be built at all for the relevant multilibs for this 
> target.)

That's one option, which I currently prefer.

RX has a similar issue, where I sort of solved it like this

ifneq ($(filter -m64bit-doubles,$(INTERNAL_CFLAGS)),)
DPBIT = true
endif

but it seems this cannot reliably be done on mips.  I see two possible
solutions:

* Provide fpbit_wrap_start/fpbit_wrap_end as in soft-fp, which is a
  general solution.

* Use configure tests.  My current preference would be to use
  AC_CHECK_SIZEOF([double]) (for rx) and AC_CHECK_SIZEOF([long double])
  (for mips) and substitute ac_cv_sizeof_double/ac_cv_sizeof_long_double
  (perhaps * 8) as make variables to do the test above.

Preferences?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

  reply	other threads:[~2011-07-22 14:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 17:18 Rainer Orth
2011-07-12 18:03 ` Richard Henderson
2011-07-21 16:12 ` Joseph S. Myers
2011-07-22 15:30   ` Rainer Orth [this message]
2011-07-22 15:38     ` Joseph S. Myers
2011-08-03 13:47   ` Rainer Orth
2011-08-03 14:33     ` Joseph S. Myers
2011-08-03 22:47       ` Ulrich Weigand
2011-08-05  6:40     ` Paolo Bonzini
2011-08-05  9:49       ` Rainer Orth

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=yddwrfaicvk.fsf@manam.CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=bonzini@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iant@google.com \
    --cc=joseph@codesourcery.com \
    --cc=rdsandiford@googlemail.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).