[X86][SSE] Added missing stack folding test for SQRTSD and SQRTSS instructions.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 6 Jul 2015 14:15:02 +0000 (14:15 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 6 Jul 2015 14:15:02 +0000 (14:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241445 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/X86/stack-folding-fp-sse42.ll

index 63acf5f4f96f439fd58797be79aeb67536ba7ed8..1fd8707092d820b7a70d864d521b0ab9ca324c33 100644 (file)
@@ -938,13 +938,25 @@ define <4 x float> @stack_fold_sqrtps(<4 x float> %a0) {
 }
 declare <4 x float> @llvm.x86.sse.sqrt.ps(<4 x float>) nounwind readnone
 
-; TODO stack_fold_sqrtsd
+define double @stack_fold_sqrtsd(double %a0) optsize {
+  ;CHECK-LABEL: stack_fold_sqrtsd
+  ;CHECK:       sqrtsd {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}} {{.*#+}} 8-byte Folded Reload
+  %1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
+  %2 = call double @llvm.sqrt.f64(double %a0)
+  ret double %2
+}
 declare double @llvm.sqrt.f64(double) nounwind readnone
 
 ; TODO stack_fold_sqrtsd_int
 declare <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double>) nounwind readnone
 
-; TODO stack_fold_sqrtss
+define float @stack_fold_sqrtss(float %a0) optsize {
+  ;CHECK-LABEL: stack_fold_sqrtss
+  ;CHECK:       sqrtss {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
+  %1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
+  %2 = call float @llvm.sqrt.f32(float %a0)
+  ret float %2
+}
 declare float @llvm.sqrt.f32(float) nounwind readnone
 
 ; TODO stack_fold_sqrtss_int