[PATCH] D51228: [X86] Add FeatureCMOV explicitly to all CPUs that support it. Remove FeatureCMOV implication from Feature64Bit and FeatureSSE1

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 11:50:38 PDT 2018


craig.topper created this revision.
craig.topper added reviewers: RKSimon, DavidKreitzer, spatel.
Herald added a subscriber: jfb.

Previously most CPUs inherited cmov support through Feature64Bit(or FeatureCMPXCHG16HB implying Feature64Bit) or FeatureSSE1.

This has the surprising side effect that -mattr=-cmov causes an assert to fire in 64-bit mode because it clears the Feature64Bit. Or in 32-bit mode, -mattr=-cmov disables any sse/avx features which seems surprising.

This patch removes the implication and instead updates hasCMOV in X86Subtarget to check SSE1 or is64Bit in addition to the regular cmov flag. This should keep most things working the way they did before. I don't believe there is a way to specific "-cmov" directly from clang so this should only effect our lower level tools.

This does stop -mattr=cx16(cmpxchg16b) from implying cmov is enabled via the 64bit flag as you can see from one of the changed tests. But that was a 32-bit test so I don't know why it enabled cx16 anyway.

For the other test I had to add -sse to override the new sse check in hasCMOV.


https://reviews.llvm.org/D51228

Files:
  lib/Target/X86/X86.td
  lib/Target/X86/X86Subtarget.h
  test/CodeGen/X86/atomic-minmax-i6432.ll
  test/CodeGen/X86/atomic32.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51228.162435.patch
Type: text/x-patch
Size: 10232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180824/aef14c5f/attachment.bin>


More information about the llvm-commits mailing list