This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH] Fix static-binary lazy FPU context allocation


On Thu, 5 Sep 2013, Ryan S. Arnold wrote:

> Sort of tangential to the conversation; When I implemented the Decimal
> Floating Point library I discovered that the IEEE specification
> (IEEE752-2008) decided to name a set of DFP rounding modes that were
> only a subset of the actually hardware rounding modes available on
> Power Architecture hardware.  In my library I did see value in
> allowing a user to set those additional rounding modes as well as the
> ones defined in the IEEE spec.

That can be done through fe_dec_setround, with extra rounding modes 
defined if __USE_GNU; it doesn't require direct use of __fpu_control or 
_FPU_SETCW.

I don't know if you made the DFP library code all work in all of those 
modes (and testcases cover them, etc.).  We don't really have any generic 
support for extra binary rounding modes in glibc; if an architecture were 
to add such, we'd need to consider if and how to support them in glibc 
functions and the testsuite.  (At least, include/rounding-mode.h would 
need to change for the various bits of code that emulate rounding that 
way, but quite possibly other code wouldn't work in such extra modes 
either.)

Generally, users should not necessarily expect glibc functions to work 
correctly in arbitrary floating-point modes outside those that can be set 
with ISO C interfaces (or interfaces in TS 18661 if we support that in 
future, etc.).  For example, x86 library functions may not work correctly 
if the x87 precision control is set to 24-bit or 53-bit rather than 
64-bit.

-- 
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]