19fe6b9e8SEric Tang; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 23cf15af2SeopXD; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s 39fe6b9e8SEric Tang 49fe6b9e8SEric Tangdeclare { <vscale x 1 x i8>, <vscale x 1 x i1> } @llvm.smul.with.overflow.nxv1i8(<vscale x 1 x i8>, <vscale x 1 x i8>) 59fe6b9e8SEric Tang 69fe6b9e8SEric Tangdefine <vscale x 1 x i8> @smulo_nxv1i8(<vscale x 1 x i8> %x, <vscale x 1 x i8> %y) { 79fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv1i8: 89fe6b9e8SEric Tang; CHECK: # %bb.0: 9*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma 10e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 11e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 12e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v9, v8, 7 13e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 14e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 159fe6b9e8SEric Tang; CHECK-NEXT: ret 169fe6b9e8SEric Tang %a = call { <vscale x 1 x i8>, <vscale x 1 x i1> } @llvm.smul.with.overflow.nxv1i8(<vscale x 1 x i8> %x, <vscale x 1 x i8> %y) 179fe6b9e8SEric Tang %b = extractvalue { <vscale x 1 x i8>, <vscale x 1 x i1> } %a, 0 189fe6b9e8SEric Tang %c = extractvalue { <vscale x 1 x i8>, <vscale x 1 x i1> } %a, 1 199fe6b9e8SEric Tang %d = select <vscale x 1 x i1> %c, <vscale x 1 x i8> zeroinitializer, <vscale x 1 x i8> %b 209fe6b9e8SEric Tang ret <vscale x 1 x i8> %d 219fe6b9e8SEric Tang} 229fe6b9e8SEric Tang 239fe6b9e8SEric Tangdeclare { <vscale x 2 x i8>, <vscale x 2 x i1> } @llvm.smul.with.overflow.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>) 249fe6b9e8SEric Tang 259fe6b9e8SEric Tangdefine <vscale x 2 x i8> @smulo_nxv2i8(<vscale x 2 x i8> %x, <vscale x 2 x i8> %y) { 269fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv2i8: 279fe6b9e8SEric Tang; CHECK: # %bb.0: 28*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma 29e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 30e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 31e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v9, v8, 7 32e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 33e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 349fe6b9e8SEric Tang; CHECK-NEXT: ret 359fe6b9e8SEric Tang %a = call { <vscale x 2 x i8>, <vscale x 2 x i1> } @llvm.smul.with.overflow.nxv2i8(<vscale x 2 x i8> %x, <vscale x 2 x i8> %y) 369fe6b9e8SEric Tang %b = extractvalue { <vscale x 2 x i8>, <vscale x 2 x i1> } %a, 0 379fe6b9e8SEric Tang %c = extractvalue { <vscale x 2 x i8>, <vscale x 2 x i1> } %a, 1 389fe6b9e8SEric Tang %d = select <vscale x 2 x i1> %c, <vscale x 2 x i8> zeroinitializer, <vscale x 2 x i8> %b 399fe6b9e8SEric Tang ret <vscale x 2 x i8> %d 409fe6b9e8SEric Tang} 419fe6b9e8SEric Tang 429fe6b9e8SEric Tangdeclare { <vscale x 4 x i8>, <vscale x 4 x i1> } @llvm.smul.with.overflow.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>) 439fe6b9e8SEric Tang 449fe6b9e8SEric Tangdefine <vscale x 4 x i8> @smulo_nxv4i8(<vscale x 4 x i8> %x, <vscale x 4 x i8> %y) { 459fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv4i8: 469fe6b9e8SEric Tang; CHECK: # %bb.0: 47*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma 48e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 49e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 50e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v9, v8, 7 51e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 52e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 539fe6b9e8SEric Tang; CHECK-NEXT: ret 549fe6b9e8SEric Tang %a = call { <vscale x 4 x i8>, <vscale x 4 x i1> } @llvm.smul.with.overflow.nxv4i8(<vscale x 4 x i8> %x, <vscale x 4 x i8> %y) 559fe6b9e8SEric Tang %b = extractvalue { <vscale x 4 x i8>, <vscale x 4 x i1> } %a, 0 569fe6b9e8SEric Tang %c = extractvalue { <vscale x 4 x i8>, <vscale x 4 x i1> } %a, 1 579fe6b9e8SEric Tang %d = select <vscale x 4 x i1> %c, <vscale x 4 x i8> zeroinitializer, <vscale x 4 x i8> %b 589fe6b9e8SEric Tang ret <vscale x 4 x i8> %d 599fe6b9e8SEric Tang} 609fe6b9e8SEric Tang 619fe6b9e8SEric Tangdeclare { <vscale x 8 x i8>, <vscale x 8 x i1> } @llvm.smul.with.overflow.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>) 629fe6b9e8SEric Tang 639fe6b9e8SEric Tangdefine <vscale x 8 x i8> @smulo_nxv8i8(<vscale x 8 x i8> %x, <vscale x 8 x i8> %y) { 649fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv8i8: 659fe6b9e8SEric Tang; CHECK: # %bb.0: 66*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma 67e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 68e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 69e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v9, v8, 7 70e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 71e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 729fe6b9e8SEric Tang; CHECK-NEXT: ret 739fe6b9e8SEric Tang %a = call { <vscale x 8 x i8>, <vscale x 8 x i1> } @llvm.smul.with.overflow.nxv8i8(<vscale x 8 x i8> %x, <vscale x 8 x i8> %y) 749fe6b9e8SEric Tang %b = extractvalue { <vscale x 8 x i8>, <vscale x 8 x i1> } %a, 0 759fe6b9e8SEric Tang %c = extractvalue { <vscale x 8 x i8>, <vscale x 8 x i1> } %a, 1 769fe6b9e8SEric Tang %d = select <vscale x 8 x i1> %c, <vscale x 8 x i8> zeroinitializer, <vscale x 8 x i8> %b 779fe6b9e8SEric Tang ret <vscale x 8 x i8> %d 789fe6b9e8SEric Tang} 799fe6b9e8SEric Tang 809fe6b9e8SEric Tangdeclare { <vscale x 16 x i8>, <vscale x 16 x i1> } @llvm.smul.with.overflow.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>) 819fe6b9e8SEric Tang 829fe6b9e8SEric Tangdefine <vscale x 16 x i8> @smulo_nxv16i8(<vscale x 16 x i8> %x, <vscale x 16 x i8> %y) { 839fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv16i8: 849fe6b9e8SEric Tang; CHECK: # %bb.0: 85*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma 86e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v12, v8, v10 87e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v10 88e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v10, v8, 7 89e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v12, v10 90e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 919fe6b9e8SEric Tang; CHECK-NEXT: ret 929fe6b9e8SEric Tang %a = call { <vscale x 16 x i8>, <vscale x 16 x i1> } @llvm.smul.with.overflow.nxv16i8(<vscale x 16 x i8> %x, <vscale x 16 x i8> %y) 939fe6b9e8SEric Tang %b = extractvalue { <vscale x 16 x i8>, <vscale x 16 x i1> } %a, 0 949fe6b9e8SEric Tang %c = extractvalue { <vscale x 16 x i8>, <vscale x 16 x i1> } %a, 1 959fe6b9e8SEric Tang %d = select <vscale x 16 x i1> %c, <vscale x 16 x i8> zeroinitializer, <vscale x 16 x i8> %b 969fe6b9e8SEric Tang ret <vscale x 16 x i8> %d 979fe6b9e8SEric Tang} 989fe6b9e8SEric Tang 999fe6b9e8SEric Tangdeclare { <vscale x 32 x i8>, <vscale x 32 x i1> } @llvm.smul.with.overflow.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>) 1009fe6b9e8SEric Tang 1019fe6b9e8SEric Tangdefine <vscale x 32 x i8> @smulo_nxv32i8(<vscale x 32 x i8> %x, <vscale x 32 x i8> %y) { 1029fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv32i8: 1039fe6b9e8SEric Tang; CHECK: # %bb.0: 104*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma 105e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v16, v8, v12 1069fe6b9e8SEric Tang; CHECK-NEXT: vmul.vv v8, v8, v12 1079fe6b9e8SEric Tang; CHECK-NEXT: vsra.vi v12, v8, 7 108e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v16, v12 1099fe6b9e8SEric Tang; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 1109fe6b9e8SEric Tang; CHECK-NEXT: ret 1119fe6b9e8SEric Tang %a = call { <vscale x 32 x i8>, <vscale x 32 x i1> } @llvm.smul.with.overflow.nxv32i8(<vscale x 32 x i8> %x, <vscale x 32 x i8> %y) 1129fe6b9e8SEric Tang %b = extractvalue { <vscale x 32 x i8>, <vscale x 32 x i1> } %a, 0 1139fe6b9e8SEric Tang %c = extractvalue { <vscale x 32 x i8>, <vscale x 32 x i1> } %a, 1 1149fe6b9e8SEric Tang %d = select <vscale x 32 x i1> %c, <vscale x 32 x i8> zeroinitializer, <vscale x 32 x i8> %b 1159fe6b9e8SEric Tang ret <vscale x 32 x i8> %d 1169fe6b9e8SEric Tang} 1179fe6b9e8SEric Tang 1189fe6b9e8SEric Tangdeclare { <vscale x 64 x i8>, <vscale x 64 x i1> } @llvm.smul.with.overflow.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>) 1199fe6b9e8SEric Tang 1209fe6b9e8SEric Tangdefine <vscale x 64 x i8> @smulo_nxv64i8(<vscale x 64 x i8> %x, <vscale x 64 x i8> %y) { 1219fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv64i8: 1229fe6b9e8SEric Tang; CHECK: # %bb.0: 123*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma 1249fe6b9e8SEric Tang; CHECK-NEXT: vmulh.vv v24, v8, v16 1259fe6b9e8SEric Tang; CHECK-NEXT: vmul.vv v8, v8, v16 1269fe6b9e8SEric Tang; CHECK-NEXT: vsra.vi v16, v8, 7 1279fe6b9e8SEric Tang; CHECK-NEXT: vmsne.vv v0, v24, v16 1289fe6b9e8SEric Tang; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 1299fe6b9e8SEric Tang; CHECK-NEXT: ret 1309fe6b9e8SEric Tang %a = call { <vscale x 64 x i8>, <vscale x 64 x i1> } @llvm.smul.with.overflow.nxv64i8(<vscale x 64 x i8> %x, <vscale x 64 x i8> %y) 1319fe6b9e8SEric Tang %b = extractvalue { <vscale x 64 x i8>, <vscale x 64 x i1> } %a, 0 1329fe6b9e8SEric Tang %c = extractvalue { <vscale x 64 x i8>, <vscale x 64 x i1> } %a, 1 1339fe6b9e8SEric Tang %d = select <vscale x 64 x i1> %c, <vscale x 64 x i8> zeroinitializer, <vscale x 64 x i8> %b 1349fe6b9e8SEric Tang ret <vscale x 64 x i8> %d 1359fe6b9e8SEric Tang} 1369fe6b9e8SEric Tang 1379fe6b9e8SEric Tangdeclare { <vscale x 1 x i16>, <vscale x 1 x i1> } @llvm.smul.with.overflow.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>) 1389fe6b9e8SEric Tang 1399fe6b9e8SEric Tangdefine <vscale x 1 x i16> @smulo_nxv1i16(<vscale x 1 x i16> %x, <vscale x 1 x i16> %y) { 1409fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv1i16: 1419fe6b9e8SEric Tang; CHECK: # %bb.0: 142*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma 143e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 144e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 145e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v9, v8, 15 146e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 147e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 1489fe6b9e8SEric Tang; CHECK-NEXT: ret 1499fe6b9e8SEric Tang %a = call { <vscale x 1 x i16>, <vscale x 1 x i1> } @llvm.smul.with.overflow.nxv1i16(<vscale x 1 x i16> %x, <vscale x 1 x i16> %y) 1509fe6b9e8SEric Tang %b = extractvalue { <vscale x 1 x i16>, <vscale x 1 x i1> } %a, 0 1519fe6b9e8SEric Tang %c = extractvalue { <vscale x 1 x i16>, <vscale x 1 x i1> } %a, 1 1529fe6b9e8SEric Tang %d = select <vscale x 1 x i1> %c, <vscale x 1 x i16> zeroinitializer, <vscale x 1 x i16> %b 1539fe6b9e8SEric Tang ret <vscale x 1 x i16> %d 1549fe6b9e8SEric Tang} 1559fe6b9e8SEric Tang 1569fe6b9e8SEric Tangdeclare { <vscale x 2 x i16>, <vscale x 2 x i1> } @llvm.smul.with.overflow.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>) 1579fe6b9e8SEric Tang 1589fe6b9e8SEric Tangdefine <vscale x 2 x i16> @smulo_nxv2i16(<vscale x 2 x i16> %x, <vscale x 2 x i16> %y) { 1599fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv2i16: 1609fe6b9e8SEric Tang; CHECK: # %bb.0: 161*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma 162e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 163e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 164e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v9, v8, 15 165e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 166e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 1679fe6b9e8SEric Tang; CHECK-NEXT: ret 1689fe6b9e8SEric Tang %a = call { <vscale x 2 x i16>, <vscale x 2 x i1> } @llvm.smul.with.overflow.nxv2i16(<vscale x 2 x i16> %x, <vscale x 2 x i16> %y) 1699fe6b9e8SEric Tang %b = extractvalue { <vscale x 2 x i16>, <vscale x 2 x i1> } %a, 0 1709fe6b9e8SEric Tang %c = extractvalue { <vscale x 2 x i16>, <vscale x 2 x i1> } %a, 1 1719fe6b9e8SEric Tang %d = select <vscale x 2 x i1> %c, <vscale x 2 x i16> zeroinitializer, <vscale x 2 x i16> %b 1729fe6b9e8SEric Tang ret <vscale x 2 x i16> %d 1739fe6b9e8SEric Tang} 1749fe6b9e8SEric Tang 1759fe6b9e8SEric Tangdeclare { <vscale x 4 x i16>, <vscale x 4 x i1> } @llvm.smul.with.overflow.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>) 1769fe6b9e8SEric Tang 1779fe6b9e8SEric Tangdefine <vscale x 4 x i16> @smulo_nxv4i16(<vscale x 4 x i16> %x, <vscale x 4 x i16> %y) { 1789fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv4i16: 1799fe6b9e8SEric Tang; CHECK: # %bb.0: 180*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma 181e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 182e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 183e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v9, v8, 15 184e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 185e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 1869fe6b9e8SEric Tang; CHECK-NEXT: ret 1879fe6b9e8SEric Tang %a = call { <vscale x 4 x i16>, <vscale x 4 x i1> } @llvm.smul.with.overflow.nxv4i16(<vscale x 4 x i16> %x, <vscale x 4 x i16> %y) 1889fe6b9e8SEric Tang %b = extractvalue { <vscale x 4 x i16>, <vscale x 4 x i1> } %a, 0 1899fe6b9e8SEric Tang %c = extractvalue { <vscale x 4 x i16>, <vscale x 4 x i1> } %a, 1 1909fe6b9e8SEric Tang %d = select <vscale x 4 x i1> %c, <vscale x 4 x i16> zeroinitializer, <vscale x 4 x i16> %b 1919fe6b9e8SEric Tang ret <vscale x 4 x i16> %d 1929fe6b9e8SEric Tang} 1939fe6b9e8SEric Tang 1949fe6b9e8SEric Tangdeclare { <vscale x 8 x i16>, <vscale x 8 x i1> } @llvm.smul.with.overflow.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>) 1959fe6b9e8SEric Tang 1969fe6b9e8SEric Tangdefine <vscale x 8 x i16> @smulo_nxv8i16(<vscale x 8 x i16> %x, <vscale x 8 x i16> %y) { 1979fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv8i16: 1989fe6b9e8SEric Tang; CHECK: # %bb.0: 199*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma 200e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v12, v8, v10 201e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v10 202e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v10, v8, 15 203e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v12, v10 204e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 2059fe6b9e8SEric Tang; CHECK-NEXT: ret 2069fe6b9e8SEric Tang %a = call { <vscale x 8 x i16>, <vscale x 8 x i1> } @llvm.smul.with.overflow.nxv8i16(<vscale x 8 x i16> %x, <vscale x 8 x i16> %y) 2079fe6b9e8SEric Tang %b = extractvalue { <vscale x 8 x i16>, <vscale x 8 x i1> } %a, 0 2089fe6b9e8SEric Tang %c = extractvalue { <vscale x 8 x i16>, <vscale x 8 x i1> } %a, 1 2099fe6b9e8SEric Tang %d = select <vscale x 8 x i1> %c, <vscale x 8 x i16> zeroinitializer, <vscale x 8 x i16> %b 2109fe6b9e8SEric Tang ret <vscale x 8 x i16> %d 2119fe6b9e8SEric Tang} 2129fe6b9e8SEric Tang 2139fe6b9e8SEric Tangdeclare { <vscale x 16 x i16>, <vscale x 16 x i1> } @llvm.smul.with.overflow.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>) 2149fe6b9e8SEric Tang 2159fe6b9e8SEric Tangdefine <vscale x 16 x i16> @smulo_nxv16i16(<vscale x 16 x i16> %x, <vscale x 16 x i16> %y) { 2169fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv16i16: 2179fe6b9e8SEric Tang; CHECK: # %bb.0: 218*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma 219e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v16, v8, v12 2209fe6b9e8SEric Tang; CHECK-NEXT: vmul.vv v8, v8, v12 2219fe6b9e8SEric Tang; CHECK-NEXT: vsra.vi v12, v8, 15 222e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v16, v12 2239fe6b9e8SEric Tang; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 2249fe6b9e8SEric Tang; CHECK-NEXT: ret 2259fe6b9e8SEric Tang %a = call { <vscale x 16 x i16>, <vscale x 16 x i1> } @llvm.smul.with.overflow.nxv16i16(<vscale x 16 x i16> %x, <vscale x 16 x i16> %y) 2269fe6b9e8SEric Tang %b = extractvalue { <vscale x 16 x i16>, <vscale x 16 x i1> } %a, 0 2279fe6b9e8SEric Tang %c = extractvalue { <vscale x 16 x i16>, <vscale x 16 x i1> } %a, 1 2289fe6b9e8SEric Tang %d = select <vscale x 16 x i1> %c, <vscale x 16 x i16> zeroinitializer, <vscale x 16 x i16> %b 2299fe6b9e8SEric Tang ret <vscale x 16 x i16> %d 2309fe6b9e8SEric Tang} 2319fe6b9e8SEric Tang 2329fe6b9e8SEric Tangdeclare { <vscale x 32 x i16>, <vscale x 32 x i1> } @llvm.smul.with.overflow.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>) 2339fe6b9e8SEric Tang 2349fe6b9e8SEric Tangdefine <vscale x 32 x i16> @smulo_nxv32i16(<vscale x 32 x i16> %x, <vscale x 32 x i16> %y) { 2359fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv32i16: 2369fe6b9e8SEric Tang; CHECK: # %bb.0: 237*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma 2389fe6b9e8SEric Tang; CHECK-NEXT: vmulh.vv v24, v8, v16 2399fe6b9e8SEric Tang; CHECK-NEXT: vmul.vv v8, v8, v16 2409fe6b9e8SEric Tang; CHECK-NEXT: vsra.vi v16, v8, 15 2419fe6b9e8SEric Tang; CHECK-NEXT: vmsne.vv v0, v24, v16 2429fe6b9e8SEric Tang; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 2439fe6b9e8SEric Tang; CHECK-NEXT: ret 2449fe6b9e8SEric Tang %a = call { <vscale x 32 x i16>, <vscale x 32 x i1> } @llvm.smul.with.overflow.nxv32i16(<vscale x 32 x i16> %x, <vscale x 32 x i16> %y) 2459fe6b9e8SEric Tang %b = extractvalue { <vscale x 32 x i16>, <vscale x 32 x i1> } %a, 0 2469fe6b9e8SEric Tang %c = extractvalue { <vscale x 32 x i16>, <vscale x 32 x i1> } %a, 1 2479fe6b9e8SEric Tang %d = select <vscale x 32 x i1> %c, <vscale x 32 x i16> zeroinitializer, <vscale x 32 x i16> %b 2489fe6b9e8SEric Tang ret <vscale x 32 x i16> %d 2499fe6b9e8SEric Tang} 2509fe6b9e8SEric Tang 2519fe6b9e8SEric Tangdeclare { <vscale x 1 x i32>, <vscale x 1 x i1> } @llvm.smul.with.overflow.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>) 2529fe6b9e8SEric Tang 2539fe6b9e8SEric Tangdefine <vscale x 1 x i32> @smulo_nxv1i32(<vscale x 1 x i32> %x, <vscale x 1 x i32> %y) { 2549fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv1i32: 2559fe6b9e8SEric Tang; CHECK: # %bb.0: 256*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma 257e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 258e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 259e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v9, v8, 31 260e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 261e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 2629fe6b9e8SEric Tang; CHECK-NEXT: ret 2639fe6b9e8SEric Tang %a = call { <vscale x 1 x i32>, <vscale x 1 x i1> } @llvm.smul.with.overflow.nxv1i32(<vscale x 1 x i32> %x, <vscale x 1 x i32> %y) 2649fe6b9e8SEric Tang %b = extractvalue { <vscale x 1 x i32>, <vscale x 1 x i1> } %a, 0 2659fe6b9e8SEric Tang %c = extractvalue { <vscale x 1 x i32>, <vscale x 1 x i1> } %a, 1 2669fe6b9e8SEric Tang %d = select <vscale x 1 x i1> %c, <vscale x 1 x i32> zeroinitializer, <vscale x 1 x i32> %b 2679fe6b9e8SEric Tang ret <vscale x 1 x i32> %d 2689fe6b9e8SEric Tang} 2699fe6b9e8SEric Tang 2709fe6b9e8SEric Tangdeclare { <vscale x 2 x i32>, <vscale x 2 x i1> } @llvm.smul.with.overflow.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>) 2719fe6b9e8SEric Tang 2729fe6b9e8SEric Tangdefine <vscale x 2 x i32> @smulo_nxv2i32(<vscale x 2 x i32> %x, <vscale x 2 x i32> %y) { 2739fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv2i32: 2749fe6b9e8SEric Tang; CHECK: # %bb.0: 275*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma 276e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 277e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 278e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v9, v8, 31 279e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 280e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 2819fe6b9e8SEric Tang; CHECK-NEXT: ret 2829fe6b9e8SEric Tang %a = call { <vscale x 2 x i32>, <vscale x 2 x i1> } @llvm.smul.with.overflow.nxv2i32(<vscale x 2 x i32> %x, <vscale x 2 x i32> %y) 2839fe6b9e8SEric Tang %b = extractvalue { <vscale x 2 x i32>, <vscale x 2 x i1> } %a, 0 2849fe6b9e8SEric Tang %c = extractvalue { <vscale x 2 x i32>, <vscale x 2 x i1> } %a, 1 2859fe6b9e8SEric Tang %d = select <vscale x 2 x i1> %c, <vscale x 2 x i32> zeroinitializer, <vscale x 2 x i32> %b 2869fe6b9e8SEric Tang ret <vscale x 2 x i32> %d 2879fe6b9e8SEric Tang} 2889fe6b9e8SEric Tang 2899fe6b9e8SEric Tangdeclare { <vscale x 4 x i32>, <vscale x 4 x i1> } @llvm.smul.with.overflow.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>) 2909fe6b9e8SEric Tang 2919fe6b9e8SEric Tangdefine <vscale x 4 x i32> @smulo_nxv4i32(<vscale x 4 x i32> %x, <vscale x 4 x i32> %y) { 2929fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv4i32: 2939fe6b9e8SEric Tang; CHECK: # %bb.0: 294*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma 295e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v12, v8, v10 296e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v10 297e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vi v10, v8, 31 298e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v12, v10 299e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 3009fe6b9e8SEric Tang; CHECK-NEXT: ret 3019fe6b9e8SEric Tang %a = call { <vscale x 4 x i32>, <vscale x 4 x i1> } @llvm.smul.with.overflow.nxv4i32(<vscale x 4 x i32> %x, <vscale x 4 x i32> %y) 3029fe6b9e8SEric Tang %b = extractvalue { <vscale x 4 x i32>, <vscale x 4 x i1> } %a, 0 3039fe6b9e8SEric Tang %c = extractvalue { <vscale x 4 x i32>, <vscale x 4 x i1> } %a, 1 3049fe6b9e8SEric Tang %d = select <vscale x 4 x i1> %c, <vscale x 4 x i32> zeroinitializer, <vscale x 4 x i32> %b 3059fe6b9e8SEric Tang ret <vscale x 4 x i32> %d 3069fe6b9e8SEric Tang} 3079fe6b9e8SEric Tang 3089fe6b9e8SEric Tangdeclare { <vscale x 8 x i32>, <vscale x 8 x i1> } @llvm.smul.with.overflow.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>) 3099fe6b9e8SEric Tang 3109fe6b9e8SEric Tangdefine <vscale x 8 x i32> @smulo_nxv8i32(<vscale x 8 x i32> %x, <vscale x 8 x i32> %y) { 3119fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv8i32: 3129fe6b9e8SEric Tang; CHECK: # %bb.0: 313*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma 314e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v16, v8, v12 3159fe6b9e8SEric Tang; CHECK-NEXT: vmul.vv v8, v8, v12 3169fe6b9e8SEric Tang; CHECK-NEXT: vsra.vi v12, v8, 31 317e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v16, v12 3189fe6b9e8SEric Tang; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 3199fe6b9e8SEric Tang; CHECK-NEXT: ret 3209fe6b9e8SEric Tang %a = call { <vscale x 8 x i32>, <vscale x 8 x i1> } @llvm.smul.with.overflow.nxv8i32(<vscale x 8 x i32> %x, <vscale x 8 x i32> %y) 3219fe6b9e8SEric Tang %b = extractvalue { <vscale x 8 x i32>, <vscale x 8 x i1> } %a, 0 3229fe6b9e8SEric Tang %c = extractvalue { <vscale x 8 x i32>, <vscale x 8 x i1> } %a, 1 3239fe6b9e8SEric Tang %d = select <vscale x 8 x i1> %c, <vscale x 8 x i32> zeroinitializer, <vscale x 8 x i32> %b 3249fe6b9e8SEric Tang ret <vscale x 8 x i32> %d 3259fe6b9e8SEric Tang} 3269fe6b9e8SEric Tang 3279fe6b9e8SEric Tangdeclare { <vscale x 16 x i32>, <vscale x 16 x i1> } @llvm.smul.with.overflow.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>) 3289fe6b9e8SEric Tang 3299fe6b9e8SEric Tangdefine <vscale x 16 x i32> @smulo_nxv16i32(<vscale x 16 x i32> %x, <vscale x 16 x i32> %y) { 3309fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv16i32: 3319fe6b9e8SEric Tang; CHECK: # %bb.0: 332*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma 3339fe6b9e8SEric Tang; CHECK-NEXT: vmulh.vv v24, v8, v16 3349fe6b9e8SEric Tang; CHECK-NEXT: vmul.vv v8, v8, v16 3359fe6b9e8SEric Tang; CHECK-NEXT: vsra.vi v16, v8, 31 3369fe6b9e8SEric Tang; CHECK-NEXT: vmsne.vv v0, v24, v16 3379fe6b9e8SEric Tang; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 3389fe6b9e8SEric Tang; CHECK-NEXT: ret 3399fe6b9e8SEric Tang %a = call { <vscale x 16 x i32>, <vscale x 16 x i1> } @llvm.smul.with.overflow.nxv16i32(<vscale x 16 x i32> %x, <vscale x 16 x i32> %y) 3409fe6b9e8SEric Tang %b = extractvalue { <vscale x 16 x i32>, <vscale x 16 x i1> } %a, 0 3419fe6b9e8SEric Tang %c = extractvalue { <vscale x 16 x i32>, <vscale x 16 x i1> } %a, 1 3429fe6b9e8SEric Tang %d = select <vscale x 16 x i1> %c, <vscale x 16 x i32> zeroinitializer, <vscale x 16 x i32> %b 3439fe6b9e8SEric Tang ret <vscale x 16 x i32> %d 3449fe6b9e8SEric Tang} 3459fe6b9e8SEric Tang 3469fe6b9e8SEric Tangdeclare { <vscale x 1 x i64>, <vscale x 1 x i1> } @llvm.smul.with.overflow.nxv1i64(<vscale x 1 x i64>, <vscale x 1 x i64>) 3479fe6b9e8SEric Tang 3489fe6b9e8SEric Tangdefine <vscale x 1 x i64> @smulo_nxv1i64(<vscale x 1 x i64> %x, <vscale x 1 x i64> %y) { 3499fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv1i64: 3509fe6b9e8SEric Tang; CHECK: # %bb.0: 351*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma 352e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v10, v8, v9 353e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v9 354af0ecfccSwangpc; CHECK-NEXT: li a0, 63 355e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vx v9, v8, a0 356e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v10, v9 357e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 3589fe6b9e8SEric Tang; CHECK-NEXT: ret 3599fe6b9e8SEric Tang %a = call { <vscale x 1 x i64>, <vscale x 1 x i1> } @llvm.smul.with.overflow.nxv1i64(<vscale x 1 x i64> %x, <vscale x 1 x i64> %y) 3609fe6b9e8SEric Tang %b = extractvalue { <vscale x 1 x i64>, <vscale x 1 x i1> } %a, 0 3619fe6b9e8SEric Tang %c = extractvalue { <vscale x 1 x i64>, <vscale x 1 x i1> } %a, 1 3629fe6b9e8SEric Tang %d = select <vscale x 1 x i1> %c, <vscale x 1 x i64> zeroinitializer, <vscale x 1 x i64> %b 3639fe6b9e8SEric Tang ret <vscale x 1 x i64> %d 3649fe6b9e8SEric Tang} 3659fe6b9e8SEric Tang 3669fe6b9e8SEric Tangdeclare { <vscale x 2 x i64>, <vscale x 2 x i1> } @llvm.smul.with.overflow.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>) 3679fe6b9e8SEric Tang 3689fe6b9e8SEric Tangdefine <vscale x 2 x i64> @smulo_nxv2i64(<vscale x 2 x i64> %x, <vscale x 2 x i64> %y) { 3699fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv2i64: 3709fe6b9e8SEric Tang; CHECK: # %bb.0: 371*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma 372e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v12, v8, v10 373e1acbda1SFraser Cormack; CHECK-NEXT: vmul.vv v8, v8, v10 374af0ecfccSwangpc; CHECK-NEXT: li a0, 63 375e1acbda1SFraser Cormack; CHECK-NEXT: vsra.vx v10, v8, a0 376e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v12, v10 377e1acbda1SFraser Cormack; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 3789fe6b9e8SEric Tang; CHECK-NEXT: ret 3799fe6b9e8SEric Tang %a = call { <vscale x 2 x i64>, <vscale x 2 x i1> } @llvm.smul.with.overflow.nxv2i64(<vscale x 2 x i64> %x, <vscale x 2 x i64> %y) 3809fe6b9e8SEric Tang %b = extractvalue { <vscale x 2 x i64>, <vscale x 2 x i1> } %a, 0 3819fe6b9e8SEric Tang %c = extractvalue { <vscale x 2 x i64>, <vscale x 2 x i1> } %a, 1 3829fe6b9e8SEric Tang %d = select <vscale x 2 x i1> %c, <vscale x 2 x i64> zeroinitializer, <vscale x 2 x i64> %b 3839fe6b9e8SEric Tang ret <vscale x 2 x i64> %d 3849fe6b9e8SEric Tang} 3859fe6b9e8SEric Tang 3869fe6b9e8SEric Tangdeclare { <vscale x 4 x i64>, <vscale x 4 x i1> } @llvm.smul.with.overflow.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>) 3879fe6b9e8SEric Tang 3889fe6b9e8SEric Tangdefine <vscale x 4 x i64> @smulo_nxv4i64(<vscale x 4 x i64> %x, <vscale x 4 x i64> %y) { 3899fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv4i64: 3909fe6b9e8SEric Tang; CHECK: # %bb.0: 391*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma 392e1acbda1SFraser Cormack; CHECK-NEXT: vmulh.vv v16, v8, v12 3939fe6b9e8SEric Tang; CHECK-NEXT: vmul.vv v8, v8, v12 394af0ecfccSwangpc; CHECK-NEXT: li a0, 63 3959fe6b9e8SEric Tang; CHECK-NEXT: vsra.vx v12, v8, a0 396e1acbda1SFraser Cormack; CHECK-NEXT: vmsne.vv v0, v16, v12 3979fe6b9e8SEric Tang; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 3989fe6b9e8SEric Tang; CHECK-NEXT: ret 3999fe6b9e8SEric Tang %a = call { <vscale x 4 x i64>, <vscale x 4 x i1> } @llvm.smul.with.overflow.nxv4i64(<vscale x 4 x i64> %x, <vscale x 4 x i64> %y) 4009fe6b9e8SEric Tang %b = extractvalue { <vscale x 4 x i64>, <vscale x 4 x i1> } %a, 0 4019fe6b9e8SEric Tang %c = extractvalue { <vscale x 4 x i64>, <vscale x 4 x i1> } %a, 1 4029fe6b9e8SEric Tang %d = select <vscale x 4 x i1> %c, <vscale x 4 x i64> zeroinitializer, <vscale x 4 x i64> %b 4039fe6b9e8SEric Tang ret <vscale x 4 x i64> %d 4049fe6b9e8SEric Tang} 4059fe6b9e8SEric Tang 4069fe6b9e8SEric Tangdeclare { <vscale x 8 x i64>, <vscale x 8 x i1> } @llvm.smul.with.overflow.nxv8i64(<vscale x 8 x i64>, <vscale x 8 x i64>) 4079fe6b9e8SEric Tang 4089fe6b9e8SEric Tangdefine <vscale x 8 x i64> @smulo_nxv8i64(<vscale x 8 x i64> %x, <vscale x 8 x i64> %y) { 4099fe6b9e8SEric Tang; CHECK-LABEL: smulo_nxv8i64: 4109fe6b9e8SEric Tang; CHECK: # %bb.0: 411*d89d45caSPhilip Reames; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma 4129fe6b9e8SEric Tang; CHECK-NEXT: vmulh.vv v24, v8, v16 4139fe6b9e8SEric Tang; CHECK-NEXT: vmul.vv v8, v8, v16 414af0ecfccSwangpc; CHECK-NEXT: li a0, 63 4159fe6b9e8SEric Tang; CHECK-NEXT: vsra.vx v16, v8, a0 4169fe6b9e8SEric Tang; CHECK-NEXT: vmsne.vv v0, v24, v16 4179fe6b9e8SEric Tang; CHECK-NEXT: vmerge.vim v8, v8, 0, v0 4189fe6b9e8SEric Tang; CHECK-NEXT: ret 4199fe6b9e8SEric Tang %a = call { <vscale x 8 x i64>, <vscale x 8 x i1> } @llvm.smul.with.overflow.nxv8i64(<vscale x 8 x i64> %x, <vscale x 8 x i64> %y) 4209fe6b9e8SEric Tang %b = extractvalue { <vscale x 8 x i64>, <vscale x 8 x i1> } %a, 0 4219fe6b9e8SEric Tang %c = extractvalue { <vscale x 8 x i64>, <vscale x 8 x i1> } %a, 1 4229fe6b9e8SEric Tang %d = select <vscale x 8 x i1> %c, <vscale x 8 x i64> zeroinitializer, <vscale x 8 x i64> %b 4239fe6b9e8SEric Tang ret <vscale x 8 x i64> %d 4249fe6b9e8SEric Tang} 425