Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -march=x86-64 | FileCheck %s
      2 
      3 ; Convert oeq and une to ole/oge/ule/uge when comparing with infinity
      4 ; and negative infinity, because those are more efficient on x86.
      5 
      6 ; CHECK: oeq_inff:
      7 ; CHECK: ucomiss
      8 ; CHECK: jb
      9 define float @oeq_inff(float %x, float %y) nounwind readonly {
     10   %t0 = fcmp oeq float %x, 0x7FF0000000000000
     11   %t1 = select i1 %t0, float 1.0, float %y
     12   ret float %t1
     13 }
     14 
     15 ; CHECK: oeq_inf:
     16 ; CHECK: ucomisd
     17 ; CHECK: jb
     18 define double @oeq_inf(double %x, double %y) nounwind readonly {
     19   %t0 = fcmp oeq double %x, 0x7FF0000000000000
     20   %t1 = select i1 %t0, double 1.0, double %y
     21   ret double %t1
     22 }
     23 
     24 ; CHECK: une_inff:
     25 ; CHECK: ucomiss
     26 ; CHECK: jae
     27 define float @une_inff(float %x, float %y) nounwind readonly {
     28   %t0 = fcmp une float %x, 0x7FF0000000000000
     29   %t1 = select i1 %t0, float 1.0, float %y
     30   ret float %t1
     31 }
     32 
     33 ; CHECK: une_inf:
     34 ; CHECK: ucomisd
     35 ; CHECK: jae
     36 define double @une_inf(double %x, double %y) nounwind readonly {
     37   %t0 = fcmp une double %x, 0x7FF0000000000000
     38   %t1 = select i1 %t0, double 1.0, double %y
     39   ret double %t1
     40 }
     41 
     42 ; CHECK: oeq_neg_inff:
     43 ; CHECK: ucomiss
     44 ; CHECK: jb
     45 define float @oeq_neg_inff(float %x, float %y) nounwind readonly {
     46   %t0 = fcmp oeq float %x, 0xFFF0000000000000
     47   %t1 = select i1 %t0, float 1.0, float %y
     48   ret float %t1
     49 }
     50 
     51 ; CHECK: oeq_neg_inf:
     52 ; CHECK: ucomisd
     53 ; CHECK: jb
     54 define double @oeq_neg_inf(double %x, double %y) nounwind readonly {
     55   %t0 = fcmp oeq double %x, 0xFFF0000000000000
     56   %t1 = select i1 %t0, double 1.0, double %y
     57   ret double %t1
     58 }
     59 
     60 ; CHECK: une_neg_inff:
     61 ; CHECK: ucomiss
     62 ; CHECK: jae
     63 define float @une_neg_inff(float %x, float %y) nounwind readonly {
     64   %t0 = fcmp une float %x, 0xFFF0000000000000
     65   %t1 = select i1 %t0, float 1.0, float %y
     66   ret float %t1
     67 }
     68 
     69 ; CHECK: une_neg_inf:
     70 ; CHECK: ucomisd
     71 ; CHECK: jae
     72 define double @une_neg_inf(double %x, double %y) nounwind readonly {
     73   %t0 = fcmp une double %x, 0xFFF0000000000000
     74   %t1 = select i1 %t0, double 1.0, double %y
     75   ret double %t1
     76 }
     77