2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc < %s -mtriple=i686-- -mattr=+mmx | FileCheck %s
|
|
|
|
; RUN: llc < %s -mtriple=i686-- -mattr=+mmx,-sse | FileCheck %s
|
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.
llvm-svn: 249731
2015-10-09 04:10:06 +08:00
|
|
|
|
|
|
|
; Test that turning off sse doesn't turn off mmx.
|
|
|
|
|
|
|
|
declare x86_mmx @llvm.x86.mmx.pcmpgt.d(x86_mmx, x86_mmx) nounwind readnone
|
|
|
|
|
|
|
|
define i64 @test88(<1 x i64> %a, <1 x i64> %b) nounwind readnone {
|
|
|
|
; CHECK-LABEL: @test88
|
|
|
|
; CHECK: pcmpgtd
|
|
|
|
entry:
|
|
|
|
%0 = bitcast <1 x i64> %b to <2 x i32>
|
|
|
|
%1 = bitcast <1 x i64> %a to <2 x i32>
|
|
|
|
%mmx_var.i = bitcast <2 x i32> %1 to x86_mmx
|
|
|
|
%mmx_var1.i = bitcast <2 x i32> %0 to x86_mmx
|
|
|
|
%2 = tail call x86_mmx @llvm.x86.mmx.pcmpgt.d(x86_mmx %mmx_var.i, x86_mmx %mmx_var1.i) nounwind
|
|
|
|
%3 = bitcast x86_mmx %2 to <2 x i32>
|
|
|
|
%4 = bitcast <2 x i32> %3 to <1 x i64>
|
|
|
|
%5 = extractelement <1 x i64> %4, i32 0
|
|
|
|
ret i64 %5
|
|
|
|
}
|