| 1 |
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| 2 |
; RUN: opt < %s -mtriple=x86_64-- -passes=instsimplify -S | FileCheck %s |
| 3 |
|
| 4 |
; |
| 5 |
; constrained fadd |
| 6 |
; |
| 7 |
|
| 8 |
define float @fadd_nan_op0_strict(float %x) #0 { |
| 9 |
; CHECK-LABEL: @fadd_nan_op0_strict( |
| 10 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fadd.f32(float 0x7FF8000000000000, float [[X:%.*]], metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 11 |
; CHECK-NEXT: ret float [[R]] |
| 12 |
; |
| 13 |
%r = call float @llvm.experimental.constrained.fadd.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 14 |
ret float %r |
| 15 |
} |
| 16 |
|
| 17 |
define float @fadd_nan_op0_maytrap(float %x) #0 { |
| 18 |
; CHECK-LABEL: @fadd_nan_op0_maytrap( |
| 19 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 20 |
; |
| 21 |
%r = call float @llvm.experimental.constrained.fadd.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 22 |
ret float %r |
| 23 |
} |
| 24 |
|
| 25 |
define float @fadd_nan_op0_upward(float %x) #0 { |
| 26 |
; CHECK-LABEL: @fadd_nan_op0_upward( |
| 27 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 28 |
; |
| 29 |
%r = call float @llvm.experimental.constrained.fadd.f32(float 0x7FF8000000000000, float %x, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 30 |
ret float %r |
| 31 |
} |
| 32 |
|
| 33 |
define float @fadd_nan_op0_defaultfp(float %x) #0 { |
| 34 |
; CHECK-LABEL: @fadd_nan_op0_defaultfp( |
| 35 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 36 |
; |
| 37 |
%r = call float @llvm.experimental.constrained.fadd.f32(float 0x7FF8000000000000, float %x, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 38 |
ret float %r |
| 39 |
} |
| 40 |
|
| 41 |
define float @fadd_nan_op1_strict(float %x) #0 { |
| 42 |
; CHECK-LABEL: @fadd_nan_op1_strict( |
| 43 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fadd.f32(float [[X:%.*]], float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 44 |
; CHECK-NEXT: ret float [[R]] |
| 45 |
; |
| 46 |
%r = call float @llvm.experimental.constrained.fadd.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 47 |
ret float %r |
| 48 |
} |
| 49 |
|
| 50 |
define float @fadd_nan_op1_maytrap(float %x) #0 { |
| 51 |
; CHECK-LABEL: @fadd_nan_op1_maytrap( |
| 52 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 53 |
; |
| 54 |
%r = call float @llvm.experimental.constrained.fadd.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 55 |
ret float %r |
| 56 |
} |
| 57 |
|
| 58 |
define float @fadd_nan_op1_upward(float %x) #0 { |
| 59 |
; CHECK-LABEL: @fadd_nan_op1_upward( |
| 60 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 61 |
; |
| 62 |
%r = call float @llvm.experimental.constrained.fadd.f32(float %x, float 0x7FF8000000000000, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 63 |
ret float %r |
| 64 |
} |
| 65 |
|
| 66 |
define float @fadd_nan_op1_defaultfp(float %x) #0 { |
| 67 |
; CHECK-LABEL: @fadd_nan_op1_defaultfp( |
| 68 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 69 |
; |
| 70 |
%r = call float @llvm.experimental.constrained.fadd.f32(float %x, float 0x7FF8000000000000, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 71 |
ret float %r |
| 72 |
} |
| 73 |
|
| 74 |
; |
| 75 |
; constrained fsub |
| 76 |
; |
| 77 |
|
| 78 |
define float @fsub_nan_op0_strict(float %x) #0 { |
| 79 |
; CHECK-LABEL: @fsub_nan_op0_strict( |
| 80 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fsub.f32(float 0x7FF8000000000000, float [[X:%.*]], metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 81 |
; CHECK-NEXT: ret float [[R]] |
| 82 |
; |
| 83 |
%r = call float @llvm.experimental.constrained.fsub.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 84 |
ret float %r |
| 85 |
} |
| 86 |
|
| 87 |
define float @fsub_nan_op0_maytrap(float %x) #0 { |
| 88 |
; CHECK-LABEL: @fsub_nan_op0_maytrap( |
| 89 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 90 |
; |
| 91 |
%r = call float @llvm.experimental.constrained.fsub.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 92 |
ret float %r |
| 93 |
} |
| 94 |
|
| 95 |
define float @fsub_nan_op0_upward(float %x) #0 { |
| 96 |
; CHECK-LABEL: @fsub_nan_op0_upward( |
| 97 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 98 |
; |
| 99 |
%r = call float @llvm.experimental.constrained.fsub.f32(float 0x7FF8000000000000, float %x, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 100 |
ret float %r |
| 101 |
} |
| 102 |
|
| 103 |
define float @fsub_nan_op0_defaultfp(float %x) #0 { |
| 104 |
; CHECK-LABEL: @fsub_nan_op0_defaultfp( |
| 105 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 106 |
; |
| 107 |
%r = call float @llvm.experimental.constrained.fsub.f32(float 0x7FF8000000000000, float %x, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 108 |
ret float %r |
| 109 |
} |
| 110 |
|
| 111 |
define float @fsub_nan_op1_strict(float %x) #0 { |
| 112 |
; CHECK-LABEL: @fsub_nan_op1_strict( |
| 113 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fsub.f32(float [[X:%.*]], float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 114 |
; CHECK-NEXT: ret float [[R]] |
| 115 |
; |
| 116 |
%r = call float @llvm.experimental.constrained.fsub.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") #0 |
| 117 |
ret float %r |
| 118 |
} |
| 119 |
|
| 120 |
define float @fsub_nan_op1_maytrap(float %x) #0 { |
| 121 |
; CHECK-LABEL: @fsub_nan_op1_maytrap( |
| 122 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 123 |
; |
| 124 |
%r = call float @llvm.experimental.constrained.fsub.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 125 |
ret float %r |
| 126 |
} |
| 127 |
|
| 128 |
define float @fsub_nan_op1_upward(float %x) #0 { |
| 129 |
; CHECK-LABEL: @fsub_nan_op1_upward( |
| 130 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 131 |
; |
| 132 |
%r = call float @llvm.experimental.constrained.fsub.f32(float %x, float 0x7FF8000000000000, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 133 |
ret float %r |
| 134 |
} |
| 135 |
|
| 136 |
define float @fsub_nan_op1_defaultfp(float %x) #0 { |
| 137 |
; CHECK-LABEL: @fsub_nan_op1_defaultfp( |
| 138 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 139 |
; |
| 140 |
%r = call float @llvm.experimental.constrained.fsub.f32(float %x, float 0x7FF8000000000000, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 141 |
ret float %r |
| 142 |
} |
| 143 |
|
| 144 |
; |
| 145 |
; constrained fmul |
| 146 |
; |
| 147 |
|
| 148 |
define float @fmul_nan_op0_strict(float %x) #0 { |
| 149 |
; CHECK-LABEL: @fmul_nan_op0_strict( |
| 150 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fmul.f32(float 0x7FF8000000000000, float [[X:%.*]], metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 151 |
; CHECK-NEXT: ret float [[R]] |
| 152 |
; |
| 153 |
%r = call float @llvm.experimental.constrained.fmul.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 154 |
ret float %r |
| 155 |
} |
| 156 |
|
| 157 |
define float @fmul_nan_op0_maytrap(float %x) #0 { |
| 158 |
; CHECK-LABEL: @fmul_nan_op0_maytrap( |
| 159 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 160 |
; |
| 161 |
%r = call float @llvm.experimental.constrained.fmul.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 162 |
ret float %r |
| 163 |
} |
| 164 |
|
| 165 |
define float @fmul_nan_op0_upward(float %x) #0 { |
| 166 |
; CHECK-LABEL: @fmul_nan_op0_upward( |
| 167 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 168 |
; |
| 169 |
%r = call float @llvm.experimental.constrained.fmul.f32(float 0x7FF8000000000000, float %x, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 170 |
ret float %r |
| 171 |
} |
| 172 |
|
| 173 |
define float @fmul_nan_op0_defaultfp(float %x) #0 { |
| 174 |
; CHECK-LABEL: @fmul_nan_op0_defaultfp( |
| 175 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 176 |
; |
| 177 |
%r = call float @llvm.experimental.constrained.fmul.f32(float 0x7FF8000000000000, float %x, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 178 |
ret float %r |
| 179 |
} |
| 180 |
|
| 181 |
define float @fmul_nan_op1_strict(float %x) #0 { |
| 182 |
; CHECK-LABEL: @fmul_nan_op1_strict( |
| 183 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fmul.f32(float [[X:%.*]], float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 184 |
; CHECK-NEXT: ret float [[R]] |
| 185 |
; |
| 186 |
%r = call float @llvm.experimental.constrained.fmul.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 187 |
ret float %r |
| 188 |
} |
| 189 |
|
| 190 |
define float @fmul_nan_op1_maytrap(float %x) #0 { |
| 191 |
; CHECK-LABEL: @fmul_nan_op1_maytrap( |
| 192 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 193 |
; |
| 194 |
%r = call float @llvm.experimental.constrained.fmul.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 195 |
ret float %r |
| 196 |
} |
| 197 |
|
| 198 |
define float @fmul_nan_op1_upward(float %x) #0 { |
| 199 |
; CHECK-LABEL: @fmul_nan_op1_upward( |
| 200 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 201 |
; |
| 202 |
%r = call float @llvm.experimental.constrained.fmul.f32(float %x, float 0x7FF8000000000000, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 203 |
ret float %r |
| 204 |
} |
| 205 |
|
| 206 |
define float @fmul_nan_op1_defaultfp(float %x) #0 { |
| 207 |
; CHECK-LABEL: @fmul_nan_op1_defaultfp( |
| 208 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 209 |
; |
| 210 |
%r = call float @llvm.experimental.constrained.fmul.f32(float %x, float 0x7FF8000000000000, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 211 |
ret float %r |
| 212 |
} |
| 213 |
|
| 214 |
; |
| 215 |
; constrained fdiv |
| 216 |
; |
| 217 |
|
| 218 |
define float @fdiv_nan_op0_strict(float %x) #0 { |
| 219 |
; CHECK-LABEL: @fdiv_nan_op0_strict( |
| 220 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fdiv.f32(float 0x7FF8000000000000, float [[X:%.*]], metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 221 |
; CHECK-NEXT: ret float [[R]] |
| 222 |
; |
| 223 |
%r = call float @llvm.experimental.constrained.fdiv.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 224 |
ret float %r |
| 225 |
} |
| 226 |
|
| 227 |
define float @fdiv_nan_op0_maytrap(float %x) #0 { |
| 228 |
; CHECK-LABEL: @fdiv_nan_op0_maytrap( |
| 229 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 230 |
; |
| 231 |
%r = call float @llvm.experimental.constrained.fdiv.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 232 |
ret float %r |
| 233 |
} |
| 234 |
|
| 235 |
define float @fdiv_nan_op0_upward(float %x) #0 { |
| 236 |
; CHECK-LABEL: @fdiv_nan_op0_upward( |
| 237 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 238 |
; |
| 239 |
%r = call float @llvm.experimental.constrained.fdiv.f32(float 0x7FF8000000000000, float %x, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 240 |
ret float %r |
| 241 |
} |
| 242 |
|
| 243 |
define float @fdiv_nan_op0_defaultfp(float %x) #0 { |
| 244 |
; CHECK-LABEL: @fdiv_nan_op0_defaultfp( |
| 245 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 246 |
; |
| 247 |
%r = call float @llvm.experimental.constrained.fdiv.f32(float 0x7FF8000000000000, float %x, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 248 |
ret float %r |
| 249 |
} |
| 250 |
|
| 251 |
define float @fdiv_nan_op1_strict(float %x) #0 { |
| 252 |
; CHECK-LABEL: @fdiv_nan_op1_strict( |
| 253 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fdiv.f32(float [[X:%.*]], float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 254 |
; CHECK-NEXT: ret float [[R]] |
| 255 |
; |
| 256 |
%r = call float @llvm.experimental.constrained.fdiv.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 257 |
ret float %r |
| 258 |
} |
| 259 |
|
| 260 |
define float @fdiv_nan_op1_maytrap(float %x) #0 { |
| 261 |
; CHECK-LABEL: @fdiv_nan_op1_maytrap( |
| 262 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 263 |
; |
| 264 |
%r = call float @llvm.experimental.constrained.fdiv.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 265 |
ret float %r |
| 266 |
} |
| 267 |
|
| 268 |
define float @fdiv_nan_op1_upward(float %x) #0 { |
| 269 |
; CHECK-LABEL: @fdiv_nan_op1_upward( |
| 270 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 271 |
; |
| 272 |
%r = call float @llvm.experimental.constrained.fdiv.f32(float %x, float 0x7FF8000000000000, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 273 |
ret float %r |
| 274 |
} |
| 275 |
|
| 276 |
define float @fdiv_nan_op1_defaultfp(float %x) #0 { |
| 277 |
; CHECK-LABEL: @fdiv_nan_op1_defaultfp( |
| 278 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 279 |
; |
| 280 |
%r = call float @llvm.experimental.constrained.fdiv.f32(float %x, float 0x7FF8000000000000, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 281 |
ret float %r |
| 282 |
} |
| 283 |
|
| 284 |
; |
| 285 |
; constrained frem |
| 286 |
; |
| 287 |
|
| 288 |
define float @frem_nan_op0_strict(float %x) #0 { |
| 289 |
; CHECK-LABEL: @frem_nan_op0_strict( |
| 290 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.frem.f32(float 0x7FF8000000000000, float [[X:%.*]], metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 291 |
; CHECK-NEXT: ret float [[R]] |
| 292 |
; |
| 293 |
%r = call float @llvm.experimental.constrained.frem.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 294 |
ret float %r |
| 295 |
} |
| 296 |
|
| 297 |
define float @frem_nan_op0_maytrap(float %x) #0 { |
| 298 |
; CHECK-LABEL: @frem_nan_op0_maytrap( |
| 299 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 300 |
; |
| 301 |
%r = call float @llvm.experimental.constrained.frem.f32(float 0x7FF8000000000000, float %x, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 302 |
ret float %r |
| 303 |
} |
| 304 |
|
| 305 |
define float @frem_nan_op0_upward(float %x) #0 { |
| 306 |
; CHECK-LABEL: @frem_nan_op0_upward( |
| 307 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 308 |
; |
| 309 |
%r = call float @llvm.experimental.constrained.frem.f32(float 0x7FF8000000000000, float %x, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 310 |
ret float %r |
| 311 |
} |
| 312 |
|
| 313 |
define float @frem_nan_op0_defaultfp(float %x) #0 { |
| 314 |
; CHECK-LABEL: @frem_nan_op0_defaultfp( |
| 315 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 316 |
; |
| 317 |
%r = call float @llvm.experimental.constrained.frem.f32(float 0x7FF8000000000000, float %x, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 318 |
ret float %r |
| 319 |
} |
| 320 |
|
| 321 |
define float @frem_nan_op1_strict(float %x) #0 { |
| 322 |
; CHECK-LABEL: @frem_nan_op1_strict( |
| 323 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.frem.f32(float [[X:%.*]], float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 324 |
; CHECK-NEXT: ret float [[R]] |
| 325 |
; |
| 326 |
%r = call float @llvm.experimental.constrained.frem.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 327 |
ret float %r |
| 328 |
} |
| 329 |
|
| 330 |
define float @frem_nan_op1_maytrap(float %x) #0 { |
| 331 |
; CHECK-LABEL: @frem_nan_op1_maytrap( |
| 332 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 333 |
; |
| 334 |
%r = call float @llvm.experimental.constrained.frem.f32(float %x, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 335 |
ret float %r |
| 336 |
} |
| 337 |
|
| 338 |
define float @frem_nan_op1_upward(float %x) #0 { |
| 339 |
; CHECK-LABEL: @frem_nan_op1_upward( |
| 340 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 341 |
; |
| 342 |
%r = call float @llvm.experimental.constrained.frem.f32(float %x, float 0x7FF8000000000000, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 343 |
ret float %r |
| 344 |
} |
| 345 |
|
| 346 |
define float @frem_nan_op1_defaultfp(float %x) #0 { |
| 347 |
; CHECK-LABEL: @frem_nan_op1_defaultfp( |
| 348 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 349 |
; |
| 350 |
%r = call float @llvm.experimental.constrained.frem.f32(float %x, float 0x7FF8000000000000, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 351 |
ret float %r |
| 352 |
} |
| 353 |
|
| 354 |
; |
| 355 |
; constrained fma |
| 356 |
; |
| 357 |
|
| 358 |
define float @fma_nan_op0_strict(float %x, float %y) #0 { |
| 359 |
; CHECK-LABEL: @fma_nan_op0_strict( |
| 360 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fma.f32(float 0x7FF8000000000000, float [[X:%.*]], float [[Y:%.*]], metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 361 |
; CHECK-NEXT: ret float [[R]] |
| 362 |
; |
| 363 |
%r = call float @llvm.experimental.constrained.fma.f32(float 0x7FF8000000000000, float %x, float %y, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 364 |
ret float %r |
| 365 |
} |
| 366 |
|
| 367 |
define float @fma_nan_op0_maytrap(float %x, float %y) #0 { |
| 368 |
; CHECK-LABEL: @fma_nan_op0_maytrap( |
| 369 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 370 |
; |
| 371 |
%r = call float @llvm.experimental.constrained.fma.f32(float 0x7FF8000000000000, float %x, float %y, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 372 |
ret float %r |
| 373 |
} |
| 374 |
|
| 375 |
define float @fma_nan_op0_upward(float %x, float %y) #0 { |
| 376 |
; CHECK-LABEL: @fma_nan_op0_upward( |
| 377 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 378 |
; |
| 379 |
%r = call float @llvm.experimental.constrained.fma.f32(float 0x7FF8000000000000, float %x, float %y, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 380 |
ret float %r |
| 381 |
} |
| 382 |
|
| 383 |
define float @fma_nan_op0_defaultfp(float %x, float %y) #0 { |
| 384 |
; CHECK-LABEL: @fma_nan_op0_defaultfp( |
| 385 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 386 |
; |
| 387 |
%r = call float @llvm.experimental.constrained.fma.f32(float 0x7FF8000000000000, float %x, float %y, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 388 |
ret float %r |
| 389 |
} |
| 390 |
|
| 391 |
define float @fma_nan_op1_strict(float %x, float %y) #0 { |
| 392 |
; CHECK-LABEL: @fma_nan_op1_strict( |
| 393 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fma.f32(float [[X:%.*]], float 0x7FF8000000000000, float [[Y:%.*]], metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 394 |
; CHECK-NEXT: ret float [[R]] |
| 395 |
; |
| 396 |
%r = call float @llvm.experimental.constrained.fma.f32(float %x, float 0x7FF8000000000000, float %y, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 397 |
ret float %r |
| 398 |
} |
| 399 |
|
| 400 |
define float @fma_nan_op1_maytrap(float %x, float %y) #0 { |
| 401 |
; CHECK-LABEL: @fma_nan_op1_maytrap( |
| 402 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 403 |
; |
| 404 |
%r = call float @llvm.experimental.constrained.fma.f32(float %x, float 0x7FF8000000000000, float %y, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 405 |
ret float %r |
| 406 |
} |
| 407 |
|
| 408 |
define float @fma_nan_op1_upward(float %x, float %y) #0 { |
| 409 |
; CHECK-LABEL: @fma_nan_op1_upward( |
| 410 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 411 |
; |
| 412 |
%r = call float @llvm.experimental.constrained.fma.f32(float %x, float 0x7FF8000000000000, float %y, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 413 |
ret float %r |
| 414 |
} |
| 415 |
|
| 416 |
define float @fma_nan_op1_defaultfp(float %x, float %y) #0 { |
| 417 |
; CHECK-LABEL: @fma_nan_op1_defaultfp( |
| 418 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 419 |
; |
| 420 |
%r = call float @llvm.experimental.constrained.fma.f32(float %x, float 0x7FF8000000000000, float %y, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 421 |
ret float %r |
| 422 |
} |
| 423 |
|
| 424 |
define float @fma_nan_op2_strict(float %x, float %y) #0 { |
| 425 |
; CHECK-LABEL: @fma_nan_op2_strict( |
| 426 |
; CHECK-NEXT: [[R:%.*]] = call float @llvm.experimental.constrained.fma.f32(float [[X:%.*]], float [[Y:%.*]], float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 427 |
; CHECK-NEXT: ret float [[R]] |
| 428 |
; |
| 429 |
%r = call float @llvm.experimental.constrained.fma.f32(float %x, float %y, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 430 |
ret float %r |
| 431 |
} |
| 432 |
|
| 433 |
define float @fma_nan_op2_maytrap(float %x, float %y) #0 { |
| 434 |
; CHECK-LABEL: @fma_nan_op2_maytrap( |
| 435 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 436 |
; |
| 437 |
%r = call float @llvm.experimental.constrained.fma.f32(float %x, float %y, float 0x7FF8000000000000, metadata !"round.dynamic", metadata !"fpexcept.maytrap") |
| 438 |
ret float %r |
| 439 |
} |
| 440 |
|
| 441 |
define float @fma_nan_op2_upward(float %x, float %y) #0 { |
| 442 |
; CHECK-LABEL: @fma_nan_op2_upward( |
| 443 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 444 |
; |
| 445 |
%r = call float @llvm.experimental.constrained.fma.f32(float %x, float %y, float 0x7FF8000000000000, metadata !"round.upward", metadata !"fpexcept.ignore") |
| 446 |
ret float %r |
| 447 |
} |
| 448 |
|
| 449 |
define float @fma_nan_op2_defaultfp(float %x, float %y) #0 { |
| 450 |
; CHECK-LABEL: @fma_nan_op2_defaultfp( |
| 451 |
; CHECK-NEXT: ret float 0x7FF8000000000000 |
| 452 |
; |
| 453 |
%r = call float @llvm.experimental.constrained.fma.f32(float %x, float %y, float 0x7FF8000000000000, metadata !"round.tonearest", metadata !"fpexcept.ignore") |
| 454 |
ret float %r |
| 455 |
} |
| 456 |
|
| 457 |
declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata) |
| 458 |
declare float @llvm.experimental.constrained.fsub.f32(float, float, metadata, metadata) |
| 459 |
declare float @llvm.experimental.constrained.fmul.f32(float, float, metadata, metadata) |
| 460 |
declare float @llvm.experimental.constrained.fdiv.f32(float, float, metadata, metadata) |
| 461 |
declare float @llvm.experimental.constrained.frem.f32(float, float, metadata, metadata) |
| 462 |
declare float @llvm.experimental.constrained.fma.f32(float, float, float, metadata, metadata) |
| 463 |
|
| 464 |
attributes #0 = { strictfp } |