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 declare void @f() nounwind
      7 
      8 ; CHECK-LABEL: oeq_inff:
      9 ; CHECK: ucomiss
     10 ; CHECK: jb
     11 define void @oeq_inff(float %x) nounwind {
     12   %t0 = fcmp oeq float %x, 0x7FF0000000000000
     13   br i1 %t0, label %true, label %false
     14 
     15 true:
     16   call void @f() nounwind
     17   br label %false
     18 
     19 false:
     20   ret void
     21 }
     22 
     23 ; CHECK-LABEL: oeq_inf:
     24 ; CHECK: ucomisd
     25 ; CHECK: jb
     26 define void @oeq_inf(double %x) nounwind {
     27   %t0 = fcmp oeq double %x, 0x7FF0000000000000
     28   br i1 %t0, label %true, label %false
     29 
     30 true:
     31   call void @f() nounwind
     32   br label %false
     33 
     34 false:
     35   ret void
     36 }
     37 
     38 ; CHECK-LABEL: une_inff:
     39 ; CHECK: ucomiss
     40 ; CHECK: jae
     41 define void @une_inff(float %x) nounwind {
     42   %t0 = fcmp une float %x, 0x7FF0000000000000
     43   br i1 %t0, label %true, label %false
     44 
     45 true:
     46   call void @f() nounwind
     47   br label %false
     48 
     49 false:
     50   ret void
     51 }
     52 
     53 ; CHECK-LABEL: une_inf:
     54 ; CHECK: ucomisd
     55 ; CHECK: jae
     56 define void @une_inf(double %x) nounwind {
     57   %t0 = fcmp une double %x, 0x7FF0000000000000
     58   br i1 %t0, label %true, label %false
     59 
     60 true:
     61   call void @f() nounwind
     62   br label %false
     63 
     64 false:
     65   ret void
     66 }
     67 
     68 ; CHECK-LABEL: oeq_neg_inff:
     69 ; CHECK: ucomiss
     70 ; CHECK: jb
     71 define void @oeq_neg_inff(float %x) nounwind {
     72   %t0 = fcmp oeq float %x, 0xFFF0000000000000
     73   br i1 %t0, label %true, label %false
     74 
     75 true:
     76   call void @f() nounwind
     77   br label %false
     78 
     79 false:
     80   ret void
     81 }
     82 
     83 ; CHECK-LABEL: oeq_neg_inf:
     84 ; CHECK: ucomisd
     85 ; CHECK: jb
     86 define void @oeq_neg_inf(double %x) nounwind {
     87   %t0 = fcmp oeq double %x, 0xFFF0000000000000
     88   br i1 %t0, label %true, label %false
     89 
     90 true:
     91   call void @f() nounwind
     92   br label %false
     93 
     94 false:
     95   ret void
     96 }
     97 
     98 ; CHECK-LABEL: une_neg_inff:
     99 ; CHECK: ucomiss
    100 ; CHECK: jae
    101 define void @une_neg_inff(float %x) nounwind {
    102   %t0 = fcmp une float %x, 0xFFF0000000000000
    103   br i1 %t0, label %true, label %false
    104 
    105 true:
    106   call void @f() nounwind
    107   br label %false
    108 
    109 false:
    110   ret void
    111 }
    112 
    113 ; CHECK-LABEL: une_neg_inf:
    114 ; CHECK: ucomisd
    115 ; CHECK: jae
    116 define void @une_neg_inf(double %x) nounwind {
    117   %t0 = fcmp une double %x, 0xFFF0000000000000
    118   br i1 %t0, label %true, label %false
    119 
    120 true:
    121   call void @f() nounwind
    122   br label %false
    123 
    124 false:
    125   ret void
    126 }
    127