; RUN: llc < %s -mtriple=arm64-eabi | FileCheck %sdefinedouble@test_direct(float%in){; CHECK-LABEL: test_direct:%cmp=fcmpoltfloat%in,0.000000e+00%val=selecti1%cmp,float0.000000e+00,float%in%longer=fpextfloat%valtodoubleretdouble%longer; CHECK: fmax s}definedouble@test_cross(float%in){; CHECK-LABEL: test_cross:%cmp=fcmpultfloat%in,0.000000e+00%val=selecti1%cmp,float%in,float0.000000e+00%longer=fpextfloat%valtodoubleretdouble%longer; CHECK: fmin s}; Same as previous, but with ordered comparison;; must become fminnm, not fmin.definedouble@test_cross_fail_nan(float%in){; CHECK-LABEL: test_cross_fail_nan:%cmp=fcmpoltfloat%in,0.000000e+00%val=selecti1%cmp,float%in,float0.000000e+00%longer=fpextfloat%valtodoubleretdouble%longer; CHECK: fminnm s}; This isn't a min or a max, but passes the first condition for swapping the; results. Make sure they're put back before we resort to the normal fcsel.definefloat@test_cross_fail(float%lhs,float%rhs){; CHECK-LABEL: test_cross_fail:%tst=fcmpunefloat%lhs,%rhs%res=selecti1%tst,float%rhs,float%lhsretfloat%res; The register allocator would have to decide to be deliberately obtuse before; other register were used.; CHECK: fcsel s0, s1, s0, ne}; Make sure the transformation isn't triggered for integersdefinei64@test_integer(i64%in){%cmp=icmpslti64%in,0%val=selecti1%cmp,i640,i64%inreti64%val}