[llvm] r359306 - [x86] add tests for fmin/fmax; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 26 06:36:37 PDT 2019
Author: spatel
Date: Fri Apr 26 06:36:37 2019
New Revision: 359306
URL: http://llvm.org/viewvc/llvm-project?rev=359306&view=rev
Log:
[x86] add tests for fmin/fmax; NFC
'maximum' and 'minimum' still crash, so they are commented out.
Modified:
llvm/trunk/test/CodeGen/X86/extract-fp.ll
Modified: llvm/trunk/test/CodeGen/X86/extract-fp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/extract-fp.ll?rev=359306&r1=359305&r2=359306&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/extract-fp.ll (original)
+++ llvm/trunk/test/CodeGen/X86/extract-fp.ll Fri Apr 26 06:36:37 2019
@@ -83,3 +83,52 @@ define float @ext_frem_v4f32_constant_op
ret float %ext
}
+define float @ext_maxnum_v4f32(<4 x float> %x) nounwind {
+; CHECK-LABEL: ext_maxnum_v4f32:
+; CHECK: # %bb.0:
+; CHECK-NEXT: movaps {{.*#+}} xmm1 = [0.0E+0,1.0E+0,2.0E+0,3.0E+0]
+; CHECK-NEXT: movaps %xmm1, %xmm2
+; CHECK-NEXT: maxps %xmm0, %xmm2
+; CHECK-NEXT: cmpunordps %xmm0, %xmm0
+; CHECK-NEXT: andps %xmm0, %xmm1
+; CHECK-NEXT: andnps %xmm2, %xmm0
+; CHECK-NEXT: orps %xmm1, %xmm0
+; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,2,3]
+; CHECK-NEXT: retq
+ %v = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %x, <4 x float> <float 0.0, float 1.0, float 2.0, float 3.0>)
+ %r = extractelement <4 x float> %v, i32 2
+ ret float %r
+}
+
+define double @ext_minnum_v2f64(<2 x double> %x) nounwind {
+; CHECK-LABEL: ext_minnum_v2f64:
+; CHECK: # %bb.0:
+; CHECK-NEXT: xorpd %xmm1, %xmm1
+; CHECK-NEXT: movhpd {{.*#+}} xmm1 = xmm1[0],mem[0]
+; CHECK-NEXT: movapd %xmm1, %xmm2
+; CHECK-NEXT: minpd %xmm0, %xmm1
+; CHECK-NEXT: cmpunordpd %xmm0, %xmm0
+; CHECK-NEXT: andpd %xmm0, %xmm2
+; CHECK-NEXT: andnpd %xmm1, %xmm0
+; CHECK-NEXT: orpd %xmm2, %xmm0
+; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,2,3]
+; CHECK-NEXT: retq
+ %v = call <2 x double> @llvm.minnum.v2f64(<2 x double> <double 0.0, double 1.0>, <2 x double> %x)
+ %r = extractelement <2 x double> %v, i32 1
+ ret double %r
+}
+
+;define double @ext_maximum_v4f64(<2 x double> %x) nounwind {
+; %v = call <2 x double> @llvm.maximum.v2f64(<2 x double> %x, <2 x double> <double 42.0, double 43.0>)
+; %r = extractelement <2 x double> %v, i32 1
+; ret double %r
+;}
+
+;define float @ext_minimum_v4f32(<4 x float> %x) nounwind {
+; %v = call <4 x float> @llvm.minimum.v4f32(<4 x float> %x, <4 x float> <float 0.0, float 1.0, float 2.0, float 42.0>)
+; %r = extractelement <4 x float> %v, i32 1
+; ret float %r
+;}
+
+declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>)
+declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)
More information about the llvm-commits
mailing list