Move the MMX subtarget feature out of the SSE set of features and into
authorEric Christopher <echristo@gmail.com>
Thu, 8 Oct 2015 20:10:06 +0000 (20:10 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 8 Oct 2015 20:10:06 +0000 (20:10 +0000)
commit47f0e3f434e2e43f951c3a826c40906cb15b7285
tree53e26da6e016db3b99f0d88996d4f157859274ea
parent3bc8dc3685a10faff5e419e4c8a4f8392030fd59
Move the MMX subtarget feature out of the SSE set of features and into
its own variable.

This is needed so that we can explicitly turn off MMX without turning
off SSE and also so that we can diagnose feature set incompatibilities
that involve MMX without SSE.

Rationale:

// sse3
__m128d test_mm_addsub_pd(__m128d A, __m128d B) {
  return _mm_addsub_pd(A, B);
}

// mmx
void shift(__m64 a, __m64 b, int c) {
  _mm_slli_pi16(a, c);
  _mm_slli_pi32(a, c);
  _mm_slli_si64(a, c);
  _mm_srli_pi16(a, c);
  _mm_srli_pi32(a, c);
  _mm_srli_si64(a, c);
  _mm_srai_pi16(a, c);
  _mm_srai_pi32(a, c);
}

clang -msse3 -mno-mmx file.c -c

For this code we should be able to explicitly turn off MMX
without affecting the compilation of the SSE3 function and then
diagnose and error on compiling the MMX function.

This matches the existing gcc behavior and follows the spirit of
the SSE/MMX separation in llvm where we can (and do) turn off
MMX code generation except in the presence of intrinsics.

Updated a couple of tests, but primarily tested with a couple of tests
for turning on only mmx and only sse.

This is paired with a patch to clang to take advantage of this behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249731 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86.td
lib/Target/X86/X86Subtarget.cpp
lib/Target/X86/X86Subtarget.h
test/CodeGen/X86/mmx-intrinsics.ll
test/CodeGen/X86/mmx-only.ll [new file with mode: 0644]
test/CodeGen/X86/mult-alt-x86.ll
test/CodeGen/X86/sse-only.ll [new file with mode: 0644]