Skip to content

Commit

Permalink
[X86][SSE] Regenerated partial register update tests
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270430 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
RKSimon committed May 23, 2016
1 parent 67270d4 commit 481edf8
Showing 1 changed file with 46 additions and 38 deletions.
84 changes: 46 additions & 38 deletions test/CodeGen/X86/sse_partial_update.ll
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: llc < %s -mtriple=x86_64-apple-macosx -mattr=+sse2 -mcpu=nehalem | FileCheck %s

; rdar: 12558838
Expand All @@ -8,14 +9,15 @@
; destination of each scalar unary op are the same.

define void @rsqrtss(<4 x float> %a) nounwind uwtable ssp {
entry:
; CHECK-LABEL: rsqrtss:
; CHECK: rsqrtss %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm0
; CHECK-NEXT: movshdup
; CHECK-NEXT: cvtss2sd %xmm0
; CHECK-NEXT: movap
; CHECK-NEXT: jmp
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: rsqrtss %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm0, %xmm2
; CHECK-NEXT: movshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
; CHECK-NEXT: cvtss2sd %xmm0, %xmm1
; CHECK-NEXT: movaps %xmm2, %xmm0
; CHECK-NEXT: jmp _callee ## TAILCALL
entry:

%0 = tail call <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float> %a) nounwind
%a.addr.0.extract = extractelement <4 x float> %0, i32 0
Expand All @@ -29,14 +31,15 @@ declare void @callee(double, double)
declare <4 x float> @llvm.x86.sse.rsqrt.ss(<4 x float>) nounwind readnone

define void @rcpss(<4 x float> %a) nounwind uwtable ssp {
entry:
; CHECK-LABEL: rcpss:
; CHECK: rcpss %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm0
; CHECK-NEXT: movshdup
; CHECK-NEXT: cvtss2sd %xmm0
; CHECK-NEXT: movap
; CHECK-NEXT: jmp
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: rcpss %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm0, %xmm2
; CHECK-NEXT: movshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
; CHECK-NEXT: cvtss2sd %xmm0, %xmm1
; CHECK-NEXT: movaps %xmm2, %xmm0
; CHECK-NEXT: jmp _callee ## TAILCALL
entry:

%0 = tail call <4 x float> @llvm.x86.sse.rcp.ss(<4 x float> %a) nounwind
%a.addr.0.extract = extractelement <4 x float> %0, i32 0
Expand All @@ -49,14 +52,15 @@ entry:
declare <4 x float> @llvm.x86.sse.rcp.ss(<4 x float>) nounwind readnone

define void @sqrtss(<4 x float> %a) nounwind uwtable ssp {
entry:
; CHECK-LABEL: sqrtss:
; CHECK: sqrtss %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm0
; CHECK-NEXT: movshdup
; CHECK-NEXT: cvtss2sd %xmm0
; CHECK-NEXT: movap
; CHECK-NEXT: jmp
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: sqrtss %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm0, %xmm2
; CHECK-NEXT: movshdup {{.*#+}} xmm0 = xmm0[1,1,3,3]
; CHECK-NEXT: cvtss2sd %xmm0, %xmm1
; CHECK-NEXT: movaps %xmm2, %xmm0
; CHECK-NEXT: jmp _callee ## TAILCALL
entry:

%0 = tail call <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float> %a) nounwind
%a.addr.0.extract = extractelement <4 x float> %0, i32 0
Expand All @@ -69,14 +73,15 @@ entry:
declare <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float>) nounwind readnone

define void @sqrtsd(<2 x double> %a) nounwind uwtable ssp {
entry:
; CHECK-LABEL: sqrtsd:
; CHECK: sqrtsd %xmm0, %xmm0
; CHECK-NEXT: cvtsd2ss %xmm0
; CHECK-NEXT: shufpd
; CHECK-NEXT: cvtsd2ss %xmm0
; CHECK-NEXT: movap
; CHECK-NEXT: jmp
; CHECK: ## BB#0: ## %entry
; CHECK-NEXT: sqrtsd %xmm0, %xmm0
; CHECK-NEXT: cvtsd2ss %xmm0, %xmm2
; CHECK-NEXT: shufpd {{.*#+}} xmm0 = xmm0[1,0]
; CHECK-NEXT: cvtsd2ss %xmm0, %xmm1
; CHECK-NEXT: movaps %xmm2, %xmm0
; CHECK-NEXT: jmp _callee2 ## TAILCALL
entry:

%0 = tail call <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double> %a) nounwind
%a0 = extractelement <2 x double> %0, i32 0
Expand All @@ -92,30 +97,33 @@ declare <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double>) nounwind readnone

define <2 x double> @load_fold_cvtss2sd_int(<4 x float> *%a) {
; CHECK-LABEL: load_fold_cvtss2sd_int:
; CHECK: movaps (%rdi), %xmm1
; CHECK-NEXT: xorps %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm1, %xmm0
; CHECK-NEXT: retq
; CHECK: ## BB#0:
; CHECK-NEXT: movaps (%rdi), %xmm1
; CHECK-NEXT: xorps %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd %xmm1, %xmm0
; CHECK-NEXT: retq
%ld = load <4 x float>, <4 x float> *%a
%x = call <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double> <double 0x0, double 0x0>, <4 x float> %ld)
ret <2 x double> %x
}

define <2 x double> @load_fold_cvtss2sd_int_optsize(<4 x float> *%a) optsize {
; CHECK-LABEL: load_fold_cvtss2sd_int_optsize:
; CHECK: xorps %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd (%rdi), %xmm0
; CHECK-NEXT: retq
; CHECK: ## BB#0:
; CHECK-NEXT: xorps %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd (%rdi), %xmm0
; CHECK-NEXT: retq
%ld = load <4 x float>, <4 x float> *%a
%x = call <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double> <double 0x0, double 0x0>, <4 x float> %ld)
ret <2 x double> %x
}

define <2 x double> @load_fold_cvtss2sd_int_minsize(<4 x float> *%a) minsize {
; CHECK-LABEL: load_fold_cvtss2sd_int_minsize:
; CHECK: xorps %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd (%rdi), %xmm0
; CHECK-NEXT: retq
; CHECK: ## BB#0:
; CHECK-NEXT: xorps %xmm0, %xmm0
; CHECK-NEXT: cvtss2sd (%rdi), %xmm0
; CHECK-NEXT: retq
%ld = load <4 x float>, <4 x float> *%a
%x = call <2 x double> @llvm.x86.sse2.cvtss2sd(<2 x double> <double 0x0, double 0x0>, <4 x float> %ld)
ret <2 x double> %x
Expand Down

0 comments on commit 481edf8

Please sign in to comment.