|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: opt < %s -passes=instcombine -S | FileCheck %s |
| 3 | + |
| 4 | +define double @fdim_double() { |
| 5 | +; CHECK-LABEL: define double @fdim_double() { |
| 6 | +; CHECK-NEXT: ret double 2.500000e+00 |
| 7 | +; |
| 8 | + %dim = call double @fdim(double 10.5, double 8.0) |
| 9 | + ret double %dim |
| 10 | +} |
| 11 | + |
| 12 | +define double @fdim_double1() { |
| 13 | +; CHECK-LABEL: define double @fdim_double1() { |
| 14 | +; CHECK-NEXT: ret double 0.000000e+00 |
| 15 | +; |
| 16 | + %dim = call double @fdim(double 7.0, double 8.0) |
| 17 | + ret double %dim |
| 18 | +} |
| 19 | + |
| 20 | +define float @fdim_float() { |
| 21 | +; CHECK-LABEL: define float @fdim_float() { |
| 22 | +; CHECK-NEXT: ret float 0.000000e+00 |
| 23 | +; |
| 24 | + %dim = call float @fdimf(float 1.500000e+00, float 8.0) |
| 25 | + ret float %dim |
| 26 | +} |
| 27 | + |
| 28 | +define float @fdim_float1() { |
| 29 | +; CHECK-LABEL: define float @fdim_float1() { |
| 30 | +; CHECK-NEXT: ret float 2.000000e+00 |
| 31 | +; |
| 32 | + %dim = call float @fdimf(float 1.000000e+01, float 8.0) |
| 33 | + ret float %dim |
| 34 | +} |
| 35 | + |
| 36 | +define double @fdim_poison1() { |
| 37 | +; CHECK-LABEL: define double @fdim_poison1() { |
| 38 | +; CHECK-NEXT: [[DIM:%.*]] = call double @fdim(double poison, double 1.000000e+00) |
| 39 | +; CHECK-NEXT: ret double [[DIM]] |
| 40 | +; |
| 41 | + %dim = call double @fdim(double poison, double 1.0) |
| 42 | + ret double %dim |
| 43 | +} |
| 44 | + |
| 45 | +define double @fdim_poison2() { |
| 46 | +; CHECK-LABEL: define double @fdim_poison2() { |
| 47 | +; CHECK-NEXT: [[DIM:%.*]] = call double @fdim(double 1.000000e+00, double poison) |
| 48 | +; CHECK-NEXT: ret double [[DIM]] |
| 49 | +; |
| 50 | + %dim = call double @fdim(double 1.0, double poison) |
| 51 | + ret double %dim |
| 52 | +} |
| 53 | + |
| 54 | +define double @fdim_undef1() { |
| 55 | +; CHECK-LABEL: define double @fdim_undef1() { |
| 56 | +; CHECK-NEXT: [[DIM:%.*]] = call double @fdim(double undef, double 1.000000e+00) |
| 57 | +; CHECK-NEXT: ret double [[DIM]] |
| 58 | +; |
| 59 | + %dim = call double @fdim(double undef, double 1.0) |
| 60 | + ret double %dim |
| 61 | +} |
| 62 | + |
| 63 | +define double @fdim_undef2() { |
| 64 | +; CHECK-LABEL: define double @fdim_undef2() { |
| 65 | +; CHECK-NEXT: [[DIM:%.*]] = call double @fdim(double 1.000000e+00, double undef) |
| 66 | +; CHECK-NEXT: ret double [[DIM]] |
| 67 | +; |
| 68 | + %dim = call double @fdim(double 1.0, double undef) |
| 69 | + ret double %dim |
| 70 | +} |
| 71 | + |
| 72 | +define double @fdim_inf(){ |
| 73 | +; CHECK-LABEL: define double @fdim_inf() { |
| 74 | +; CHECK-NEXT: ret double 0x7FF0000000000000 |
| 75 | +; |
| 76 | + %dim = call double @fdim(double 0x7FF0000000000000, double 0x8000000000000000 ) |
| 77 | + ret double %dim |
| 78 | +} |
| 79 | + |
| 80 | +define double @fdim_nzero(){ |
| 81 | +; CHECK-LABEL: define double @fdim_nzero() { |
| 82 | +; CHECK-NEXT: ret double 0.000000e+00 |
| 83 | +; |
| 84 | + %dim = call double @fdim(double -0.0, double +0.0) |
| 85 | + ret double %dim |
| 86 | +} |
| 87 | + |
| 88 | +declare double @fdim(double, double) |
| 89 | +declare float @fdimf(float, float) |
0 commit comments