tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Not supporting fpgetmask(3) on aarch64



On Mon, Mar 24, 2014 at 08:21:16PM +0100, Joerg Sonnenberger wrote:
> On Mon, Mar 24, 2014 at 09:43:53AM -0700, Matt Thomas wrote:
> > 
> > On Mar 24, 2014, at 8:40 AM, Ignatios Souvatzis 
> > <ignatios%cs.uni-bonn.de@localhost> wrote:
> > 
> > > On Mon, Mar 24, 2014 at 11:11:14AM +0100, Joerg Sonnenberger wrote:
> > >> On Mon, Mar 24, 2014 at 07:30:31AM +0100, ????? ???????????? wrote:
> > >>> Yes, if you wish to run, scientific software on it.
> > >> 
> > >> Scientific software can and should use fenv(3) too...
> > > 
> > > What about the precision part in fpget...(3)'s BUGS section?
> > > 
> > > "                        These interfaces are deprecated and the ones in
> > >  fenv(3) should be used, although the interfaces in fenv(3) don't support
> > >  getting or setting the precision."
> > 
> > except setting the precision is only valid for x86 (and anything else
> > supporting 80-bit FP).

Well, probably aimed at controlling the x86 fpu.
Other hardware could easily support 80+bit by using different opcodes
(like some vax), so not have a settable precision.

> ...and likely to give unexpected results at least for amd64.

amd64 is 'interesting'.
'long double' uses the x87 FP stack and instructions, so is subject
to the precision being set to less than 80bits - so it could the same
precision as 'float'.

However some instructions (like fscale and the trig/log ones) are
not in the SSE2 set - so the values have to be moved between the xmm
and x87 registers. If you need 2 (or more) x87 instructions it is best
to use 'long double' for the intermediate values to avoid the memory
accesses and long instruction sequences.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index