Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.2001201626390.9710@key0.esi.com.au>
Date: Mon, 20 Jan 2020 16:32:32 +1100 (AEDT)
From: Damian McGuckin <damianm@....com.au>
To: musl@...ts.openwall.com
Subject: Re: Considering x86-64 fenv.s to C

On Fri, 17 Jan 2020, Rich Felker wrote:

> Note that this approach is not compatible with trapping exceptions, but 
> we don't support them anyway.

When an FNSTENV instruction is executed, all pending exceptions are 
essentially lost (either the x87 FPU status register is cleared or all 
exceptions are masked).

I think that this means either it wipes the exception bits in the status 
register or it wipes out the bits of the control register which handle 
which exceptions are trapped.

Am I wrong.

Because MUSL does not support trapping exceptions, we do not need to
restore the control word.

But do we need to copy the lost exceptions flags in the x87 register
back into the SSE register, well at least where we have an SSE.

Mind you, on an i386 without an SSE, you cannot restore them!

Regards - Damian

Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.