Skip to content

Commit b97bc56

Browse files
committed
[X86] Add MMX nontemporal store DAG test
As noticed on llvm#98505 - we had fast-isel test but not SDAG
1 parent ec56790 commit b97bc56

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

llvm/test/CodeGen/X86/nontemporal.ll

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86-SSE
3-
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=X86-AVX
4-
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64-SSE
5-
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=X64-AVX
2+
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+mmx,+sse2 | FileCheck %s --check-prefixes=X86,X86-SSE
3+
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+mmx,+avx | FileCheck %s --check-prefixes=X86,X86-AVX
4+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+mmx,+sse2 | FileCheck %s --check-prefixes=X64,X64-SSE
5+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+mmx,+avx | FileCheck %s --check-prefixes=X64,X64-AVX
66

77
define i32 @f(<4 x float> %A, ptr %B, <2 x double> %C, i32 %D, <2 x i64> %E, <4 x i32> %F, <8 x i16> %G, <16 x i8> %H, i64 %I, ptr %loadptr) nounwind {
88
; X86-SSE-LABEL: f:
@@ -176,4 +176,28 @@ define i32 @f(<4 x float> %A, ptr %B, <2 x double> %C, i32 %D, <2 x i64> %E, <4
176176
ret i32 %sum8
177177
}
178178

179+
define void @test_mmx(ptr nocapture %a0, ptr nocapture %a1) {
180+
; X86-LABEL: test_mmx:
181+
; X86: # %bb.0: # %entry
182+
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
183+
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
184+
; X86-NEXT: movq (%ecx), %mm0
185+
; X86-NEXT: psrlq $3, %mm0
186+
; X86-NEXT: movq %mm0, (%eax)
187+
; X86-NEXT: retl
188+
;
189+
; X64-LABEL: test_mmx:
190+
; X64: # %bb.0: # %entry
191+
; X64-NEXT: movq (%rdi), %mm0
192+
; X64-NEXT: psrlq $3, %mm0
193+
; X64-NEXT: movq %mm0, (%rsi)
194+
; X64-NEXT: retq
195+
entry:
196+
%0 = load x86_mmx, ptr %a0
197+
%1 = call x86_mmx @llvm.x86.mmx.psrli.q(x86_mmx %0, i32 3)
198+
store x86_mmx %1, ptr %a1, align 8, !nontemporal !0
199+
ret void
200+
}
201+
declare x86_mmx @llvm.x86.mmx.psrli.q(x86_mmx, i32) nounwind readnone
202+
179203
!0 = !{i32 1}

0 commit comments

Comments
 (0)