Michael Ilseman | a52f3ae | 2012-11-27 00:45:08 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as < %s | llvm-dis | FileCheck %s |
| 2 | ; RUN: opt -S < %s | FileCheck %s |
| 3 | |
| 4 | @addr = external global i64 |
| 5 | @select = external global i1 |
| 6 | @vec = external global <3 x float> |
| 7 | @arr = external global [3 x float] |
| 8 | |
| 9 | define float @none(float %x, float %y) { |
| 10 | entry: |
| 11 | ; CHECK: %vec = load <3 x float>* @vec |
| 12 | %vec = load <3 x float>* @vec |
| 13 | ; CHECK: %select = load i1* @select |
| 14 | %select = load i1* @select |
| 15 | ; CHECK: %arr = load [3 x float]* @arr |
| 16 | %arr = load [3 x float]* @arr |
| 17 | |
| 18 | ; CHECK: %a = fadd float %x, %y |
| 19 | %a = fadd float %x, %y |
| 20 | ; CHECK: %a_vec = fadd <3 x float> %vec, %vec |
| 21 | %a_vec = fadd <3 x float> %vec, %vec |
| 22 | ; CHECK: %b = fsub float %x, %y |
| 23 | %b = fsub float %x, %y |
| 24 | ; CHECK: %b_vec = fsub <3 x float> %vec, %vec |
| 25 | %b_vec = fsub <3 x float> %vec, %vec |
| 26 | ; CHECK: %c = fmul float %x, %y |
| 27 | %c = fmul float %x, %y |
| 28 | ; CHECK: %c_vec = fmul <3 x float> %vec, %vec |
| 29 | %c_vec = fmul <3 x float> %vec, %vec |
| 30 | ; CHECK: %d = fdiv float %x, %y |
| 31 | %d = fdiv float %x, %y |
| 32 | ; CHECK: %d_vec = fdiv <3 x float> %vec, %vec |
| 33 | %d_vec = fdiv <3 x float> %vec, %vec |
| 34 | ; CHECK: %e = frem float %x, %y |
| 35 | %e = frem float %x, %y |
| 36 | ; CHECK: %e_vec = frem <3 x float> %vec, %vec |
| 37 | %e_vec = frem <3 x float> %vec, %vec |
| 38 | ; CHECK: ret float %e |
| 39 | ret float %e |
| 40 | } |
| 41 | |
| 42 | ; CHECK: no_nan |
| 43 | define float @no_nan(float %x, float %y) { |
| 44 | entry: |
| 45 | ; CHECK: %vec = load <3 x float>* @vec |
| 46 | %vec = load <3 x float>* @vec |
| 47 | ; CHECK: %select = load i1* @select |
| 48 | %select = load i1* @select |
| 49 | ; CHECK: %arr = load [3 x float]* @arr |
| 50 | %arr = load [3 x float]* @arr |
| 51 | |
| 52 | ; CHECK: %a = fadd nnan float %x, %y |
| 53 | %a = fadd nnan float %x, %y |
| 54 | ; CHECK: %a_vec = fadd nnan <3 x float> %vec, %vec |
| 55 | %a_vec = fadd nnan <3 x float> %vec, %vec |
| 56 | ; CHECK: %b = fsub nnan float %x, %y |
| 57 | %b = fsub nnan float %x, %y |
| 58 | ; CHECK: %b_vec = fsub nnan <3 x float> %vec, %vec |
| 59 | %b_vec = fsub nnan <3 x float> %vec, %vec |
| 60 | ; CHECK: %c = fmul nnan float %x, %y |
| 61 | %c = fmul nnan float %x, %y |
| 62 | ; CHECK: %c_vec = fmul nnan <3 x float> %vec, %vec |
| 63 | %c_vec = fmul nnan <3 x float> %vec, %vec |
| 64 | ; CHECK: %d = fdiv nnan float %x, %y |
| 65 | %d = fdiv nnan float %x, %y |
| 66 | ; CHECK: %d_vec = fdiv nnan <3 x float> %vec, %vec |
| 67 | %d_vec = fdiv nnan <3 x float> %vec, %vec |
| 68 | ; CHECK: %e = frem nnan float %x, %y |
| 69 | %e = frem nnan float %x, %y |
| 70 | ; CHECK: %e_vec = frem nnan <3 x float> %vec, %vec |
| 71 | %e_vec = frem nnan <3 x float> %vec, %vec |
| 72 | ; CHECK: ret float %e |
| 73 | ret float %e |
| 74 | } |
| 75 | |
| 76 | ; CHECK: no_nan_inf |
| 77 | define float @no_nan_inf(float %x, float %y) { |
| 78 | entry: |
| 79 | ; CHECK: %vec = load <3 x float>* @vec |
| 80 | %vec = load <3 x float>* @vec |
| 81 | ; CHECK: %select = load i1* @select |
| 82 | %select = load i1* @select |
| 83 | ; CHECK: %arr = load [3 x float]* @arr |
| 84 | %arr = load [3 x float]* @arr |
| 85 | |
| 86 | ; CHECK: %a = fadd nnan ninf float %x, %y |
| 87 | %a = fadd ninf nnan float %x, %y |
| 88 | ; CHECK: %a_vec = fadd nnan <3 x float> %vec, %vec |
| 89 | %a_vec = fadd nnan <3 x float> %vec, %vec |
| 90 | ; CHECK: %b = fsub nnan float %x, %y |
| 91 | %b = fsub nnan float %x, %y |
| 92 | ; CHECK: %b_vec = fsub nnan ninf <3 x float> %vec, %vec |
| 93 | %b_vec = fsub ninf nnan <3 x float> %vec, %vec |
| 94 | ; CHECK: %c = fmul nnan float %x, %y |
| 95 | %c = fmul nnan float %x, %y |
| 96 | ; CHECK: %c_vec = fmul nnan <3 x float> %vec, %vec |
| 97 | %c_vec = fmul nnan <3 x float> %vec, %vec |
| 98 | ; CHECK: %d = fdiv nnan ninf float %x, %y |
| 99 | %d = fdiv ninf nnan float %x, %y |
| 100 | ; CHECK: %d_vec = fdiv nnan <3 x float> %vec, %vec |
| 101 | %d_vec = fdiv nnan <3 x float> %vec, %vec |
| 102 | ; CHECK: %e = frem nnan float %x, %y |
| 103 | %e = frem nnan float %x, %y |
| 104 | ; CHECK: %e_vec = frem nnan ninf <3 x float> %vec, %vec |
| 105 | %e_vec = frem ninf nnan <3 x float> %vec, %vec |
| 106 | ; CHECK: ret float %e |
| 107 | ret float %e |
| 108 | } |
| 109 | |
| 110 | ; CHECK: mixed_flags |
| 111 | define float @mixed_flags(float %x, float %y) { |
| 112 | entry: |
| 113 | ; CHECK: %vec = load <3 x float>* @vec |
| 114 | %vec = load <3 x float>* @vec |
| 115 | ; CHECK: %select = load i1* @select |
| 116 | %select = load i1* @select |
| 117 | ; CHECK: %arr = load [3 x float]* @arr |
| 118 | %arr = load [3 x float]* @arr |
| 119 | |
| 120 | ; CHECK: %a = fadd nnan ninf float %x, %y |
| 121 | %a = fadd ninf nnan float %x, %y |
| 122 | ; CHECK: %a_vec = fadd nnan <3 x float> %vec, %vec |
| 123 | %a_vec = fadd nnan <3 x float> %vec, %vec |
| 124 | ; CHECK: %b = fsub fast float %x, %y |
| 125 | %b = fsub nnan nsz fast float %x, %y |
| 126 | ; CHECK: %b_vec = fsub nnan <3 x float> %vec, %vec |
| 127 | %b_vec = fsub nnan <3 x float> %vec, %vec |
| 128 | ; CHECK: %c = fmul fast float %x, %y |
| 129 | %c = fmul nsz fast arcp float %x, %y |
| 130 | ; CHECK: %c_vec = fmul nsz <3 x float> %vec, %vec |
| 131 | %c_vec = fmul nsz <3 x float> %vec, %vec |
| 132 | ; CHECK: %d = fdiv nnan ninf arcp float %x, %y |
| 133 | %d = fdiv arcp ninf nnan float %x, %y |
| 134 | ; CHECK: %d_vec = fdiv fast <3 x float> %vec, %vec |
| 135 | %d_vec = fdiv fast nnan arcp <3 x float> %vec, %vec |
| 136 | ; CHECK: %e = frem nnan nsz float %x, %y |
| 137 | %e = frem nnan nsz float %x, %y |
| 138 | ; CHECK: %e_vec = frem nnan <3 x float> %vec, %vec |
| 139 | %e_vec = frem nnan <3 x float> %vec, %vec |
| 140 | ; CHECK: ret float %e |
| 141 | ret float %e |
| 142 | } |