[PATCH] D105462: [X86] Add CRC32 feature.
H.J Lu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 21 10:11:51 PDT 2021
hjl.tools added inline comments.
================
Comment at: clang/lib/Basic/Targets/X86.cpp:159
+ // Enable CRC32 if SSE4.2 is enabled.
+ // NOTE: In conformance with GCC behavior, CRC32 is still available even if
+ // it's explicitly disabled.
----------------
craig.topper wrote:
> hjl.tools wrote:
> > tianqing wrote:
> > > craig.topper wrote:
> > > > This doesn't seem to be true. It causes gcc to crash. https://godbolt.org/z/39rEbsejh
> > > Well I was using GCC 11.1, it compiles.
> > >
> > > The way I see it, crash means a bug (not surprising since it's trunk), and can be interpreted as incompletely defined behavior until it's fixed.
> > >
> > > Some tests on GCC trunk:
> > > 1. -msse4.2: Pass - sse4.2 enables crc32.
> > > 2. -mcrc32 -mno-sse4.2: Pass - no-sse4.2 doesn't disable crc32.
> > > 3. -msse4.2 -mno-sse4.2: Error - no-sse4.2 disables crc32.
> > > 4. -mno-crc32 -msse4.2: Crash - undefined behavior
> > > 5. -msse4.2 -mno-crc32: Crash - undefined behavior
> > >
> > >
> > > It's hard to extract some consistent underlying logic from the GCC results.
> > I posted a patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575741.html
> @hjl.tools does that turn the crash into making -mno-crc32 into making crc32 instruction disabled?
Correct. GCC issues an error now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105462/new/
https://reviews.llvm.org/D105462
More information about the cfe-commits
mailing list