Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GCC assembly bug in AVX-512 instructions on Cygwin #16290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
embray opened this issue May 18, 2020 · 1 comment
Closed

GCC assembly bug in AVX-512 instructions on Cygwin #16290

embray opened this issue May 18, 2020 · 1 comment

Comments

@embray
Copy link
Contributor

embray commented May 18, 2020

I encountered this issue at build time while testing #16246 on a Haswell-based CPU supporting AVX2.

This is due to a confirmed bug in GCC that is fixed since GCC 8.4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782

One suggested workaround on Stack Overflow was to pass a number of -ffixed-<reg> flags to prevent GCC from producing code using the unsupported registers:

-ffixed-xmm16 -ffixed-xmm17 -ffixed-xmm18 -ffixed-xmm19
-ffixed-xmm20 -ffixed-xmm21 -ffixed-xmm22 -ffixed-xmm23
-ffixed-xmm24 -ffixed-xmm25 -ffixed-xmm26 -ffixed-xmm27
-ffixed-xmm28 -ffixed-xmm29 -ffixed-xmm30 -ffixed-xmm31

I found that this workaround worked for me. So a possible workaround in Numpy would be to automatically add these flags to CFLAGS, at least on Cygwin and GCC < 8.4 (does Numpy's build system have an existing routine to check the compiler version?)

Error message:

numpy/core/src/umath/loops.c.src:3058:1: warning: AVX512F vector return without AVX512F enabled changes the ABI [-Wpsabi]
 }
 ^
numpy/core/src/umath/loops.c.src:3058:1: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
{standard input}: Assembler messages:
{standard input}:9023: Error: invalid register for .seh_savexmm
{standard input}:9025: Error: invalid register for .seh_savexmm
{standard input}:9027: Error: invalid register for .seh_savexmm
... several more similar lines ...

Numpy/Python version information:

1.20.0.dev0+7f7d19d 3.6.8 (default, Feb 14 2019, 22:09:48)
[GCC 7.4.0]
@embray
Copy link
Contributor Author

embray commented Jun 17, 2020

It appears this is a duplicate of #14787.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant