This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Truncating df to sf (and typo in code)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]