AVX on Cygwin
Corinna Vinschen
corinna-cygwin@cygwin.com
Fri Nov 27 09:37:00 GMT 2015
On Nov 27 10:32, Corinna Vinschen wrote:
> Hi Achim,
>
> On Nov 26 19:17, Achim Gratz wrote:
> >
> > You may have noted that the recent gmp update makes problems on some
> > machines and two of the three reports come from Broadwell CPU. There is
> > one thing that did indeed change with the update and that is use of the
> > AVX ADC instruction on Broadwell/Skylake. Is it possible that somehow
> > the stack model or some register save/restore is different on Cygwin
> > that would produce that problem? I can only test on SandyBridge and
> > IvyBridge for Intel and these have no problem.
>
> Prior to the invention of the AVX stuff, a thread context structure had
> a fixed size. To hold AVX registers, the context structure became a
> variable sized struct which has to be initialized with the function
> InitializeContext(). It also requires an additional call to
> SetXStateFeaturesMask() before being able to call GetThreadContext().
> None of that is implemanted in Cygwin.
>
> The affected scenarios are:
>
> - sigdelayed, the function handling delayed signals, does not handle
> AVX registers, This potentially affects almost all system calls.
>
> - setjmp/longjmp
>
> - Saving and restoring thread contexts during signal handling or
> in the setcontext/getcontext/swapcontext/makecontext calls
> use the CONTEXT_FULL flag which omits AVX registers.
>
> - The mcontext_t structure has no provisions to hold AVX registers
> so they are not available in SA_SIGINFO signal handlers.
>
> The problem with all of that is that the exposed structures are fixed
> sized and have no room for extension without breaking the ABI.
>
> So adding AVX register support is quite some work, especially in the
> assembler code in the gendef script. For that, I'd need help.
> Fortunately there are not so many calls exposing contexts, only the
> aforemetioned ones.
>
> I hope this affects 64 bit only?
Btw., for the time being it might be prudent to disable AVX in gmp...
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20151127/fd445bd3/attachment.sig>
More information about the Cygwin-apps
mailing list