This is an archive of the discontinued LLVM Phabricator instance.

[X86] Check for 64-bit mode in X86Subtarget::hasCmpxchg16b()
ClosedPublic

Authored by craig.topper on Mar 13 2019, 10:22 AM.

Details

Summary

The feature flag alone can't be trusted since it can be passed via -mattr. Need to ensure 64-bit mode as well.

We had a 64 bit mode check on the instruction to make the assembler work correctly. But we weren't guarding any of our lowering code or the hooks for the AtomicExpandPass.

I've added 32-bit command lines to atomic128.ll with and without cx16. The tests there would all previously fail if -mattr=cx16 was passed to them. I had to move one test case for f128 to a new file as it seems to have a different 32-bit mode or possibly sse issue.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Mar 13 2019, 10:22 AM
jfb accepted this revision.Mar 13 2019, 10:34 AM

I think this is fine since it makes something less broken, and is consistent with your other patch on the clang side. Would be neat for someone else to double-check.

This revision is now accepted and ready to land.Mar 13 2019, 10:34 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2019, 11:47 AM