|
3 | 3 |
|
4 | 4 | target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" |
5 | 5 |
|
6 | | -define void @ldexp_f32i32(ptr %x, ptr %y, i32 %exp, i32 %n) { |
| 6 | +define void @ldexp_f32i32(ptr %x, ptr %y, i32 %exp) { |
7 | 7 | ; CHECK-LABEL: @ldexp_f32i32( |
8 | 8 | ; CHECK-NEXT: entry: |
9 | 9 | ; CHECK-NEXT: [[L0:%.*]] = load float, ptr [[X:%.*]], align 4 |
|
48 | 48 | ret void |
49 | 49 | } |
50 | 50 |
|
51 | | -define void @ldexp_f64i32(ptr %x, ptr %y, i32 %exp, i32 %n) { |
| 51 | +define void @ldexp_f64i32(ptr %x, ptr %y, i32 %exp) { |
52 | 52 | ; CHECK-LABEL: @ldexp_f64i32( |
53 | 53 | ; CHECK-NEXT: entry: |
54 | 54 | ; CHECK-NEXT: [[L0:%.*]] = load double, ptr [[X:%.*]], align 4 |
@@ -93,5 +93,187 @@ entry: |
93 | 93 | ret void |
94 | 94 | } |
95 | 95 |
|
| 96 | +define void @ldexp_f32i64(ptr %x, ptr %y, i64 %exp) { |
| 97 | +; CHECK-LABEL: @ldexp_f32i64( |
| 98 | +; CHECK-NEXT: entry: |
| 99 | +; CHECK-NEXT: [[L0:%.*]] = load float, ptr [[X:%.*]], align 4 |
| 100 | +; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds float, ptr [[X]], i64 1 |
| 101 | +; CHECK-NEXT: [[L2:%.*]] = load float, ptr [[ARRAYIDX_1]], align 4 |
| 102 | +; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds float, ptr [[X]], i64 2 |
| 103 | +; CHECK-NEXT: [[L4:%.*]] = load float, ptr [[ARRAYIDX_2]], align 4 |
| 104 | +; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds float, ptr [[X]], i64 3 |
| 105 | +; CHECK-NEXT: [[L6:%.*]] = load float, ptr [[ARRAYIDX_3]], align 4 |
| 106 | +; CHECK-NEXT: [[L1:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L0]], i64 [[EXP:%.*]]) |
| 107 | +; CHECK-NEXT: [[L3:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L2]], i64 [[EXP]]) |
| 108 | +; CHECK-NEXT: [[L5:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L4]], i64 [[EXP]]) |
| 109 | +; CHECK-NEXT: [[L7:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L6]], i64 [[EXP]]) |
| 110 | +; CHECK-NEXT: store float [[L1]], ptr [[Y:%.*]], align 4 |
| 111 | +; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 1 |
| 112 | +; CHECK-NEXT: store float [[L3]], ptr [[ARRAYIDX2_1]], align 4 |
| 113 | +; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 2 |
| 114 | +; CHECK-NEXT: store float [[L5]], ptr [[ARRAYIDX2_2]], align 4 |
| 115 | +; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 3 |
| 116 | +; CHECK-NEXT: store float [[L7]], ptr [[ARRAYIDX2_3]], align 4 |
| 117 | +; CHECK-NEXT: ret void |
| 118 | +; |
| 119 | +entry: |
| 120 | + %l0 = load float, ptr %x, align 4 |
| 121 | + %arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1 |
| 122 | + %l2 = load float, ptr %arrayidx.1, align 4 |
| 123 | + %arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2 |
| 124 | + %l4 = load float, ptr %arrayidx.2, align 4 |
| 125 | + %arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3 |
| 126 | + %l6 = load float, ptr %arrayidx.3, align 4 |
| 127 | + %l1 = tail call float @llvm.ldexp.f32.i64(float %l0, i64 %exp) |
| 128 | + %l3 = tail call float @llvm.ldexp.f32.i64(float %l2, i64 %exp) |
| 129 | + %l5 = tail call float @llvm.ldexp.f32.i64(float %l4, i64 %exp) |
| 130 | + %l7 = tail call float @llvm.ldexp.f32.i64(float %l6, i64 %exp) |
| 131 | + store float %l1, ptr %y, align 4 |
| 132 | + %arrayidx2.1 = getelementptr inbounds float, ptr %y, i64 1 |
| 133 | + store float %l3, ptr %arrayidx2.1, align 4 |
| 134 | + %arrayidx2.2 = getelementptr inbounds float, ptr %y, i64 2 |
| 135 | + store float %l5, ptr %arrayidx2.2, align 4 |
| 136 | + %arrayidx2.3 = getelementptr inbounds float, ptr %y, i64 3 |
| 137 | + store float %l7, ptr %arrayidx2.3, align 4 |
| 138 | + ret void |
| 139 | +} |
| 140 | + |
| 141 | +define void @ldexp_f64i64(ptr %x, ptr %y, i64 %exp) { |
| 142 | +; CHECK-LABEL: @ldexp_f64i64( |
| 143 | +; CHECK-NEXT: entry: |
| 144 | +; CHECK-NEXT: [[L0:%.*]] = load double, ptr [[X:%.*]], align 4 |
| 145 | +; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds double, ptr [[X]], i64 1 |
| 146 | +; CHECK-NEXT: [[L2:%.*]] = load double, ptr [[ARRAYIDX_1]], align 4 |
| 147 | +; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds double, ptr [[X]], i64 2 |
| 148 | +; CHECK-NEXT: [[L4:%.*]] = load double, ptr [[ARRAYIDX_2]], align 4 |
| 149 | +; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds double, ptr [[X]], i64 3 |
| 150 | +; CHECK-NEXT: [[L6:%.*]] = load double, ptr [[ARRAYIDX_3]], align 4 |
| 151 | +; CHECK-NEXT: [[L1:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L0]], i64 [[EXP:%.*]]) |
| 152 | +; CHECK-NEXT: [[L3:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L2]], i64 [[EXP]]) |
| 153 | +; CHECK-NEXT: [[L5:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L4]], i64 [[EXP]]) |
| 154 | +; CHECK-NEXT: [[L7:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L6]], i64 [[EXP]]) |
| 155 | +; CHECK-NEXT: store double [[L1]], ptr [[Y:%.*]], align 4 |
| 156 | +; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 1 |
| 157 | +; CHECK-NEXT: store double [[L3]], ptr [[ARRAYIDX2_1]], align 4 |
| 158 | +; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 2 |
| 159 | +; CHECK-NEXT: store double [[L5]], ptr [[ARRAYIDX2_2]], align 4 |
| 160 | +; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 3 |
| 161 | +; CHECK-NEXT: store double [[L7]], ptr [[ARRAYIDX2_3]], align 4 |
| 162 | +; CHECK-NEXT: ret void |
| 163 | +; |
| 164 | +entry: |
| 165 | + %l0 = load double, ptr %x, align 4 |
| 166 | + %arrayidx.1 = getelementptr inbounds double, ptr %x, i64 1 |
| 167 | + %l2 = load double, ptr %arrayidx.1, align 4 |
| 168 | + %arrayidx.2 = getelementptr inbounds double, ptr %x, i64 2 |
| 169 | + %l4 = load double, ptr %arrayidx.2, align 4 |
| 170 | + %arrayidx.3 = getelementptr inbounds double, ptr %x, i64 3 |
| 171 | + %l6 = load double, ptr %arrayidx.3, align 4 |
| 172 | + %l1 = tail call double @llvm.ldexp.f64.i64(double %l0, i64 %exp) |
| 173 | + %l3 = tail call double @llvm.ldexp.f64.i64(double %l2, i64 %exp) |
| 174 | + %l5 = tail call double @llvm.ldexp.f64.i64(double %l4, i64 %exp) |
| 175 | + %l7 = tail call double @llvm.ldexp.f64.i64(double %l6, i64 %exp) |
| 176 | + store double %l1, ptr %y, align 4 |
| 177 | + %arrayidx2.1 = getelementptr inbounds double, ptr %y, i64 1 |
| 178 | + store double %l3, ptr %arrayidx2.1, align 4 |
| 179 | + %arrayidx2.2 = getelementptr inbounds double, ptr %y, i64 2 |
| 180 | + store double %l5, ptr %arrayidx2.2, align 4 |
| 181 | + %arrayidx2.3 = getelementptr inbounds double, ptr %y, i64 3 |
| 182 | + store double %l7, ptr %arrayidx2.3, align 4 |
| 183 | + ret void |
| 184 | +} |
| 185 | + |
| 186 | +define void @ldexp_f32i32_i64(ptr %x, ptr %y, i32 %exp32, i64 %exp64) { |
| 187 | +; CHECK-LABEL: @ldexp_f32i32_i64( |
| 188 | +; CHECK-NEXT: entry: |
| 189 | +; CHECK-NEXT: [[L0:%.*]] = load float, ptr [[X:%.*]], align 4 |
| 190 | +; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds float, ptr [[X]], i64 1 |
| 191 | +; CHECK-NEXT: [[L2:%.*]] = load float, ptr [[ARRAYIDX_1]], align 4 |
| 192 | +; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds float, ptr [[X]], i64 2 |
| 193 | +; CHECK-NEXT: [[L4:%.*]] = load float, ptr [[ARRAYIDX_2]], align 4 |
| 194 | +; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds float, ptr [[X]], i64 3 |
| 195 | +; CHECK-NEXT: [[L6:%.*]] = load float, ptr [[ARRAYIDX_3]], align 4 |
| 196 | +; CHECK-NEXT: [[L1:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L0]], i32 [[EXP32:%.*]]) |
| 197 | +; CHECK-NEXT: [[L3:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L2]], i32 [[EXP32]]) |
| 198 | +; CHECK-NEXT: [[L5:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L4]], i64 [[EXP64:%.*]]) |
| 199 | +; CHECK-NEXT: [[L7:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L6]], i64 [[EXP64]]) |
| 200 | +; CHECK-NEXT: store float [[L1]], ptr [[Y:%.*]], align 4 |
| 201 | +; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 1 |
| 202 | +; CHECK-NEXT: store float [[L3]], ptr [[ARRAYIDX2_1]], align 4 |
| 203 | +; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 2 |
| 204 | +; CHECK-NEXT: store float [[L5]], ptr [[ARRAYIDX2_2]], align 4 |
| 205 | +; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 3 |
| 206 | +; CHECK-NEXT: store float [[L7]], ptr [[ARRAYIDX2_3]], align 4 |
| 207 | +; CHECK-NEXT: ret void |
| 208 | +; |
| 209 | +entry: |
| 210 | + %l0 = load float, ptr %x, align 4 |
| 211 | + %arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1 |
| 212 | + %l2 = load float, ptr %arrayidx.1, align 4 |
| 213 | + %arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2 |
| 214 | + %l4 = load float, ptr %arrayidx.2, align 4 |
| 215 | + %arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3 |
| 216 | + %l6 = load float, ptr %arrayidx.3, align 4 |
| 217 | + %l1 = tail call float @llvm.ldexp.f32.i32(float %l0, i32 %exp32) |
| 218 | + %l3 = tail call float @llvm.ldexp.f32.i32(float %l2, i32 %exp32) |
| 219 | + %l5 = tail call float @llvm.ldexp.f32.i64(float %l4, i64 %exp64) |
| 220 | + %l7 = tail call float @llvm.ldexp.f32.i64(float %l6, i64 %exp64) |
| 221 | + store float %l1, ptr %y, align 4 |
| 222 | + %arrayidx2.1 = getelementptr inbounds float, ptr %y, i64 1 |
| 223 | + store float %l3, ptr %arrayidx2.1, align 4 |
| 224 | + %arrayidx2.2 = getelementptr inbounds float, ptr %y, i64 2 |
| 225 | + store float %l5, ptr %arrayidx2.2, align 4 |
| 226 | + %arrayidx2.3 = getelementptr inbounds float, ptr %y, i64 3 |
| 227 | + store float %l7, ptr %arrayidx2.3, align 4 |
| 228 | + ret void |
| 229 | +} |
| 230 | + |
| 231 | +define void @ldexp_f64_i32_i64(ptr %x, ptr %y, i32 %exp32, i64 %exp64) { |
| 232 | +; CHECK-LABEL: @ldexp_f64_i32_i64( |
| 233 | +; CHECK-NEXT: entry: |
| 234 | +; CHECK-NEXT: [[L0:%.*]] = load double, ptr [[X:%.*]], align 4 |
| 235 | +; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds double, ptr [[X]], i64 1 |
| 236 | +; CHECK-NEXT: [[L2:%.*]] = load double, ptr [[ARRAYIDX_1]], align 4 |
| 237 | +; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds double, ptr [[X]], i64 2 |
| 238 | +; CHECK-NEXT: [[L4:%.*]] = load double, ptr [[ARRAYIDX_2]], align 4 |
| 239 | +; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds double, ptr [[X]], i64 3 |
| 240 | +; CHECK-NEXT: [[L6:%.*]] = load double, ptr [[ARRAYIDX_3]], align 4 |
| 241 | +; CHECK-NEXT: [[L1:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L0]], i32 [[EXP32:%.*]]) |
| 242 | +; CHECK-NEXT: [[L3:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L2]], i32 [[EXP32]]) |
| 243 | +; CHECK-NEXT: [[L5:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L4]], i64 [[EXP64:%.*]]) |
| 244 | +; CHECK-NEXT: [[L7:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L6]], i64 [[EXP64]]) |
| 245 | +; CHECK-NEXT: store double [[L1]], ptr [[Y:%.*]], align 4 |
| 246 | +; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 1 |
| 247 | +; CHECK-NEXT: store double [[L3]], ptr [[ARRAYIDX2_1]], align 4 |
| 248 | +; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 2 |
| 249 | +; CHECK-NEXT: store double [[L5]], ptr [[ARRAYIDX2_2]], align 4 |
| 250 | +; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 3 |
| 251 | +; CHECK-NEXT: store double [[L7]], ptr [[ARRAYIDX2_3]], align 4 |
| 252 | +; CHECK-NEXT: ret void |
| 253 | +; |
| 254 | +entry: |
| 255 | + %l0 = load double, ptr %x, align 4 |
| 256 | + %arrayidx.1 = getelementptr inbounds double, ptr %x, i64 1 |
| 257 | + %l2 = load double, ptr %arrayidx.1, align 4 |
| 258 | + %arrayidx.2 = getelementptr inbounds double, ptr %x, i64 2 |
| 259 | + %l4 = load double, ptr %arrayidx.2, align 4 |
| 260 | + %arrayidx.3 = getelementptr inbounds double, ptr %x, i64 3 |
| 261 | + %l6 = load double, ptr %arrayidx.3, align 4 |
| 262 | + %l1 = tail call double @llvm.ldexp.f64.i32(double %l0, i32 %exp32) |
| 263 | + %l3 = tail call double @llvm.ldexp.f64.i32(double %l2, i32 %exp32) |
| 264 | + %l5 = tail call double @llvm.ldexp.f64.i64(double %l4, i64 %exp64) |
| 265 | + %l7 = tail call double @llvm.ldexp.f64.i64(double %l6, i64 %exp64) |
| 266 | + store double %l1, ptr %y, align 4 |
| 267 | + %arrayidx2.1 = getelementptr inbounds double, ptr %y, i64 1 |
| 268 | + store double %l3, ptr %arrayidx2.1, align 4 |
| 269 | + %arrayidx2.2 = getelementptr inbounds double, ptr %y, i64 2 |
| 270 | + store double %l5, ptr %arrayidx2.2, align 4 |
| 271 | + %arrayidx2.3 = getelementptr inbounds double, ptr %y, i64 3 |
| 272 | + store double %l7, ptr %arrayidx2.3, align 4 |
| 273 | + ret void |
| 274 | +} |
| 275 | + |
96 | 276 | declare float @llvm.ldexp.f32.i32(float, i32) |
97 | 277 | declare double @llvm.ldexp.f64.i32(double, i32) |
| 278 | +declare float @llvm.ldexp.f32.i64(float, i64) |
| 279 | +declare double @llvm.ldexp.f64.i64(double, i64) |
0 commit comments