|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: llc --mtriple=aarch64-linux-gnu < %s | FileCheck %s |
| 3 | + |
| 4 | +define float @f(float nofpclass(nan) %a, float nofpclass(nan) %b) { |
| 5 | +; CHECK-LABEL: f: |
| 6 | +; CHECK: // %bb.0: // %entry |
| 7 | +; CHECK-NEXT: fmaxnm s0, s0, s1 |
| 8 | +; CHECK-NEXT: ret |
| 9 | +entry: |
| 10 | + %cond = tail call float @llvm.maximumnum.f32(float %a, float %b) |
| 11 | + ret float %cond |
| 12 | +} |
| 13 | + |
| 14 | +define <4 x float> @fv4f32(<4 x float> nofpclass(nan) %a, <4 x float> nofpclass(nan) %b) { |
| 15 | +; CHECK-LABEL: fv4f32: |
| 16 | +; CHECK: // %bb.0: // %entry |
| 17 | +; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v1.4s |
| 18 | +; CHECK-NEXT: ret |
| 19 | +entry: |
| 20 | + %c = call <4 x float> @llvm.maximumnum.v4f32(<4 x float> %a, <4 x float> %b) |
| 21 | + ret <4 x float> %c |
| 22 | +} |
| 23 | + |
| 24 | +define {float, float} @m({float, float} nofpclass(nan) %a0, {float, float} nofpclass(nan) %a1) { |
| 25 | +; CHECK-LABEL: m: |
| 26 | +; CHECK: // %bb.0: // %entry |
| 27 | +; CHECK-NEXT: fmaxnm s1, s1, s3 |
| 28 | +; CHECK-NEXT: fmaxnm s0, s0, s2 |
| 29 | +; CHECK-NEXT: ret |
| 30 | +entry: |
| 31 | + %a0f0 = extractvalue {float, float} %a0, 0 |
| 32 | + %a0f1 = extractvalue {float, float} %a0, 1 |
| 33 | + %a1f0 = extractvalue {float, float} %a1, 0 |
| 34 | + %a1f1 = extractvalue {float, float} %a1, 1 |
| 35 | + %max0 = tail call float @llvm.maximumnum.f32(float %a0f0, float %a1f0) |
| 36 | + %max1 = tail call float @llvm.maximumnum.f32(float %a0f1, float %a1f1) |
| 37 | + %ret0 = insertvalue {float, float} poison, float %max0, 0 |
| 38 | + %ret1 = insertvalue {float, float} %ret0, float %max1, 1 |
| 39 | + ret {float, float} %ret1 |
| 40 | +} |
| 41 | + |
| 42 | +define [2 x float] @mA([2 x float] nofpclass(nan) %a0, [2 x float] nofpclass(nan) %a1) { |
| 43 | +; CHECK-LABEL: mA: |
| 44 | +; CHECK: // %bb.0: // %entry |
| 45 | +; CHECK-NEXT: fmaxnm s1, s1, s3 |
| 46 | +; CHECK-NEXT: fmaxnm s0, s0, s2 |
| 47 | +; CHECK-NEXT: ret |
| 48 | +entry: |
| 49 | + %a0f0 = extractvalue [2 x float] %a0, 0 |
| 50 | + %a0f1 = extractvalue [2 x float] %a0, 1 |
| 51 | + %a1f0 = extractvalue [2 x float] %a1, 0 |
| 52 | + %a1f1 = extractvalue [2 x float] %a1, 1 |
| 53 | + %max0 = tail call float @llvm.maximumnum.f32(float %a0f0, float %a1f0) |
| 54 | + %max1 = tail call float @llvm.maximumnum.f32(float %a0f1, float %a1f1) |
| 55 | + %ret0 = insertvalue [2 x float] poison, float %max0, 0 |
| 56 | + %ret1 = insertvalue [2 x float] %ret0, float %max1, 1 |
| 57 | + ret [2 x float] %ret1 |
| 58 | +} |
| 59 | + |
| 60 | +define float @fS(float nofpclass(snan) %a, float nofpclass(snan) %b) { |
| 61 | +; CHECK-LABEL: fS: |
| 62 | +; CHECK: // %bb.0: // %entry |
| 63 | +; CHECK-NEXT: fmaxnm s0, s0, s1 |
| 64 | +; CHECK-NEXT: ret |
| 65 | +entry: |
| 66 | + %cond = tail call float @llvm.maximumnum.f32(float %a, float %b) |
| 67 | + ret float %cond |
| 68 | +} |
| 69 | + |
| 70 | +define <4 x float> @fSv4f32(<4 x float> nofpclass(snan) %a, <4 x float> nofpclass(snan) %b) { |
| 71 | +; CHECK-LABEL: fSv4f32: |
| 72 | +; CHECK: // %bb.0: // %entry |
| 73 | +; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v1.4s |
| 74 | +; CHECK-NEXT: ret |
| 75 | +entry: |
| 76 | + %c = call <4 x float> @llvm.maximumnum.v4f32(<4 x float> %a, <4 x float> %b) |
| 77 | + ret <4 x float> %c |
| 78 | +} |
| 79 | + |
| 80 | +define {float, float} @mS({float, float} nofpclass(snan) %a0, {float, float} nofpclass(snan) %a1) { |
| 81 | +; CHECK-LABEL: mS: |
| 82 | +; CHECK: // %bb.0: // %entry |
| 83 | +; CHECK-NEXT: fmaxnm s1, s1, s3 |
| 84 | +; CHECK-NEXT: fmaxnm s0, s0, s2 |
| 85 | +; CHECK-NEXT: ret |
| 86 | +entry: |
| 87 | + %a0f0 = extractvalue {float, float} %a0, 0 |
| 88 | + %a0f1 = extractvalue {float, float} %a0, 1 |
| 89 | + %a1f0 = extractvalue {float, float} %a1, 0 |
| 90 | + %a1f1 = extractvalue {float, float} %a1, 1 |
| 91 | + %max0 = tail call float @llvm.maximumnum.f32(float %a0f0, float %a1f0) |
| 92 | + %max1 = tail call float @llvm.maximumnum.f32(float %a0f1, float %a1f1) |
| 93 | + %ret0 = insertvalue {float, float} poison, float %max0, 0 |
| 94 | + %ret1 = insertvalue {float, float} %ret0, float %max1, 1 |
| 95 | + ret {float, float} %ret1 |
| 96 | +} |
| 97 | + |
| 98 | +define [2 x float] @mAS([2 x float] nofpclass(snan) %a0, [2 x float] nofpclass(snan) %a1) { |
| 99 | +; CHECK-LABEL: mAS: |
| 100 | +; CHECK: // %bb.0: // %entry |
| 101 | +; CHECK-NEXT: fmaxnm s1, s1, s3 |
| 102 | +; CHECK-NEXT: fmaxnm s0, s0, s2 |
| 103 | +; CHECK-NEXT: ret |
| 104 | +entry: |
| 105 | + %a0f0 = extractvalue [2 x float] %a0, 0 |
| 106 | + %a0f1 = extractvalue [2 x float] %a0, 1 |
| 107 | + %a1f0 = extractvalue [2 x float] %a1, 0 |
| 108 | + %a1f1 = extractvalue [2 x float] %a1, 1 |
| 109 | + %max0 = tail call float @llvm.maximumnum.f32(float %a0f0, float %a1f0) |
| 110 | + %max1 = tail call float @llvm.maximumnum.f32(float %a0f1, float %a1f1) |
| 111 | + %ret0 = insertvalue [2 x float] poison, float %max0, 0 |
| 112 | + %ret1 = insertvalue [2 x float] %ret0, float %max1, 1 |
| 113 | + ret [2 x float] %ret1 |
| 114 | +} |
| 115 | + |
| 116 | +define float @fQ(float nofpclass(qnan) %a, float nofpclass(qnan) %b) { |
| 117 | +; CHECK-LABEL: fQ: |
| 118 | +; CHECK: // %bb.0: // %entry |
| 119 | +; CHECK-NEXT: fminnm s1, s1, s1 |
| 120 | +; CHECK-NEXT: fminnm s0, s0, s0 |
| 121 | +; CHECK-NEXT: fmaxnm s0, s0, s1 |
| 122 | +; CHECK-NEXT: ret |
| 123 | +entry: |
| 124 | + %cond = tail call float @llvm.maximumnum.f32(float %a, float %b) |
| 125 | + ret float %cond |
| 126 | +} |
| 127 | + |
| 128 | +define <4 x float> @fQv4f32(<4 x float> nofpclass(qnan) %a, <4 x float> nofpclass(qnan) %b) { |
| 129 | +; CHECK-LABEL: fQv4f32: |
| 130 | +; CHECK: // %bb.0: // %entry |
| 131 | +; CHECK-NEXT: fminnm v1.4s, v1.4s, v1.4s |
| 132 | +; CHECK-NEXT: fminnm v0.4s, v0.4s, v0.4s |
| 133 | +; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v1.4s |
| 134 | +; CHECK-NEXT: ret |
| 135 | +entry: |
| 136 | + %c = call <4 x float> @llvm.maximumnum.v4f32(<4 x float> %a, <4 x float> %b) |
| 137 | + ret <4 x float> %c |
| 138 | +} |
| 139 | + |
| 140 | +define {float, float} @mQ({float, float} nofpclass(qnan) %a0, {float, float} nofpclass(qnan) %a1) { |
| 141 | +; CHECK-LABEL: mQ: |
| 142 | +; CHECK: // %bb.0: // %entry |
| 143 | +; CHECK-NEXT: fminnm s2, s2, s2 |
| 144 | +; CHECK-NEXT: fminnm s0, s0, s0 |
| 145 | +; CHECK-NEXT: fminnm s3, s3, s3 |
| 146 | +; CHECK-NEXT: fminnm s1, s1, s1 |
| 147 | +; CHECK-NEXT: fmaxnm s0, s0, s2 |
| 148 | +; CHECK-NEXT: fmaxnm s1, s1, s3 |
| 149 | +; CHECK-NEXT: ret |
| 150 | +entry: |
| 151 | + %a0f0 = extractvalue {float, float} %a0, 0 |
| 152 | + %a0f1 = extractvalue {float, float} %a0, 1 |
| 153 | + %a1f0 = extractvalue {float, float} %a1, 0 |
| 154 | + %a1f1 = extractvalue {float, float} %a1, 1 |
| 155 | + %max0 = tail call float @llvm.maximumnum.f32(float %a0f0, float %a1f0) |
| 156 | + %max1 = tail call float @llvm.maximumnum.f32(float %a0f1, float %a1f1) |
| 157 | + %ret0 = insertvalue {float, float} poison, float %max0, 0 |
| 158 | + %ret1 = insertvalue {float, float} %ret0, float %max1, 1 |
| 159 | + ret {float, float} %ret1 |
| 160 | +} |
| 161 | + |
| 162 | +define [2 x float] @mAQ([2 x float] nofpclass(qnan) %a0, [2 x float] nofpclass(qnan) %a1) { |
| 163 | +; CHECK-LABEL: mAQ: |
| 164 | +; CHECK: // %bb.0: // %entry |
| 165 | +; CHECK-NEXT: fminnm s2, s2, s2 |
| 166 | +; CHECK-NEXT: fminnm s0, s0, s0 |
| 167 | +; CHECK-NEXT: fminnm s3, s3, s3 |
| 168 | +; CHECK-NEXT: fminnm s1, s1, s1 |
| 169 | +; CHECK-NEXT: fmaxnm s0, s0, s2 |
| 170 | +; CHECK-NEXT: fmaxnm s1, s1, s3 |
| 171 | +; CHECK-NEXT: ret |
| 172 | +entry: |
| 173 | + %a0f0 = extractvalue [2 x float] %a0, 0 |
| 174 | + %a0f1 = extractvalue [2 x float] %a0, 1 |
| 175 | + %a1f0 = extractvalue [2 x float] %a1, 0 |
| 176 | + %a1f1 = extractvalue [2 x float] %a1, 1 |
| 177 | + %max0 = tail call float @llvm.maximumnum.f32(float %a0f0, float %a1f0) |
| 178 | + %max1 = tail call float @llvm.maximumnum.f32(float %a0f1, float %a1f1) |
| 179 | + %ret0 = insertvalue [2 x float] poison, float %max0, 0 |
| 180 | + %ret1 = insertvalue [2 x float] %ret0, float %max1, 1 |
| 181 | + ret [2 x float] %ret1 |
| 182 | +} |
0 commit comments