1; RUN: llc < %s -mtriple=arm-eabi -mattr=+v8.2a,+neon,+fullfp16 -float-abi=hard | FileCheck %s 2; RUN: llc < %s -mtriple=thumbv7a -mattr=+v8.2a,+neon,+fullfp16 -float-abi=hard | FileCheck %s 3 4; 4-element vector 5 6; Ordered 7 8define <4 x half> @test1(<4 x half> %A, <4 x half> %B) { 9; CHECK-LABEL: test1: 10; CHECK: vmaxnm.f16 d0, d0, d1 11; CHECK-NEXT: bx lr 12 %tmp3 = fcmp fast ogt <4 x half> %A, %B 13 %tmp4 = select <4 x i1> %tmp3, <4 x half> %A, <4 x half> %B 14 ret <4 x half> %tmp4 15} 16 17define <4 x half> @test2(<4 x half> %A, <4 x half> %B) { 18; CHECK-LABEL: test2: 19; CHECK: vminnm.f16 d0, d0, d1 20; CHECK-NEXT: bx lr 21 %tmp3 = fcmp fast ogt <4 x half> %A, %B 22 %tmp4 = select <4 x i1> %tmp3, <4 x half> %B, <4 x half> %A 23 ret <4 x half> %tmp4 24} 25 26define <4 x half> @test3(<4 x half> %A, <4 x half> %B) { 27; CHECK-LABEL: test3: 28; CHECK: vminnm.f16 d0, d0, d1 29; CHECK-NEXT: bx lr 30 %tmp3 = fcmp fast oge <4 x half> %A, %B 31 %tmp4 = select <4 x i1> %tmp3, <4 x half> %B, <4 x half> %A 32 ret <4 x half> %tmp4 33} 34 35define <4 x half> @test4(<4 x half> %A, <4 x half> %B) { 36; CHECK-LABEL: test4: 37; CHECK: vmaxnm.f16 d0, d0, d1 38; CHECK-NEXT: bx lr 39 %tmp3 = fcmp fast oge <4 x half> %A, %B 40 %tmp4 = select <4 x i1> %tmp3, <4 x half> %A, <4 x half> %B 41 ret <4 x half> %tmp4 42} 43 44define <4 x half> @test5(<4 x half> %A, <4 x half> %B) { 45; CHECK-LABEL: test5: 46; CHECK: vminnm.f16 d0, d0, d1 47; CHECK-NEXT: bx lr 48 %tmp3 = fcmp fast olt <4 x half> %A, %B 49 %tmp4 = select <4 x i1> %tmp3, <4 x half> %A, <4 x half> %B 50 ret <4 x half> %tmp4 51} 52 53define <4 x half> @test6(<4 x half> %A, <4 x half> %B) { 54; CHECK-LABEL: test6: 55; CHECK: vmaxnm.f16 d0, d0, d1 56; CHECK-NEXT: bx lr 57 %tmp3 = fcmp fast olt <4 x half> %A, %B 58 %tmp4 = select <4 x i1> %tmp3, <4 x half> %B, <4 x half> %A 59 ret <4 x half> %tmp4 60} 61 62define <4 x half> @test7(<4 x half> %A, <4 x half> %B) { 63; CHECK-LABEL: test7: 64; CHECK: vminnm.f16 d0, d0, d1 65; CHECK-NEXT: bx lr 66 %tmp3 = fcmp fast ole <4 x half> %A, %B 67 %tmp4 = select <4 x i1> %tmp3, <4 x half> %A, <4 x half> %B 68 ret <4 x half> %tmp4 69} 70 71define <4 x half> @test8(<4 x half> %A, <4 x half> %B) { 72; CHECK-LABEL: test8: 73; CHECK: vmaxnm.f16 d0, d0, d1 74; CHECK-NEXT: bx lr 75 %tmp3 = fcmp fast ole <4 x half> %A, %B 76 %tmp4 = select <4 x i1> %tmp3, <4 x half> %B, <4 x half> %A 77 ret <4 x half> %tmp4 78} 79 80; Unordered 81 82define <4 x half> @test11(<4 x half> %A, <4 x half> %B) { 83; CHECK-LABEL: test11: 84; CHECK: vmaxnm.f16 d0, d0, d1 85; CHECK-NEXT: bx lr 86 %tmp3 = fcmp fast ugt <4 x half> %A, %B 87 %tmp4 = select <4 x i1> %tmp3, <4 x half> %A, <4 x half> %B 88 ret <4 x half> %tmp4 89} 90 91define <4 x half> @test12(<4 x half> %A, <4 x half> %B) { 92; CHECK-LABEL: test12: 93; CHECK: vminnm.f16 d0, d0, d1 94; CHECK-NEXT: bx lr 95 %tmp3 = fcmp fast ugt <4 x half> %A, %B 96 %tmp4 = select <4 x i1> %tmp3, <4 x half> %B, <4 x half> %A 97 ret <4 x half> %tmp4 98} 99 100define <4 x half> @test13(<4 x half> %A, <4 x half> %B) { 101; CHECK-LABEL: test13: 102; CHECK: vminnm.f16 d0, d0, d1 103; CHECK-NEXT: bx lr 104 %tmp3 = fcmp fast uge <4 x half> %A, %B 105 %tmp4 = select <4 x i1> %tmp3, <4 x half> %B, <4 x half> %A 106 ret <4 x half> %tmp4 107} 108 109define <4 x half> @test14(<4 x half> %A, <4 x half> %B) { 110; CHECK-LABEL: test14: 111; CHECK: vmaxnm.f16 d0, d0, d1 112; CHECK-NEXT: bx lr 113 %tmp3 = fcmp fast uge <4 x half> %A, %B 114 %tmp4 = select <4 x i1> %tmp3, <4 x half> %A, <4 x half> %B 115 ret <4 x half> %tmp4 116} 117 118define <4 x half> @test15(<4 x half> %A, <4 x half> %B) { 119; CHECK-LABEL: test15: 120; CHECK: vminnm.f16 d0, d0, d1 121; CHECK-NEXT: bx lr 122 %tmp3 = fcmp fast ult <4 x half> %A, %B 123 %tmp4 = select <4 x i1> %tmp3, <4 x half> %A, <4 x half> %B 124 ret <4 x half> %tmp4 125} 126 127define <4 x half> @test16(<4 x half> %A, <4 x half> %B) { 128; CHECK-LABEL: test16: 129; CHECK: vmaxnm.f16 d0, d0, d1 130; CHECK-NEXT: bx lr 131 %tmp3 = fcmp fast ult <4 x half> %A, %B 132 %tmp4 = select <4 x i1> %tmp3, <4 x half> %B, <4 x half> %A 133 ret <4 x half> %tmp4 134} 135 136define <4 x half> @test17(<4 x half> %A, <4 x half> %B) { 137; CHECK-LABEL: test17: 138; CHECK: vminnm.f16 d0, d0, d1 139; CHECK-NEXT: bx lr 140 %tmp3 = fcmp fast ule <4 x half> %A, %B 141 %tmp4 = select <4 x i1> %tmp3, <4 x half> %A, <4 x half> %B 142 ret <4 x half> %tmp4 143} 144 145define <4 x half> @test18(<4 x half> %A, <4 x half> %B) { 146; CHECK-LABEL: test18: 147; CHECK: vmaxnm.f16 d0, d0, d1 148; CHECK-NEXT: bx lr 149 %tmp3 = fcmp fast ule <4 x half> %A, %B 150 %tmp4 = select <4 x i1> %tmp3, <4 x half> %B, <4 x half> %A 151 ret <4 x half> %tmp4 152} 153 154; 8-element vector 155 156; Ordered 157 158define <8 x half> @test201(<8 x half> %A, <8 x half> %B) { 159; CHECK-LABEL: test201: 160; CHECK: vmaxnm.f16 q0, q0, q1 161; CHECK-NEXT: bx lr 162 %tmp3 = fcmp fast ogt <8 x half> %A, %B 163 %tmp4 = select <8 x i1> %tmp3, <8 x half> %A, <8 x half> %B 164 ret <8 x half> %tmp4 165} 166 167define <8 x half> @test202(<8 x half> %A, <8 x half> %B) { 168; CHECK-LABEL: test202: 169; CHECK: vminnm.f16 q0, q0, q1 170; CHECK-NEXT: bx lr 171 %tmp3 = fcmp fast ogt <8 x half> %A, %B 172 %tmp4 = select <8 x i1> %tmp3, <8 x half> %B, <8 x half> %A 173 ret <8 x half> %tmp4 174} 175 176define <8 x half> @test203(<8 x half> %A, <8 x half> %B) { 177; CHECK-LABEL: test203: 178; CHECK: vmaxnm.f16 q0, q0, q1 179; CHECK-NEXT: bx lr 180 %tmp3 = fcmp fast oge <8 x half> %A, %B 181 %tmp4 = select <8 x i1> %tmp3, <8 x half> %A, <8 x half> %B 182 ret <8 x half> %tmp4 183} 184 185define <8 x half> @test204(<8 x half> %A, <8 x half> %B) { 186; CHECK-LABEL: test204: 187; CHECK: vminnm.f16 q0, q0, q1 188; CHECK-NEXT: bx lr 189 %tmp3 = fcmp fast oge <8 x half> %A, %B 190 %tmp4 = select <8 x i1> %tmp3, <8 x half> %B, <8 x half> %A 191 ret <8 x half> %tmp4 192} 193 194define <8 x half> @test205(<8 x half> %A, <8 x half> %B) { 195; CHECK-LABEL: test205: 196; CHECK: vminnm.f16 q0, q0, q1 197; CHECK-NEXT: bx lr 198 %tmp3 = fcmp fast olt <8 x half> %A, %B 199 %tmp4 = select <8 x i1> %tmp3, <8 x half> %A, <8 x half> %B 200 ret <8 x half> %tmp4 201} 202 203define <8 x half> @test206(<8 x half> %A, <8 x half> %B) { 204; CHECK-LABEL: test206: 205; CHECK: vmaxnm.f16 q0, q0, q1 206; CHECK-NEXT: bx lr 207 %tmp3 = fcmp fast olt <8 x half> %A, %B 208 %tmp4 = select <8 x i1> %tmp3, <8 x half> %B, <8 x half> %A 209 ret <8 x half> %tmp4 210} 211 212define <8 x half> @test207(<8 x half> %A, <8 x half> %B) { 213; CHECK-LABEL: test207: 214; CHECK: vminnm.f16 q0, q0, q1 215; CHECK-NEXT: bx lr 216 %tmp3 = fcmp fast ole <8 x half> %A, %B 217 %tmp4 = select <8 x i1> %tmp3, <8 x half> %A, <8 x half> %B 218 ret <8 x half> %tmp4 219} 220 221define <8 x half> @test208(<8 x half> %A, <8 x half> %B) { 222; CHECK-LABEL: test208: 223; CHECK: vmaxnm.f16 q0, q0, q1 224; CHECK-NEXT: bx lr 225 %tmp3 = fcmp fast ole <8 x half> %A, %B 226 %tmp4 = select <8 x i1> %tmp3, <8 x half> %B, <8 x half> %A 227 ret <8 x half> %tmp4 228} 229 230; Unordered 231 232define <8 x half> @test209(<8 x half> %A, <8 x half> %B) { 233; CHECK-LABEL: test209: 234; CHECK: vmaxnm.f16 q0, q0, q1 235; CHECK-NEXT: bx lr 236 %tmp3 = fcmp fast ugt <8 x half> %A, %B 237 %tmp4 = select <8 x i1> %tmp3, <8 x half> %A, <8 x half> %B 238 ret <8 x half> %tmp4 239} 240 241define <8 x half> @test210(<8 x half> %A, <8 x half> %B) { 242; CHECK-LABEL: test210: 243; CHECK: vminnm.f16 q0, q0, q1 244; CHECK-NEXT: bx lr 245 %tmp3 = fcmp fast ugt <8 x half> %A, %B 246 %tmp4 = select <8 x i1> %tmp3, <8 x half> %B, <8 x half> %A 247 ret <8 x half> %tmp4 248} 249 250define <8 x half> @test211(<8 x half> %A, <8 x half> %B) { 251; CHECK-LABEL: test211: 252; CHECK: vmaxnm.f16 q0, q0, q1 253; CHECK-NEXT: bx lr 254 %tmp3 = fcmp fast uge <8 x half> %A, %B 255 %tmp4 = select <8 x i1> %tmp3, <8 x half> %A, <8 x half> %B 256 ret <8 x half> %tmp4 257} 258 259define <8 x half> @test214(<8 x half> %A, <8 x half> %B) { 260; CHECK-LABEL: test214: 261; CHECK: vminnm.f16 q0, q0, q1 262; CHECK-NEXT: bx lr 263 %tmp3 = fcmp fast uge <8 x half> %A, %B 264 %tmp4 = select <8 x i1> %tmp3, <8 x half> %B, <8 x half> %A 265 ret <8 x half> %tmp4 266} 267 268define <8 x half> @test215(<8 x half> %A, <8 x half> %B) { 269; CHECK-LABEL: test215: 270; CHECK: vminnm.f16 q0, q0, q1 271; CHECK-NEXT: bx lr 272 %tmp3 = fcmp fast ult <8 x half> %A, %B 273 %tmp4 = select <8 x i1> %tmp3, <8 x half> %A, <8 x half> %B 274 ret <8 x half> %tmp4 275} 276 277define <8 x half> @test216(<8 x half> %A, <8 x half> %B) { 278; CHECK-LABEL: test216: 279; CHECK: vmaxnm.f16 q0, q0, q1 280; CHECK-NEXT: bx lr 281 %tmp3 = fcmp fast ult <8 x half> %A, %B 282 %tmp4 = select <8 x i1> %tmp3, <8 x half> %B, <8 x half> %A 283 ret <8 x half> %tmp4 284} 285 286define <8 x half> @test217(<8 x half> %A, <8 x half> %B) { 287; CHECK-LABEL: test217: 288; CHECK: vminnm.f16 q0, q0, q1 289; CHECK-NEXT: bx lr 290 %tmp3 = fcmp fast ule <8 x half> %A, %B 291 %tmp4 = select <8 x i1> %tmp3, <8 x half> %A, <8 x half> %B 292 ret <8 x half> %tmp4 293} 294 295define <8 x half> @test218(<8 x half> %A, <8 x half> %B) { 296; CHECK-LABEL: test218: 297; CHECK: vmaxnm.f16 q0, q0, q1 298; CHECK-NEXT: bx lr 299 %tmp3 = fcmp fast ule <8 x half> %A, %B 300 %tmp4 = select <8 x i1> %tmp3, <8 x half> %B, <8 x half> %A 301 ret <8 x half> %tmp4 302} 303