This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Truncating df to sf (and typo in code)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: "Paulo J. Matos" <pocmatos at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 13 Apr 2011 12:17:27 +0000 (UTC)
- Subject: Re: Truncating df to sf (and typo in code)
- References: <io3vp1$ffr$1@dough.gmane.org>
On Wed, 13 Apr 2011, Paulo J. Matos wrote:
> I have been looking at the fp-bit code and noticed:
> In my port I am having some trouble with the truncation from df to sf.
Unless your port is outside the scope of what soft-fp supports (for
example, soft-fp probably won't work for systems with 16-bit int, and such
systems may also be too space-constrained for the soft-fp code) I'd advise
using soft-fp instead of fp-bit for a new port since it's significantly
faster (although the code is a bit larger). (For that matter, I encourage
converting existing ports from fp-bit to soft-fp for the same reason -
though you may wish to benchmark for your target to confirm you get
similar speedups to those seen on Power Architecture processors.)
> I wonder if there's any doc reference upon which the code was based to do the
> truncation. I can't really find anything and even though the code is not hard
> I am still missing something.
The soft-fp code is, however, somewhat harder to understand than the less
highly optimized fp-bit code.
--
Joseph S. Myers
joseph@codesourcery.com