Skip to content
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

Skip the alignment bug workaround for Clang #3050

Closed

Conversation

syzygy1
Copy link
Contributor

@syzygy1 syzygy1 commented Aug 22, 2020

Clang-10.0.0 poses as gcc-4.2:
$ clang++ -E -dM - </dev/null | grep GNUC
#define GNUC_MINOR 2
#define GNUC_PATCHLEVEL 1
#define GNUC_STDC_INLINE 1
#define GNUC 4

This means that Clang is using the workaround for the alignment bug of gcc-8 even though it does not have the bug (as far as I know).

This patch disables the workaround for Clang.
It should speed up AVX2 and AVX512 compiles on Windows (when using Clang).

No functional change.

Clang-10.0.0 poses as gcc-4.2:
$ clang++ -E -dM - </dev/null | grep GNUC

This means that Clang is using the workaround for the alignment bug of gcc-8 even though it does not have the bug (as far as I know).

This patch disables the workaround for Clang.
It should speed up AVX2 and AVX512 compiles on Windows (when using Clang).

No functional change.
@snicolet
Copy link
Member

Do we have a way to know if Clang has the alignment bug?

@syzygy1
Copy link
Contributor Author

syzygy1 commented Aug 22, 2020

It would be the nice if someone could test it, but there is no reason to expect an independent compiler to have the same bug as certain version of gcc. That the current workaround applies to clang is entirely unintentional.

@syzygy1
Copy link
Contributor Author

syzygy1 commented Aug 22, 2020

icc 19.1.1 poses as gcc 10.2 (and is probably anyway hardly used), so there seems to be less need to add && !defined(__ICC)

@snicolet snicolet added the to be merged Will be merged shortly label Aug 23, 2020
@snicolet snicolet closed this in cc9d503 Aug 23, 2020
@snicolet
Copy link
Member

Merged via cc9d503, thanks :-)

lucabrivio pushed a commit to lucabrivio/Stockfish that referenced this pull request Aug 24, 2020
Clang-10.0.0 poses as gcc-4.2:

$ clang++ -E -dM - </dev/null | grep GNUC

This means that Clang is using the workaround for the alignment bug of gcc-8
even though it does not have the bug (as far as I know).

This patch should speed up AVX2 and AVX512 compiles on Windows (when using Clang),
because it disables (for Clang) the gcc workaround we had introduced in this commit:
official-stockfish/Stockfish@875183b

closes official-stockfish/Stockfish#3050

No functional change.
joergoster pushed a commit to joergoster/Stockfish-old that referenced this pull request Aug 24, 2020
Clang-10.0.0 poses as gcc-4.2:

$ clang++ -E -dM - </dev/null | grep GNUC

This means that Clang is using the workaround for the alignment bug of gcc-8
even though it does not have the bug (as far as I know).

This patch should speed up AVX2 and AVX512 compiles on Windows (when using Clang),
because it disables (for Clang) the gcc workaround we had introduced in this commit:
official-stockfish/Stockfish@875183b

closes official-stockfish/Stockfish#3050

No functional change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be merged Will be merged shortly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants