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

[asm] Share portability macros and restrict ASM further #2893

Merged
merged 1 commit into from
Dec 3, 2021

Conversation

terrelln
Copy link
Contributor

@terrelln terrelln commented Dec 1, 2021

Move portability macros to lib/common/portability_macros.h. This file
only contains platform/feature detection (e.g. 0/1 macros). This file is
shared between C and ASM code, so it cannot include any C code.

Rename HUF_ ASM macros to be ZSTD_ prefixed, and move to the new
header.

Restrict ZSTD_ASM_SUPPORTED to __GNUC__, because we need the GAS
assembler.

Finally, only include the ASM code if we are actually going to use it.
This disables it on all Windows platforms, which should resolve the
problem brought up in Issue #2789.

@terrelln terrelln changed the title [asm] Only include assembly when enabled [asm] Share portability macros and restrict ASM further Dec 1, 2021
@terrelln terrelln force-pushed the issue-2789 branch 2 times, most recently from 808b40c to 40aa7a8 Compare December 1, 2021 21:23
@terrelln terrelln marked this pull request as ready for review December 1, 2021 21:24
@terrelln terrelln force-pushed the issue-2789 branch 3 times, most recently from cf493af to 537089d Compare December 2, 2021 01:27
@Cyan4973
Copy link
Contributor

Cyan4973 commented Dec 2, 2021

Is there any need to add any CI test to detect issues like #2789 ?

@terrelln
Copy link
Contributor Author

terrelln commented Dec 2, 2021

I'll look into adding a CMake based Windows CI.

I'll put it in a separate PR, with a failing CI. Then rebase this on top of that.

@terrelln terrelln force-pushed the issue-2789 branch 2 times, most recently from 70a5998 to c284569 Compare December 3, 2021 00:52
Move portability macros to `lib/common/portability_macros.h`. This file
only contains platform/feature detection (e.g. 0/1 macros). This file is
shared between C and ASM code, so it cannot include any C code.

Rename `HUF_` ASM macros to be `ZSTD_` prefixed, and move to the new
header.

Restrict `ZSTD_ASM_SUPPORTED` to `__GNUC__`, because we need the GAS
assembler.

Finally, only include the ASM code if we are actually going to use it.
This disables it on all Windows platforms, which should resolve the
problem brought up in Issue facebook#2789.
@terrelln terrelln merged commit 486472c into facebook:dev Dec 3, 2021
terrelln added a commit to terrelln/zstd that referenced this pull request Dec 8, 2021
Disable assembly when dataflow sanitizer is enabled.

This regressed in PR facebook#2893, which accidentally removed the check for
dataflow sanitizer.
@terrelln terrelln mentioned this pull request Dec 8, 2021
terrelln added a commit to terrelln/zstd that referenced this pull request Dec 8, 2021
Disable assembly when dataflow sanitizer is enabled.

This regressed in PR facebook#2893, which accidentally removed the check for
dataflow sanitizer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants