Skip to content

Commit cb79be8

Browse files
committed
Add test for fmin
1 parent 3a46d8c commit cb79be8

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

llvm/test/CodeGen/X86/vec-strict-cmp-128.ll

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6134,6 +6134,55 @@ define <2 x float> @test_v2f32_ogt2_s(<2 x float> %a, <2 x float> %b) #0 {
61346134
ret <2 x float> %res
61356135
}
61366136

6137+
define <2 x float> @test_v2f32_ule2_s(<2 x float> %a, <2 x float> %b) #0 {
6138+
; SSE-32-LABEL: test_v2f32_ule2_s:
6139+
; SSE-32: # %bb.0:
6140+
; SSE-32-NEXT: minps %xmm0, %xmm1
6141+
; SSE-32-NEXT: movaps %xmm1, %xmm0
6142+
; SSE-32-NEXT: retl
6143+
;
6144+
; SSE-64-LABEL: test_v2f32_ule2_s:
6145+
; SSE-64: # %bb.0:
6146+
; SSE-64-NEXT: minps %xmm0, %xmm1
6147+
; SSE-64-NEXT: movaps %xmm1, %xmm0
6148+
; SSE-64-NEXT: retq
6149+
;
6150+
; AVX-32-LABEL: test_v2f32_ule2_s:
6151+
; AVX-32: # %bb.0:
6152+
; AVX-32-NEXT: vminps %xmm0, %xmm1, %xmm0
6153+
; AVX-32-NEXT: retl
6154+
;
6155+
; AVX-64-LABEL: test_v2f32_ule2_s:
6156+
; AVX-64: # %bb.0:
6157+
; AVX-64-NEXT: vminps %xmm0, %xmm1, %xmm0
6158+
; AVX-64-NEXT: retq
6159+
;
6160+
; AVX512-32-LABEL: test_v2f32_ule2_s:
6161+
; AVX512-32: # %bb.0:
6162+
; AVX512-32-NEXT: vminps %xmm0, %xmm1, %xmm0
6163+
; AVX512-32-NEXT: retl
6164+
;
6165+
; AVX512-64-LABEL: test_v2f32_ule2_s:
6166+
; AVX512-64: # %bb.0:
6167+
; AVX512-64-NEXT: vminps %xmm0, %xmm1, %xmm0
6168+
; AVX512-64-NEXT: retq
6169+
;
6170+
; AVX512F-32-LABEL: test_v2f32_ule2_s:
6171+
; AVX512F-32: # %bb.0:
6172+
; AVX512F-32-NEXT: vminps %xmm0, %xmm1, %xmm0
6173+
; AVX512F-32-NEXT: retl
6174+
;
6175+
; AVX512F-64-LABEL: test_v2f32_ule2_s:
6176+
; AVX512F-64: # %bb.0:
6177+
; AVX512F-64-NEXT: vminps %xmm0, %xmm1, %xmm0
6178+
; AVX512F-64-NEXT: retq
6179+
%cond = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f32(
6180+
<2 x float> %a, <2 x float> %b, metadata !"ule",
6181+
metadata !"fpexcept.strict")
6182+
%res = select <2 x i1> %cond, <2 x float> %a, <2 x float> %b
6183+
ret <2 x float> %res
6184+
}
6185+
61376186
attributes #0 = { strictfp nounwind }
61386187

61396188
declare <4 x i1> @llvm.experimental.constrained.fcmp.v4f32(<4 x float>, <4 x float>, metadata, metadata)

0 commit comments

Comments
 (0)