3540 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; Test vector intrinsics.3;4; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s5 6declare i32 @llvm.s390.lcbb(ptr, i32)7declare <16 x i8> @llvm.s390.vlbb(ptr, i32)8declare <16 x i8> @llvm.s390.vll(i32, ptr)9declare <2 x i64> @llvm.s390.vpdi(<2 x i64>, <2 x i64>, i32)10declare <16 x i8> @llvm.s390.vperm(<16 x i8>, <16 x i8>, <16 x i8>)11declare <16 x i8> @llvm.s390.vpksh(<8 x i16>, <8 x i16>)12declare <8 x i16> @llvm.s390.vpksf(<4 x i32>, <4 x i32>)13declare <4 x i32> @llvm.s390.vpksg(<2 x i64>, <2 x i64>)14declare {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16>, <8 x i16>)15declare {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32>, <4 x i32>)16declare {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64>, <2 x i64>)17declare <16 x i8> @llvm.s390.vpklsh(<8 x i16>, <8 x i16>)18declare <8 x i16> @llvm.s390.vpklsf(<4 x i32>, <4 x i32>)19declare <4 x i32> @llvm.s390.vpklsg(<2 x i64>, <2 x i64>)20declare {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16>, <8 x i16>)21declare {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32>, <4 x i32>)22declare {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64>, <2 x i64>)23declare void @llvm.s390.vstl(<16 x i8>, i32, ptr)24declare <8 x i16> @llvm.s390.vuphb(<16 x i8>)25declare <4 x i32> @llvm.s390.vuphh(<8 x i16>)26declare <2 x i64> @llvm.s390.vuphf(<4 x i32>)27declare <8 x i16> @llvm.s390.vuplhb(<16 x i8>)28declare <4 x i32> @llvm.s390.vuplhh(<8 x i16>)29declare <2 x i64> @llvm.s390.vuplhf(<4 x i32>)30declare <8 x i16> @llvm.s390.vuplb(<16 x i8>)31declare <4 x i32> @llvm.s390.vuplhw(<8 x i16>)32declare <2 x i64> @llvm.s390.vuplf(<4 x i32>)33declare <8 x i16> @llvm.s390.vupllb(<16 x i8>)34declare <4 x i32> @llvm.s390.vupllh(<8 x i16>)35declare <2 x i64> @llvm.s390.vupllf(<4 x i32>)36declare <16 x i8> @llvm.s390.vaccb(<16 x i8>, <16 x i8>)37declare <8 x i16> @llvm.s390.vacch(<8 x i16>, <8 x i16>)38declare <4 x i32> @llvm.s390.vaccf(<4 x i32>, <4 x i32>)39declare <2 x i64> @llvm.s390.vaccg(<2 x i64>, <2 x i64>)40declare i128 @llvm.s390.vaq(i128, i128)41declare i128 @llvm.s390.vacq(i128, i128, i128)42declare i128 @llvm.s390.vaccq(i128, i128)43declare i128 @llvm.s390.vacccq(i128, i128, i128)44declare <16 x i8> @llvm.s390.vavgb(<16 x i8>, <16 x i8>)45declare <8 x i16> @llvm.s390.vavgh(<8 x i16>, <8 x i16>)46declare <4 x i32> @llvm.s390.vavgf(<4 x i32>, <4 x i32>)47declare <2 x i64> @llvm.s390.vavgg(<2 x i64>, <2 x i64>)48declare <16 x i8> @llvm.s390.vavglb(<16 x i8>, <16 x i8>)49declare <8 x i16> @llvm.s390.vavglh(<8 x i16>, <8 x i16>)50declare <4 x i32> @llvm.s390.vavglf(<4 x i32>, <4 x i32>)51declare <2 x i64> @llvm.s390.vavglg(<2 x i64>, <2 x i64>)52declare <4 x i32> @llvm.s390.vcksm(<4 x i32>, <4 x i32>)53declare <8 x i16> @llvm.s390.vgfmb(<16 x i8>, <16 x i8>)54declare <4 x i32> @llvm.s390.vgfmh(<8 x i16>, <8 x i16>)55declare <2 x i64> @llvm.s390.vgfmf(<4 x i32>, <4 x i32>)56declare i128 @llvm.s390.vgfmg(<2 x i64>, <2 x i64>)57declare <8 x i16> @llvm.s390.vgfmab(<16 x i8>, <16 x i8>, <8 x i16>)58declare <4 x i32> @llvm.s390.vgfmah(<8 x i16>, <8 x i16>, <4 x i32>)59declare <2 x i64> @llvm.s390.vgfmaf(<4 x i32>, <4 x i32>, <2 x i64>)60declare i128 @llvm.s390.vgfmag(<2 x i64>, <2 x i64>, i128)61declare <16 x i8> @llvm.s390.vmahb(<16 x i8>, <16 x i8>, <16 x i8>)62declare <8 x i16> @llvm.s390.vmahh(<8 x i16>, <8 x i16>, <8 x i16>)63declare <4 x i32> @llvm.s390.vmahf(<4 x i32>, <4 x i32>, <4 x i32>)64declare <16 x i8> @llvm.s390.vmalhb(<16 x i8>, <16 x i8>, <16 x i8>)65declare <8 x i16> @llvm.s390.vmalhh(<8 x i16>, <8 x i16>, <8 x i16>)66declare <4 x i32> @llvm.s390.vmalhf(<4 x i32>, <4 x i32>, <4 x i32>)67declare <8 x i16> @llvm.s390.vmaeb(<16 x i8>, <16 x i8>, <8 x i16>)68declare <4 x i32> @llvm.s390.vmaeh(<8 x i16>, <8 x i16>, <4 x i32>)69declare <2 x i64> @llvm.s390.vmaef(<4 x i32>, <4 x i32>, <2 x i64>)70declare <8 x i16> @llvm.s390.vmaleb(<16 x i8>, <16 x i8>, <8 x i16>)71declare <4 x i32> @llvm.s390.vmaleh(<8 x i16>, <8 x i16>, <4 x i32>)72declare <2 x i64> @llvm.s390.vmalef(<4 x i32>, <4 x i32>, <2 x i64>)73declare <8 x i16> @llvm.s390.vmaob(<16 x i8>, <16 x i8>, <8 x i16>)74declare <4 x i32> @llvm.s390.vmaoh(<8 x i16>, <8 x i16>, <4 x i32>)75declare <2 x i64> @llvm.s390.vmaof(<4 x i32>, <4 x i32>, <2 x i64>)76declare <8 x i16> @llvm.s390.vmalob(<16 x i8>, <16 x i8>, <8 x i16>)77declare <4 x i32> @llvm.s390.vmaloh(<8 x i16>, <8 x i16>, <4 x i32>)78declare <2 x i64> @llvm.s390.vmalof(<4 x i32>, <4 x i32>, <2 x i64>)79declare <16 x i8> @llvm.s390.vmhb(<16 x i8>, <16 x i8>)80declare <8 x i16> @llvm.s390.vmhh(<8 x i16>, <8 x i16>)81declare <4 x i32> @llvm.s390.vmhf(<4 x i32>, <4 x i32>)82declare <16 x i8> @llvm.s390.vmlhb(<16 x i8>, <16 x i8>)83declare <8 x i16> @llvm.s390.vmlhh(<8 x i16>, <8 x i16>)84declare <4 x i32> @llvm.s390.vmlhf(<4 x i32>, <4 x i32>)85declare <8 x i16> @llvm.s390.vmeb(<16 x i8>, <16 x i8>)86declare <4 x i32> @llvm.s390.vmeh(<8 x i16>, <8 x i16>)87declare <2 x i64> @llvm.s390.vmef(<4 x i32>, <4 x i32>)88declare <8 x i16> @llvm.s390.vmleb(<16 x i8>, <16 x i8>)89declare <4 x i32> @llvm.s390.vmleh(<8 x i16>, <8 x i16>)90declare <2 x i64> @llvm.s390.vmlef(<4 x i32>, <4 x i32>)91declare <8 x i16> @llvm.s390.vmob(<16 x i8>, <16 x i8>)92declare <4 x i32> @llvm.s390.vmoh(<8 x i16>, <8 x i16>)93declare <2 x i64> @llvm.s390.vmof(<4 x i32>, <4 x i32>)94declare <8 x i16> @llvm.s390.vmlob(<16 x i8>, <16 x i8>)95declare <4 x i32> @llvm.s390.vmloh(<8 x i16>, <8 x i16>)96declare <2 x i64> @llvm.s390.vmlof(<4 x i32>, <4 x i32>)97declare <16 x i8> @llvm.s390.verimb(<16 x i8>, <16 x i8>, <16 x i8>, i32)98declare <8 x i16> @llvm.s390.verimh(<8 x i16>, <8 x i16>, <8 x i16>, i32)99declare <4 x i32> @llvm.s390.verimf(<4 x i32>, <4 x i32>, <4 x i32>, i32)100declare <2 x i64> @llvm.s390.verimg(<2 x i64>, <2 x i64>, <2 x i64>, i32)101declare <16 x i8> @llvm.s390.vsl(<16 x i8>, <16 x i8>)102declare <16 x i8> @llvm.s390.vslb(<16 x i8>, <16 x i8>)103declare <16 x i8> @llvm.s390.vsra(<16 x i8>, <16 x i8>)104declare <16 x i8> @llvm.s390.vsrab(<16 x i8>, <16 x i8>)105declare <16 x i8> @llvm.s390.vsrl(<16 x i8>, <16 x i8>)106declare <16 x i8> @llvm.s390.vsrlb(<16 x i8>, <16 x i8>)107declare <16 x i8> @llvm.s390.vsldb(<16 x i8>, <16 x i8>, i32)108declare <16 x i8> @llvm.s390.vscbib(<16 x i8>, <16 x i8>)109declare <8 x i16> @llvm.s390.vscbih(<8 x i16>, <8 x i16>)110declare <4 x i32> @llvm.s390.vscbif(<4 x i32>, <4 x i32>)111declare <2 x i64> @llvm.s390.vscbig(<2 x i64>, <2 x i64>)112declare i128 @llvm.s390.vsq(i128, i128)113declare i128 @llvm.s390.vsbiq(i128, i128, i128)114declare i128 @llvm.s390.vscbiq(i128, i128)115declare i128 @llvm.s390.vsbcbiq(i128, i128, i128)116declare <4 x i32> @llvm.s390.vsumb(<16 x i8>, <16 x i8>)117declare <4 x i32> @llvm.s390.vsumh(<8 x i16>, <8 x i16>)118declare <2 x i64> @llvm.s390.vsumgh(<8 x i16>, <8 x i16>)119declare <2 x i64> @llvm.s390.vsumgf(<4 x i32>, <4 x i32>)120declare i128 @llvm.s390.vsumqf(<4 x i32>, <4 x i32>)121declare i128 @llvm.s390.vsumqg(<2 x i64>, <2 x i64>)122declare i32 @llvm.s390.vtm(<16 x i8>, <16 x i8>)123declare {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8>, <16 x i8>)124declare {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16>, <8 x i16>)125declare {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32>, <4 x i32>)126declare {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64>, <2 x i64>)127declare {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8>, <16 x i8>)128declare {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16>, <8 x i16>)129declare {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32>, <4 x i32>)130declare {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64>, <2 x i64>)131declare {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8>, <16 x i8>)132declare {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16>, <8 x i16>)133declare {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32>, <4 x i32>)134declare {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64>, <2 x i64>)135declare <16 x i8> @llvm.s390.vfaeb(<16 x i8>, <16 x i8>, i32)136declare <8 x i16> @llvm.s390.vfaeh(<8 x i16>, <8 x i16>, i32)137declare <4 x i32> @llvm.s390.vfaef(<4 x i32>, <4 x i32>, i32)138declare {<16 x i8>, i32} @llvm.s390.vfaebs(<16 x i8>, <16 x i8>, i32)139declare {<8 x i16>, i32} @llvm.s390.vfaehs(<8 x i16>, <8 x i16>, i32)140declare {<4 x i32>, i32} @llvm.s390.vfaefs(<4 x i32>, <4 x i32>, i32)141declare <16 x i8> @llvm.s390.vfaezb(<16 x i8>, <16 x i8>, i32)142declare <8 x i16> @llvm.s390.vfaezh(<8 x i16>, <8 x i16>, i32)143declare <4 x i32> @llvm.s390.vfaezf(<4 x i32>, <4 x i32>, i32)144declare {<16 x i8>, i32} @llvm.s390.vfaezbs(<16 x i8>, <16 x i8>, i32)145declare {<8 x i16>, i32} @llvm.s390.vfaezhs(<8 x i16>, <8 x i16>, i32)146declare {<4 x i32>, i32} @llvm.s390.vfaezfs(<4 x i32>, <4 x i32>, i32)147declare <16 x i8> @llvm.s390.vfeeb(<16 x i8>, <16 x i8>)148declare <8 x i16> @llvm.s390.vfeeh(<8 x i16>, <8 x i16>)149declare <4 x i32> @llvm.s390.vfeef(<4 x i32>, <4 x i32>)150declare {<16 x i8>, i32} @llvm.s390.vfeebs(<16 x i8>, <16 x i8>)151declare {<8 x i16>, i32} @llvm.s390.vfeehs(<8 x i16>, <8 x i16>)152declare {<4 x i32>, i32} @llvm.s390.vfeefs(<4 x i32>, <4 x i32>)153declare <16 x i8> @llvm.s390.vfeezb(<16 x i8>, <16 x i8>)154declare <8 x i16> @llvm.s390.vfeezh(<8 x i16>, <8 x i16>)155declare <4 x i32> @llvm.s390.vfeezf(<4 x i32>, <4 x i32>)156declare {<16 x i8>, i32} @llvm.s390.vfeezbs(<16 x i8>, <16 x i8>)157declare {<8 x i16>, i32} @llvm.s390.vfeezhs(<8 x i16>, <8 x i16>)158declare {<4 x i32>, i32} @llvm.s390.vfeezfs(<4 x i32>, <4 x i32>)159declare <16 x i8> @llvm.s390.vfeneb(<16 x i8>, <16 x i8>)160declare <8 x i16> @llvm.s390.vfeneh(<8 x i16>, <8 x i16>)161declare <4 x i32> @llvm.s390.vfenef(<4 x i32>, <4 x i32>)162declare {<16 x i8>, i32} @llvm.s390.vfenebs(<16 x i8>, <16 x i8>)163declare {<8 x i16>, i32} @llvm.s390.vfenehs(<8 x i16>, <8 x i16>)164declare {<4 x i32>, i32} @llvm.s390.vfenefs(<4 x i32>, <4 x i32>)165declare <16 x i8> @llvm.s390.vfenezb(<16 x i8>, <16 x i8>)166declare <8 x i16> @llvm.s390.vfenezh(<8 x i16>, <8 x i16>)167declare <4 x i32> @llvm.s390.vfenezf(<4 x i32>, <4 x i32>)168declare {<16 x i8>, i32} @llvm.s390.vfenezbs(<16 x i8>, <16 x i8>)169declare {<8 x i16>, i32} @llvm.s390.vfenezhs(<8 x i16>, <8 x i16>)170declare {<4 x i32>, i32} @llvm.s390.vfenezfs(<4 x i32>, <4 x i32>)171declare <16 x i8> @llvm.s390.vistrb(<16 x i8>)172declare <8 x i16> @llvm.s390.vistrh(<8 x i16>)173declare <4 x i32> @llvm.s390.vistrf(<4 x i32>)174declare {<16 x i8>, i32} @llvm.s390.vistrbs(<16 x i8>)175declare {<8 x i16>, i32} @llvm.s390.vistrhs(<8 x i16>)176declare {<4 x i32>, i32} @llvm.s390.vistrfs(<4 x i32>)177declare <16 x i8> @llvm.s390.vstrcb(<16 x i8>, <16 x i8>, <16 x i8>, i32)178declare <8 x i16> @llvm.s390.vstrch(<8 x i16>, <8 x i16>, <8 x i16>, i32)179declare <4 x i32> @llvm.s390.vstrcf(<4 x i32>, <4 x i32>, <4 x i32>, i32)180declare {<16 x i8>, i32} @llvm.s390.vstrcbs(<16 x i8>, <16 x i8>, <16 x i8>,181 i32)182declare {<8 x i16>, i32} @llvm.s390.vstrchs(<8 x i16>, <8 x i16>, <8 x i16>,183 i32)184declare {<4 x i32>, i32} @llvm.s390.vstrcfs(<4 x i32>, <4 x i32>, <4 x i32>,185 i32)186declare <16 x i8> @llvm.s390.vstrczb(<16 x i8>, <16 x i8>, <16 x i8>, i32)187declare <8 x i16> @llvm.s390.vstrczh(<8 x i16>, <8 x i16>, <8 x i16>, i32)188declare <4 x i32> @llvm.s390.vstrczf(<4 x i32>, <4 x i32>, <4 x i32>, i32)189declare {<16 x i8>, i32} @llvm.s390.vstrczbs(<16 x i8>, <16 x i8>, <16 x i8>,190 i32)191declare {<8 x i16>, i32} @llvm.s390.vstrczhs(<8 x i16>, <8 x i16>, <8 x i16>,192 i32)193declare {<4 x i32>, i32} @llvm.s390.vstrczfs(<4 x i32>, <4 x i32>, <4 x i32>,194 i32)195declare {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double>, <2 x double>)196declare {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double>, <2 x double>)197declare {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double>, <2 x double>)198declare {<2 x i64>, i32} @llvm.s390.vftcidb(<2 x double>, i32)199declare <2 x double> @llvm.s390.vfidb(<2 x double>, i32, i32)200 201; LCBB with the lowest M3 operand.202define i32 @test_lcbb1(ptr %ptr) {203; CHECK-LABEL: test_lcbb1:204; CHECK: # %bb.0:205; CHECK-NEXT: lcbb %r2, 0(%r2), 0206; CHECK-NEXT: br %r14207 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 0)208 ret i32 %res209}210 211; LCBB with the highest M3 operand.212define i32 @test_lcbb2(ptr %ptr) {213; CHECK-LABEL: test_lcbb2:214; CHECK: # %bb.0:215; CHECK-NEXT: lcbb %r2, 0(%r2), 15216; CHECK-NEXT: br %r14217 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 15)218 ret i32 %res219}220 221; LCBB with a displacement and index.222define i32 @test_lcbb3(ptr %base, i64 %index) {223; CHECK-LABEL: test_lcbb3:224; CHECK: # %bb.0:225; CHECK-NEXT: lcbb %r2, 4095(%r2,%r3), 4226; CHECK-NEXT: br %r14227 %add = add i64 %index, 4095228 %ptr = getelementptr i8, ptr %base, i64 %add229 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 4)230 ret i32 %res231}232 233; LCBB with an out-of-range displacement.234define i32 @test_lcbb4(ptr %base) {235; CHECK-LABEL: test_lcbb4:236; CHECK: # %bb.0:237; CHECK-NEXT: aghi %r2, 4096238; CHECK-NEXT: lcbb %r2, 0(%r2), 5239; CHECK-NEXT: br %r14240 %ptr = getelementptr i8, ptr %base, i64 4096241 %res = call i32 @llvm.s390.lcbb(ptr %ptr, i32 5)242 ret i32 %res243}244 245; VLBB with the lowest M3 operand.246define <16 x i8> @test_vlbb1(ptr %ptr) {247; CHECK-LABEL: test_vlbb1:248; CHECK: # %bb.0:249; CHECK-NEXT: vlbb %v24, 0(%r2), 0250; CHECK-NEXT: br %r14251 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 0)252 ret <16 x i8> %res253}254 255; VLBB with the highest M3 operand.256define <16 x i8> @test_vlbb2(ptr %ptr) {257; CHECK-LABEL: test_vlbb2:258; CHECK: # %bb.0:259; CHECK-NEXT: vlbb %v24, 0(%r2), 15260; CHECK-NEXT: br %r14261 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 15)262 ret <16 x i8> %res263}264 265; VLBB with a displacement and index.266define <16 x i8> @test_vlbb3(ptr %base, i64 %index) {267; CHECK-LABEL: test_vlbb3:268; CHECK: # %bb.0:269; CHECK-NEXT: vlbb %v24, 4095(%r2,%r3), 4270; CHECK-NEXT: br %r14271 %add = add i64 %index, 4095272 %ptr = getelementptr i8, ptr %base, i64 %add273 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 4)274 ret <16 x i8> %res275}276 277; VLBB with an out-of-range displacement.278define <16 x i8> @test_vlbb4(ptr %base) {279; CHECK-LABEL: test_vlbb4:280; CHECK: # %bb.0:281; CHECK-NEXT: aghi %r2, 4096282; CHECK-NEXT: vlbb %v24, 0(%r2), 5283; CHECK-NEXT: br %r14284 %ptr = getelementptr i8, ptr %base, i64 4096285 %res = call <16 x i8> @llvm.s390.vlbb(ptr %ptr, i32 5)286 ret <16 x i8> %res287}288 289; VLL with the lowest in-range displacement.290define <16 x i8> @test_vll1(ptr %ptr, i32 %length) {291; CHECK-LABEL: test_vll1:292; CHECK: # %bb.0:293; CHECK-NEXT: vll %v24, %r3, 0(%r2)294; CHECK-NEXT: br %r14295 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)296 ret <16 x i8> %res297}298 299; VLL with the highest in-range displacement.300define <16 x i8> @test_vll2(ptr %base, i32 %length) {301; CHECK-LABEL: test_vll2:302; CHECK: # %bb.0:303; CHECK-NEXT: vll %v24, %r3, 4095(%r2)304; CHECK-NEXT: br %r14305 %ptr = getelementptr i8, ptr %base, i64 4095306 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)307 ret <16 x i8> %res308}309 310; VLL with an out-of-range displacementa.311define <16 x i8> @test_vll3(ptr %base, i32 %length) {312; CHECK-LABEL: test_vll3:313; CHECK: # %bb.0:314; CHECK-NEXT: aghi %r2, 4096315; CHECK-NEXT: vll %v24, %r3, 0(%r2)316; CHECK-NEXT: br %r14317 %ptr = getelementptr i8, ptr %base, i64 4096318 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)319 ret <16 x i8> %res320}321 322; Check that VLL doesn't allow an index.323define <16 x i8> @test_vll4(ptr %base, i64 %index, i32 %length) {324; CHECK-LABEL: test_vll4:325; CHECK: # %bb.0:326; CHECK-NEXT: agr %r2, %r3327; CHECK-NEXT: vll %v24, %r4, 0(%r2)328; CHECK-NEXT: br %r14329 %ptr = getelementptr i8, ptr %base, i64 %index330 %res = call <16 x i8> @llvm.s390.vll(i32 %length, ptr %ptr)331 ret <16 x i8> %res332}333 334; VLL with length >= 15 should become VL.335define <16 x i8> @test_vll5(ptr %ptr) {336; CHECK-LABEL: test_vll5:337; CHECK: # %bb.0:338; CHECK-NEXT: vl %v24, 0(%r2), 3339; CHECK-NEXT: br %r14340 %res = call <16 x i8> @llvm.s390.vll(i32 15, ptr %ptr)341 ret <16 x i8> %res342}343 344; VPDI taking element 0 from each half.345define <2 x i64> @test_vpdi1(<2 x i64> %a, <2 x i64> %b) {346; CHECK-LABEL: test_vpdi1:347; CHECK: # %bb.0:348; CHECK-NEXT: vpdi %v24, %v24, %v26, 0349; CHECK-NEXT: br %r14350 %res = call <2 x i64> @llvm.s390.vpdi(<2 x i64> %a, <2 x i64> %b, i32 0)351 ret <2 x i64> %res352}353 354; VPDI taking element 1 from each half.355define <2 x i64> @test_vpdi2(<2 x i64> %a, <2 x i64> %b) {356; CHECK-LABEL: test_vpdi2:357; CHECK: # %bb.0:358; CHECK-NEXT: vpdi %v24, %v24, %v26, 5359; CHECK-NEXT: br %r14360 %res = call <2 x i64> @llvm.s390.vpdi(<2 x i64> %a, <2 x i64> %b, i32 5)361 ret <2 x i64> %res362}363 364; VPERM.365define <16 x i8> @test_vperm(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {366; CHECK-LABEL: test_vperm:367; CHECK: # %bb.0:368; CHECK-NEXT: vperm %v24, %v24, %v26, %v28369; CHECK-NEXT: br %r14370 %res = call <16 x i8> @llvm.s390.vperm(<16 x i8> %a, <16 x i8> %b,371 <16 x i8> %c)372 ret <16 x i8> %res373}374 375; VPKSH.376define <16 x i8> @test_vpksh(<8 x i16> %a, <8 x i16> %b) {377; CHECK-LABEL: test_vpksh:378; CHECK: # %bb.0:379; CHECK-NEXT: vpksh %v24, %v24, %v26380; CHECK-NEXT: br %r14381 %res = call <16 x i8> @llvm.s390.vpksh(<8 x i16> %a, <8 x i16> %b)382 ret <16 x i8> %res383}384 385; VPKSF.386define <8 x i16> @test_vpksf(<4 x i32> %a, <4 x i32> %b) {387; CHECK-LABEL: test_vpksf:388; CHECK: # %bb.0:389; CHECK-NEXT: vpksf %v24, %v24, %v26390; CHECK-NEXT: br %r14391 %res = call <8 x i16> @llvm.s390.vpksf(<4 x i32> %a, <4 x i32> %b)392 ret <8 x i16> %res393}394 395; VPKSG.396define <4 x i32> @test_vpksg(<2 x i64> %a, <2 x i64> %b) {397; CHECK-LABEL: test_vpksg:398; CHECK: # %bb.0:399; CHECK-NEXT: vpksg %v24, %v24, %v26400; CHECK-NEXT: br %r14401 %res = call <4 x i32> @llvm.s390.vpksg(<2 x i64> %a, <2 x i64> %b)402 ret <4 x i32> %res403}404 405; VPKSHS with no processing of the result.406define <16 x i8> @test_vpkshs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {407; CHECK-LABEL: test_vpkshs:408; CHECK: # %bb.0:409; CHECK-NEXT: vpkshs %v24, %v24, %v26410; CHECK-NEXT: ipm %r0411; CHECK-NEXT: srl %r0, 28412; CHECK-NEXT: st %r0, 0(%r2)413; CHECK-NEXT: br %r14414 %call = call {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16> %a, <8 x i16> %b)415 %res = extractvalue {<16 x i8>, i32} %call, 0416 %cc = extractvalue {<16 x i8>, i32} %call, 1417 store i32 %cc, ptr %ccptr418 ret <16 x i8> %res419}420 421; VPKSHS, storing to %ptr if all values were saturated.422define <16 x i8> @test_vpkshs_all_store(<8 x i16> %a, <8 x i16> %b, ptr %ptr) {423; CHECK-LABEL: test_vpkshs_all_store:424; CHECK: # %bb.0:425; CHECK-NEXT: vpkshs %v24, %v24, %v26426; CHECK-NEXT: bler %r14427; CHECK-NEXT: .LBB20_1: # %store428; CHECK-NEXT: mvhi 0(%r2), 0429; CHECK-NEXT: br %r14430 %call = call {<16 x i8>, i32} @llvm.s390.vpkshs(<8 x i16> %a, <8 x i16> %b)431 %res = extractvalue {<16 x i8>, i32} %call, 0432 %cc = extractvalue {<16 x i8>, i32} %call, 1433 %cmp = icmp uge i32 %cc, 3434 br i1 %cmp, label %store, label %exit435 436store:437 store i32 0, ptr %ptr438 br label %exit439 440exit:441 ret <16 x i8> %res442}443 444; VPKSFS with no processing of the result.445define <8 x i16> @test_vpksfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {446; CHECK-LABEL: test_vpksfs:447; CHECK: # %bb.0:448; CHECK-NEXT: vpksfs %v24, %v24, %v26449; CHECK-NEXT: ipm %r0450; CHECK-NEXT: srl %r0, 28451; CHECK-NEXT: st %r0, 0(%r2)452; CHECK-NEXT: br %r14453 %call = call {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32> %a, <4 x i32> %b)454 %res = extractvalue {<8 x i16>, i32} %call, 0455 %cc = extractvalue {<8 x i16>, i32} %call, 1456 store i32 %cc, ptr %ccptr457 ret <8 x i16> %res458}459 460; VPKSFS, storing to %ptr if any values were saturated.461define <8 x i16> @test_vpksfs_any_store(<4 x i32> %a, <4 x i32> %b, ptr %ptr) {462; CHECK-LABEL: test_vpksfs_any_store:463; CHECK: # %bb.0:464; CHECK-NEXT: vpksfs %v24, %v24, %v26465; CHECK-NEXT: ber %r14466; CHECK-NEXT: .LBB22_1: # %store467; CHECK-NEXT: mvhi 0(%r2), 0468; CHECK-NEXT: br %r14469 %call = call {<8 x i16>, i32} @llvm.s390.vpksfs(<4 x i32> %a, <4 x i32> %b)470 %res = extractvalue {<8 x i16>, i32} %call, 0471 %cc = extractvalue {<8 x i16>, i32} %call, 1472 %cmp = icmp ugt i32 %cc, 0473 br i1 %cmp, label %store, label %exit474 475store:476 store i32 0, ptr %ptr477 br label %exit478 479exit:480 ret <8 x i16> %res481}482 483; VPKSGS with no processing of the result.484define <4 x i32> @test_vpksgs(<2 x i64> %a, <2 x i64> %b, ptr %ccptr) {485; CHECK-LABEL: test_vpksgs:486; CHECK: # %bb.0:487; CHECK-NEXT: vpksgs %v24, %v24, %v26488; CHECK-NEXT: ipm %r0489; CHECK-NEXT: srl %r0, 28490; CHECK-NEXT: st %r0, 0(%r2)491; CHECK-NEXT: br %r14492 %call = call {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64> %a, <2 x i64> %b)493 %res = extractvalue {<4 x i32>, i32} %call, 0494 %cc = extractvalue {<4 x i32>, i32} %call, 1495 store i32 %cc, ptr %ccptr496 ret <4 x i32> %res497}498 499; VPKSGS, storing to %ptr if no elements were saturated500define <4 x i32> @test_vpksgs_none_store(<2 x i64> %a, <2 x i64> %b,501; CHECK-LABEL: test_vpksgs_none_store:502; CHECK: # %bb.0:503; CHECK-NEXT: vpksgs %v24, %v24, %v26504; CHECK-NEXT: bnher %r14505; CHECK-NEXT: .LBB24_1: # %store506; CHECK-NEXT: mvhi 0(%r2), 0507; CHECK-NEXT: br %r14508 ptr %ptr) {509 %call = call {<4 x i32>, i32} @llvm.s390.vpksgs(<2 x i64> %a, <2 x i64> %b)510 %res = extractvalue {<4 x i32>, i32} %call, 0511 %cc = extractvalue {<4 x i32>, i32} %call, 1512 %cmp = icmp sle i32 %cc, 0513 br i1 %cmp, label %store, label %exit514 515store:516 store i32 0, ptr %ptr517 br label %exit518 519exit:520 ret <4 x i32> %res521}522 523; VPKLSH.524define <16 x i8> @test_vpklsh(<8 x i16> %a, <8 x i16> %b) {525; CHECK-LABEL: test_vpklsh:526; CHECK: # %bb.0:527; CHECK-NEXT: vpklsh %v24, %v24, %v26528; CHECK-NEXT: br %r14529 %res = call <16 x i8> @llvm.s390.vpklsh(<8 x i16> %a, <8 x i16> %b)530 ret <16 x i8> %res531}532 533; VPKLSF.534define <8 x i16> @test_vpklsf(<4 x i32> %a, <4 x i32> %b) {535; CHECK-LABEL: test_vpklsf:536; CHECK: # %bb.0:537; CHECK-NEXT: vpklsf %v24, %v24, %v26538; CHECK-NEXT: br %r14539 %res = call <8 x i16> @llvm.s390.vpklsf(<4 x i32> %a, <4 x i32> %b)540 ret <8 x i16> %res541}542 543; VPKLSG.544define <4 x i32> @test_vpklsg(<2 x i64> %a, <2 x i64> %b) {545; CHECK-LABEL: test_vpklsg:546; CHECK: # %bb.0:547; CHECK-NEXT: vpklsg %v24, %v24, %v26548; CHECK-NEXT: br %r14549 %res = call <4 x i32> @llvm.s390.vpklsg(<2 x i64> %a, <2 x i64> %b)550 ret <4 x i32> %res551}552 553; VPKLSHS with no processing of the result.554define <16 x i8> @test_vpklshs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {555; CHECK-LABEL: test_vpklshs:556; CHECK: # %bb.0:557; CHECK-NEXT: vpklshs %v24, %v24, %v26558; CHECK-NEXT: ipm %r0559; CHECK-NEXT: srl %r0, 28560; CHECK-NEXT: st %r0, 0(%r2)561; CHECK-NEXT: br %r14562 %call = call {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16> %a, <8 x i16> %b)563 %res = extractvalue {<16 x i8>, i32} %call, 0564 %cc = extractvalue {<16 x i8>, i32} %call, 1565 store i32 %cc, ptr %ccptr566 ret <16 x i8> %res567}568 569; VPKLSHS, storing to %ptr if all values were saturated.570define <16 x i8> @test_vpklshs_all_store(<8 x i16> %a, <8 x i16> %b,571; CHECK-LABEL: test_vpklshs_all_store:572; CHECK: # %bb.0:573; CHECK-NEXT: vpklshs %v24, %v24, %v26574; CHECK-NEXT: bler %r14575; CHECK-NEXT: .LBB29_1: # %store576; CHECK-NEXT: mvhi 0(%r2), 0577; CHECK-NEXT: br %r14578 ptr %ptr) {579 %call = call {<16 x i8>, i32} @llvm.s390.vpklshs(<8 x i16> %a, <8 x i16> %b)580 %res = extractvalue {<16 x i8>, i32} %call, 0581 %cc = extractvalue {<16 x i8>, i32} %call, 1582 %cmp = icmp eq i32 %cc, 3583 br i1 %cmp, label %store, label %exit584 585store:586 store i32 0, ptr %ptr587 br label %exit588 589exit:590 ret <16 x i8> %res591}592 593; VPKLSFS with no processing of the result.594define <8 x i16> @test_vpklsfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {595; CHECK-LABEL: test_vpklsfs:596; CHECK: # %bb.0:597; CHECK-NEXT: vpklsfs %v24, %v24, %v26598; CHECK-NEXT: ipm %r0599; CHECK-NEXT: srl %r0, 28600; CHECK-NEXT: st %r0, 0(%r2)601; CHECK-NEXT: br %r14602 %call = call {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32> %a, <4 x i32> %b)603 %res = extractvalue {<8 x i16>, i32} %call, 0604 %cc = extractvalue {<8 x i16>, i32} %call, 1605 store i32 %cc, ptr %ccptr606 ret <8 x i16> %res607}608 609; VPKLSFS, storing to %ptr if any values were saturated.610define <8 x i16> @test_vpklsfs_any_store(<4 x i32> %a, <4 x i32> %b,611; CHECK-LABEL: test_vpklsfs_any_store:612; CHECK: # %bb.0:613; CHECK-NEXT: vpklsfs %v24, %v24, %v26614; CHECK-NEXT: ber %r14615; CHECK-NEXT: .LBB31_1: # %store616; CHECK-NEXT: mvhi 0(%r2), 0617; CHECK-NEXT: br %r14618 ptr %ptr) {619 %call = call {<8 x i16>, i32} @llvm.s390.vpklsfs(<4 x i32> %a, <4 x i32> %b)620 %res = extractvalue {<8 x i16>, i32} %call, 0621 %cc = extractvalue {<8 x i16>, i32} %call, 1622 %cmp = icmp ne i32 %cc, 0623 br i1 %cmp, label %store, label %exit624 625store:626 store i32 0, ptr %ptr627 br label %exit628 629exit:630 ret <8 x i16> %res631}632 633; VPKLSGS with no processing of the result.634define <4 x i32> @test_vpklsgs(<2 x i64> %a, <2 x i64> %b, ptr %ccptr) {635; CHECK-LABEL: test_vpklsgs:636; CHECK: # %bb.0:637; CHECK-NEXT: vpklsgs %v24, %v24, %v26638; CHECK-NEXT: ipm %r0639; CHECK-NEXT: srl %r0, 28640; CHECK-NEXT: st %r0, 0(%r2)641; CHECK-NEXT: br %r14642 %call = call {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64> %a, <2 x i64> %b)643 %res = extractvalue {<4 x i32>, i32} %call, 0644 %cc = extractvalue {<4 x i32>, i32} %call, 1645 store i32 %cc, ptr %ccptr646 ret <4 x i32> %res647}648 649; VPKLSGS, storing to %ptr if no elements were saturated650define <4 x i32> @test_vpklsgs_none_store(<2 x i64> %a, <2 x i64> %b,651; CHECK-LABEL: test_vpklsgs_none_store:652; CHECK: # %bb.0:653; CHECK-NEXT: vpklsgs %v24, %v24, %v26654; CHECK-NEXT: bnher %r14655; CHECK-NEXT: .LBB33_1: # %store656; CHECK-NEXT: mvhi 0(%r2), 0657; CHECK-NEXT: br %r14658 ptr %ptr) {659 %call = call {<4 x i32>, i32} @llvm.s390.vpklsgs(<2 x i64> %a, <2 x i64> %b)660 %res = extractvalue {<4 x i32>, i32} %call, 0661 %cc = extractvalue {<4 x i32>, i32} %call, 1662 %cmp = icmp eq i32 %cc, 0663 br i1 %cmp, label %store, label %exit664 665store:666 store i32 0, ptr %ptr667 br label %exit668 669exit:670 ret <4 x i32> %res671}672 673; VSTL with the lowest in-range displacement.674define void @test_vstl1(<16 x i8> %vec, ptr %ptr, i32 %length) {675; CHECK-LABEL: test_vstl1:676; CHECK: # %bb.0:677; CHECK-NEXT: vstl %v24, %r3, 0(%r2)678; CHECK-NEXT: br %r14679 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)680 ret void681}682 683; VSTL with the highest in-range displacement.684define void @test_vstl2(<16 x i8> %vec, ptr %base, i32 %length) {685; CHECK-LABEL: test_vstl2:686; CHECK: # %bb.0:687; CHECK-NEXT: vstl %v24, %r3, 4095(%r2)688; CHECK-NEXT: br %r14689 %ptr = getelementptr i8, ptr %base, i64 4095690 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)691 ret void692}693 694; VSTL with an out-of-range displacement.695define void @test_vstl3(<16 x i8> %vec, ptr %base, i32 %length) {696; CHECK-LABEL: test_vstl3:697; CHECK: # %bb.0:698; CHECK-NEXT: aghi %r2, 4096699; CHECK-NEXT: vstl %v24, %r3, 0(%r2)700; CHECK-NEXT: br %r14701 %ptr = getelementptr i8, ptr %base, i64 4096702 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)703 ret void704}705 706; Check that VSTL doesn't allow an index.707define void @test_vstl4(<16 x i8> %vec, ptr %base, i64 %index, i32 %length) {708; CHECK-LABEL: test_vstl4:709; CHECK: # %bb.0:710; CHECK-NEXT: agr %r2, %r3711; CHECK-NEXT: vstl %v24, %r4, 0(%r2)712; CHECK-NEXT: br %r14713 %ptr = getelementptr i8, ptr %base, i64 %index714 call void @llvm.s390.vstl(<16 x i8> %vec, i32 %length, ptr %ptr)715 ret void716}717 718; VSTL with length >= 15 should become VST.719define void @test_vstl5(<16 x i8> %vec, ptr %ptr) {720; CHECK-LABEL: test_vstl5:721; CHECK: # %bb.0:722; CHECK-NEXT: vst %v24, 0(%r2), 3723; CHECK-NEXT: br %r14724 call void @llvm.s390.vstl(<16 x i8> %vec, i32 15, ptr %ptr)725 ret void726}727 728; VUPHB.729define <8 x i16> @test_vuphb(<16 x i8> %a) {730; CHECK-LABEL: test_vuphb:731; CHECK: # %bb.0:732; CHECK-NEXT: vuphb %v24, %v24733; CHECK-NEXT: br %r14734 %res = call <8 x i16> @llvm.s390.vuphb(<16 x i8> %a)735 ret <8 x i16> %res736}737 738; VUPHH.739define <4 x i32> @test_vuphh(<8 x i16> %a) {740; CHECK-LABEL: test_vuphh:741; CHECK: # %bb.0:742; CHECK-NEXT: vuphh %v24, %v24743; CHECK-NEXT: br %r14744 %res = call <4 x i32> @llvm.s390.vuphh(<8 x i16> %a)745 ret <4 x i32> %res746}747 748; VUPHF.749define <2 x i64> @test_vuphf(<4 x i32> %a) {750; CHECK-LABEL: test_vuphf:751; CHECK: # %bb.0:752; CHECK-NEXT: vuphf %v24, %v24753; CHECK-NEXT: br %r14754 %res = call <2 x i64> @llvm.s390.vuphf(<4 x i32> %a)755 ret <2 x i64> %res756}757 758; VUPLHB.759define <8 x i16> @test_vuplhb(<16 x i8> %a) {760; CHECK-LABEL: test_vuplhb:761; CHECK: # %bb.0:762; CHECK-NEXT: vuplhb %v24, %v24763; CHECK-NEXT: br %r14764 %res = call <8 x i16> @llvm.s390.vuplhb(<16 x i8> %a)765 ret <8 x i16> %res766}767 768; VUPLHH.769define <4 x i32> @test_vuplhh(<8 x i16> %a) {770; CHECK-LABEL: test_vuplhh:771; CHECK: # %bb.0:772; CHECK-NEXT: vuplhh %v24, %v24773; CHECK-NEXT: br %r14774 %res = call <4 x i32> @llvm.s390.vuplhh(<8 x i16> %a)775 ret <4 x i32> %res776}777 778; VUPLHF.779define <2 x i64> @test_vuplhf(<4 x i32> %a) {780; CHECK-LABEL: test_vuplhf:781; CHECK: # %bb.0:782; CHECK-NEXT: vuplhf %v24, %v24783; CHECK-NEXT: br %r14784 %res = call <2 x i64> @llvm.s390.vuplhf(<4 x i32> %a)785 ret <2 x i64> %res786}787 788; VUPLB.789define <8 x i16> @test_vuplb(<16 x i8> %a) {790; CHECK-LABEL: test_vuplb:791; CHECK: # %bb.0:792; CHECK-NEXT: vuplb %v24, %v24793; CHECK-NEXT: br %r14794 %res = call <8 x i16> @llvm.s390.vuplb(<16 x i8> %a)795 ret <8 x i16> %res796}797 798; VUPLHW.799define <4 x i32> @test_vuplhw(<8 x i16> %a) {800; CHECK-LABEL: test_vuplhw:801; CHECK: # %bb.0:802; CHECK-NEXT: vuplhw %v24, %v24803; CHECK-NEXT: br %r14804 %res = call <4 x i32> @llvm.s390.vuplhw(<8 x i16> %a)805 ret <4 x i32> %res806}807 808; VUPLF.809define <2 x i64> @test_vuplf(<4 x i32> %a) {810; CHECK-LABEL: test_vuplf:811; CHECK: # %bb.0:812; CHECK-NEXT: vuplf %v24, %v24813; CHECK-NEXT: br %r14814 %res = call <2 x i64> @llvm.s390.vuplf(<4 x i32> %a)815 ret <2 x i64> %res816}817 818; VUPLLB.819define <8 x i16> @test_vupllb(<16 x i8> %a) {820; CHECK-LABEL: test_vupllb:821; CHECK: # %bb.0:822; CHECK-NEXT: vupllb %v24, %v24823; CHECK-NEXT: br %r14824 %res = call <8 x i16> @llvm.s390.vupllb(<16 x i8> %a)825 ret <8 x i16> %res826}827 828; VUPLLH.829define <4 x i32> @test_vupllh(<8 x i16> %a) {830; CHECK-LABEL: test_vupllh:831; CHECK: # %bb.0:832; CHECK-NEXT: vupllh %v24, %v24833; CHECK-NEXT: br %r14834 %res = call <4 x i32> @llvm.s390.vupllh(<8 x i16> %a)835 ret <4 x i32> %res836}837 838; VUPLLF.839define <2 x i64> @test_vupllf(<4 x i32> %a) {840; CHECK-LABEL: test_vupllf:841; CHECK: # %bb.0:842; CHECK-NEXT: vupllf %v24, %v24843; CHECK-NEXT: br %r14844 %res = call <2 x i64> @llvm.s390.vupllf(<4 x i32> %a)845 ret <2 x i64> %res846}847 848; VACCB.849define <16 x i8> @test_vaccb(<16 x i8> %a, <16 x i8> %b) {850; CHECK-LABEL: test_vaccb:851; CHECK: # %bb.0:852; CHECK-NEXT: vaccb %v24, %v24, %v26853; CHECK-NEXT: br %r14854 %res = call <16 x i8> @llvm.s390.vaccb(<16 x i8> %a, <16 x i8> %b)855 ret <16 x i8> %res856}857 858; VACCH.859define <8 x i16> @test_vacch(<8 x i16> %a, <8 x i16> %b) {860; CHECK-LABEL: test_vacch:861; CHECK: # %bb.0:862; CHECK-NEXT: vacch %v24, %v24, %v26863; CHECK-NEXT: br %r14864 %res = call <8 x i16> @llvm.s390.vacch(<8 x i16> %a, <8 x i16> %b)865 ret <8 x i16> %res866}867 868; VACCF.869define <4 x i32> @test_vaccf(<4 x i32> %a, <4 x i32> %b) {870; CHECK-LABEL: test_vaccf:871; CHECK: # %bb.0:872; CHECK-NEXT: vaccf %v24, %v24, %v26873; CHECK-NEXT: br %r14874 %res = call <4 x i32> @llvm.s390.vaccf(<4 x i32> %a, <4 x i32> %b)875 ret <4 x i32> %res876}877 878; VACCG.879define <2 x i64> @test_vaccg(<2 x i64> %a, <2 x i64> %b) {880; CHECK-LABEL: test_vaccg:881; CHECK: # %bb.0:882; CHECK-NEXT: vaccg %v24, %v24, %v26883; CHECK-NEXT: br %r14884 %res = call <2 x i64> @llvm.s390.vaccg(<2 x i64> %a, <2 x i64> %b)885 ret <2 x i64> %res886}887 888; VAQ.889define i128 @test_vaq(i128 %a, i128 %b) {890; CHECK-LABEL: test_vaq:891; CHECK: # %bb.0:892; CHECK-NEXT: vl %v0, 0(%r4), 3893; CHECK-NEXT: vl %v1, 0(%r3), 3894; CHECK-NEXT: vaq %v0, %v1, %v0895; CHECK-NEXT: vst %v0, 0(%r2), 3896; CHECK-NEXT: br %r14897 %res = call i128 @llvm.s390.vaq(i128 %a, i128 %b)898 ret i128 %res899}900 901; VACQ.902define i128 @test_vacq(i128 %a, i128 %b, i128 %c) {903; CHECK-LABEL: test_vacq:904; CHECK: # %bb.0:905; CHECK-NEXT: vl %v0, 0(%r5), 3906; CHECK-NEXT: vl %v1, 0(%r4), 3907; CHECK-NEXT: vl %v2, 0(%r3), 3908; CHECK-NEXT: vacq %v0, %v2, %v1, %v0909; CHECK-NEXT: vst %v0, 0(%r2), 3910; CHECK-NEXT: br %r14911 %res = call i128 @llvm.s390.vacq(i128 %a, i128 %b, i128 %c)912 ret i128 %res913}914 915; VACCQ.916define i128 @test_vaccq(i128 %a, i128 %b) {917; CHECK-LABEL: test_vaccq:918; CHECK: # %bb.0:919; CHECK-NEXT: vl %v0, 0(%r4), 3920; CHECK-NEXT: vl %v1, 0(%r3), 3921; CHECK-NEXT: vaccq %v0, %v1, %v0922; CHECK-NEXT: vst %v0, 0(%r2), 3923; CHECK-NEXT: br %r14924 %res = call i128 @llvm.s390.vaccq(i128 %a, i128 %b)925 ret i128 %res926}927 928; VACCCQ.929define i128 @test_vacccq(i128 %a, i128 %b, i128 %c) {930; CHECK-LABEL: test_vacccq:931; CHECK: # %bb.0:932; CHECK-NEXT: vl %v0, 0(%r5), 3933; CHECK-NEXT: vl %v1, 0(%r4), 3934; CHECK-NEXT: vl %v2, 0(%r3), 3935; CHECK-NEXT: vacccq %v0, %v2, %v1, %v0936; CHECK-NEXT: vst %v0, 0(%r2), 3937; CHECK-NEXT: br %r14938 %res = call i128 @llvm.s390.vacccq(i128 %a, i128 %b, i128 %c)939 ret i128 %res940}941 942; VAVGB.943define <16 x i8> @test_vavgb(<16 x i8> %a, <16 x i8> %b) {944; CHECK-LABEL: test_vavgb:945; CHECK: # %bb.0:946; CHECK-NEXT: vavgb %v24, %v24, %v26947; CHECK-NEXT: br %r14948 %res = call <16 x i8> @llvm.s390.vavgb(<16 x i8> %a, <16 x i8> %b)949 ret <16 x i8> %res950}951 952; VAVGH.953define <8 x i16> @test_vavgh(<8 x i16> %a, <8 x i16> %b) {954; CHECK-LABEL: test_vavgh:955; CHECK: # %bb.0:956; CHECK-NEXT: vavgh %v24, %v24, %v26957; CHECK-NEXT: br %r14958 %res = call <8 x i16> @llvm.s390.vavgh(<8 x i16> %a, <8 x i16> %b)959 ret <8 x i16> %res960}961 962; VAVGF.963define <4 x i32> @test_vavgf(<4 x i32> %a, <4 x i32> %b) {964; CHECK-LABEL: test_vavgf:965; CHECK: # %bb.0:966; CHECK-NEXT: vavgf %v24, %v24, %v26967; CHECK-NEXT: br %r14968 %res = call <4 x i32> @llvm.s390.vavgf(<4 x i32> %a, <4 x i32> %b)969 ret <4 x i32> %res970}971 972; VAVGG.973define <2 x i64> @test_vavgg(<2 x i64> %a, <2 x i64> %b) {974; CHECK-LABEL: test_vavgg:975; CHECK: # %bb.0:976; CHECK-NEXT: vavgg %v24, %v24, %v26977; CHECK-NEXT: br %r14978 %res = call <2 x i64> @llvm.s390.vavgg(<2 x i64> %a, <2 x i64> %b)979 ret <2 x i64> %res980}981 982; VAVGLB.983define <16 x i8> @test_vavglb(<16 x i8> %a, <16 x i8> %b) {984; CHECK-LABEL: test_vavglb:985; CHECK: # %bb.0:986; CHECK-NEXT: vavglb %v24, %v24, %v26987; CHECK-NEXT: br %r14988 %res = call <16 x i8> @llvm.s390.vavglb(<16 x i8> %a, <16 x i8> %b)989 ret <16 x i8> %res990}991 992; VAVGLH.993define <8 x i16> @test_vavglh(<8 x i16> %a, <8 x i16> %b) {994; CHECK-LABEL: test_vavglh:995; CHECK: # %bb.0:996; CHECK-NEXT: vavglh %v24, %v24, %v26997; CHECK-NEXT: br %r14998 %res = call <8 x i16> @llvm.s390.vavglh(<8 x i16> %a, <8 x i16> %b)999 ret <8 x i16> %res1000}1001 1002; VAVGLF.1003define <4 x i32> @test_vavglf(<4 x i32> %a, <4 x i32> %b) {1004; CHECK-LABEL: test_vavglf:1005; CHECK: # %bb.0:1006; CHECK-NEXT: vavglf %v24, %v24, %v261007; CHECK-NEXT: br %r141008 %res = call <4 x i32> @llvm.s390.vavglf(<4 x i32> %a, <4 x i32> %b)1009 ret <4 x i32> %res1010}1011 1012; VAVGLG.1013define <2 x i64> @test_vavglg(<2 x i64> %a, <2 x i64> %b) {1014; CHECK-LABEL: test_vavglg:1015; CHECK: # %bb.0:1016; CHECK-NEXT: vavglg %v24, %v24, %v261017; CHECK-NEXT: br %r141018 %res = call <2 x i64> @llvm.s390.vavglg(<2 x i64> %a, <2 x i64> %b)1019 ret <2 x i64> %res1020}1021 1022; VCKSM.1023define <4 x i32> @test_vcksm(<4 x i32> %a, <4 x i32> %b) {1024; CHECK-LABEL: test_vcksm:1025; CHECK: # %bb.0:1026; CHECK-NEXT: vcksm %v24, %v24, %v261027; CHECK-NEXT: br %r141028 %res = call <4 x i32> @llvm.s390.vcksm(<4 x i32> %a, <4 x i32> %b)1029 ret <4 x i32> %res1030}1031 1032; VGFMB.1033define <8 x i16> @test_vgfmb(<16 x i8> %a, <16 x i8> %b) {1034; CHECK-LABEL: test_vgfmb:1035; CHECK: # %bb.0:1036; CHECK-NEXT: vgfmb %v24, %v24, %v261037; CHECK-NEXT: br %r141038 %res = call <8 x i16> @llvm.s390.vgfmb(<16 x i8> %a, <16 x i8> %b)1039 ret <8 x i16> %res1040}1041 1042; VGFMH.1043define <4 x i32> @test_vgfmh(<8 x i16> %a, <8 x i16> %b) {1044; CHECK-LABEL: test_vgfmh:1045; CHECK: # %bb.0:1046; CHECK-NEXT: vgfmh %v24, %v24, %v261047; CHECK-NEXT: br %r141048 %res = call <4 x i32> @llvm.s390.vgfmh(<8 x i16> %a, <8 x i16> %b)1049 ret <4 x i32> %res1050}1051 1052; VGFMF.1053define <2 x i64> @test_vgfmf(<4 x i32> %a, <4 x i32> %b) {1054; CHECK-LABEL: test_vgfmf:1055; CHECK: # %bb.0:1056; CHECK-NEXT: vgfmf %v24, %v24, %v261057; CHECK-NEXT: br %r141058 %res = call <2 x i64> @llvm.s390.vgfmf(<4 x i32> %a, <4 x i32> %b)1059 ret <2 x i64> %res1060}1061 1062; VGFMG.1063define i128 @test_vgfmg(<2 x i64> %a, <2 x i64> %b) {1064; CHECK-LABEL: test_vgfmg:1065; CHECK: # %bb.0:1066; CHECK-NEXT: vgfmg %v0, %v24, %v261067; CHECK-NEXT: vst %v0, 0(%r2), 31068; CHECK-NEXT: br %r141069 %res = call i128 @llvm.s390.vgfmg(<2 x i64> %a, <2 x i64> %b)1070 ret i128 %res1071}1072 1073; VGFMAB.1074define <8 x i16> @test_vgfmab(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {1075; CHECK-LABEL: test_vgfmab:1076; CHECK: # %bb.0:1077; CHECK-NEXT: vgfmab %v24, %v24, %v26, %v281078; CHECK-NEXT: br %r141079 %res = call <8 x i16> @llvm.s390.vgfmab(<16 x i8> %a, <16 x i8> %b,1080 <8 x i16> %c)1081 ret <8 x i16> %res1082}1083 1084; VGFMAH.1085define <4 x i32> @test_vgfmah(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {1086; CHECK-LABEL: test_vgfmah:1087; CHECK: # %bb.0:1088; CHECK-NEXT: vgfmah %v24, %v24, %v26, %v281089; CHECK-NEXT: br %r141090 %res = call <4 x i32> @llvm.s390.vgfmah(<8 x i16> %a, <8 x i16> %b,1091 <4 x i32> %c)1092 ret <4 x i32> %res1093}1094 1095; VGFMAF.1096define <2 x i64> @test_vgfmaf(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {1097; CHECK-LABEL: test_vgfmaf:1098; CHECK: # %bb.0:1099; CHECK-NEXT: vgfmaf %v24, %v24, %v26, %v281100; CHECK-NEXT: br %r141101 %res = call <2 x i64> @llvm.s390.vgfmaf(<4 x i32> %a, <4 x i32> %b,1102 <2 x i64> %c)1103 ret <2 x i64> %res1104}1105 1106; VGFMAG.1107define i128 @test_vgfmag(<2 x i64> %a, <2 x i64> %b, i128 %c) {1108; CHECK-LABEL: test_vgfmag:1109; CHECK: # %bb.0:1110; CHECK-NEXT: vl %v0, 0(%r3), 31111; CHECK-NEXT: vgfmag %v0, %v24, %v26, %v01112; CHECK-NEXT: vst %v0, 0(%r2), 31113; CHECK-NEXT: br %r141114 %res = call i128 @llvm.s390.vgfmag(<2 x i64> %a, <2 x i64> %b, i128 %c)1115 ret i128 %res1116}1117 1118; VMAHB.1119define <16 x i8> @test_vmahb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {1120; CHECK-LABEL: test_vmahb:1121; CHECK: # %bb.0:1122; CHECK-NEXT: vmahb %v24, %v24, %v26, %v281123; CHECK-NEXT: br %r141124 %res = call <16 x i8> @llvm.s390.vmahb(<16 x i8> %a, <16 x i8> %b,1125 <16 x i8> %c)1126 ret <16 x i8> %res1127}1128 1129; VMAHH.1130define <8 x i16> @test_vmahh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {1131; CHECK-LABEL: test_vmahh:1132; CHECK: # %bb.0:1133; CHECK-NEXT: vmahh %v24, %v24, %v26, %v281134; CHECK-NEXT: br %r141135 %res = call <8 x i16> @llvm.s390.vmahh(<8 x i16> %a, <8 x i16> %b,1136 <8 x i16> %c)1137 ret <8 x i16> %res1138}1139 1140; VMAHF.1141define <4 x i32> @test_vmahf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {1142; CHECK-LABEL: test_vmahf:1143; CHECK: # %bb.0:1144; CHECK-NEXT: vmahf %v24, %v24, %v26, %v281145; CHECK-NEXT: br %r141146 %res = call <4 x i32> @llvm.s390.vmahf(<4 x i32> %a, <4 x i32> %b,1147 <4 x i32> %c)1148 ret <4 x i32> %res1149}1150 1151; VMALHB.1152define <16 x i8> @test_vmalhb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {1153; CHECK-LABEL: test_vmalhb:1154; CHECK: # %bb.0:1155; CHECK-NEXT: vmalhb %v24, %v24, %v26, %v281156; CHECK-NEXT: br %r141157 %res = call <16 x i8> @llvm.s390.vmalhb(<16 x i8> %a, <16 x i8> %b,1158 <16 x i8> %c)1159 ret <16 x i8> %res1160}1161 1162; VMALHH.1163define <8 x i16> @test_vmalhh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {1164; CHECK-LABEL: test_vmalhh:1165; CHECK: # %bb.0:1166; CHECK-NEXT: vmalhh %v24, %v24, %v26, %v281167; CHECK-NEXT: br %r141168 %res = call <8 x i16> @llvm.s390.vmalhh(<8 x i16> %a, <8 x i16> %b,1169 <8 x i16> %c)1170 ret <8 x i16> %res1171}1172 1173; VMALHF.1174define <4 x i32> @test_vmalhf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {1175; CHECK-LABEL: test_vmalhf:1176; CHECK: # %bb.0:1177; CHECK-NEXT: vmalhf %v24, %v24, %v26, %v281178; CHECK-NEXT: br %r141179 %res = call <4 x i32> @llvm.s390.vmalhf(<4 x i32> %a, <4 x i32> %b,1180 <4 x i32> %c)1181 ret <4 x i32> %res1182}1183 1184; VMAEB.1185define <8 x i16> @test_vmaeb(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {1186; CHECK-LABEL: test_vmaeb:1187; CHECK: # %bb.0:1188; CHECK-NEXT: vmaeb %v24, %v24, %v26, %v281189; CHECK-NEXT: br %r141190 %res = call <8 x i16> @llvm.s390.vmaeb(<16 x i8> %a, <16 x i8> %b,1191 <8 x i16> %c)1192 ret <8 x i16> %res1193}1194 1195; VMAEH.1196define <4 x i32> @test_vmaeh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {1197; CHECK-LABEL: test_vmaeh:1198; CHECK: # %bb.0:1199; CHECK-NEXT: vmaeh %v24, %v24, %v26, %v281200; CHECK-NEXT: br %r141201 %res = call <4 x i32> @llvm.s390.vmaeh(<8 x i16> %a, <8 x i16> %b,1202 <4 x i32> %c)1203 ret <4 x i32> %res1204}1205 1206; VMAEF.1207define <2 x i64> @test_vmaef(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {1208; CHECK-LABEL: test_vmaef:1209; CHECK: # %bb.0:1210; CHECK-NEXT: vmaef %v24, %v24, %v26, %v281211; CHECK-NEXT: br %r141212 %res = call <2 x i64> @llvm.s390.vmaef(<4 x i32> %a, <4 x i32> %b,1213 <2 x i64> %c)1214 ret <2 x i64> %res1215}1216 1217; VMALEB.1218define <8 x i16> @test_vmaleb(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {1219; CHECK-LABEL: test_vmaleb:1220; CHECK: # %bb.0:1221; CHECK-NEXT: vmaleb %v24, %v24, %v26, %v281222; CHECK-NEXT: br %r141223 %res = call <8 x i16> @llvm.s390.vmaleb(<16 x i8> %a, <16 x i8> %b,1224 <8 x i16> %c)1225 ret <8 x i16> %res1226}1227 1228; VMALEH.1229define <4 x i32> @test_vmaleh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {1230; CHECK-LABEL: test_vmaleh:1231; CHECK: # %bb.0:1232; CHECK-NEXT: vmaleh %v24, %v24, %v26, %v281233; CHECK-NEXT: br %r141234 %res = call <4 x i32> @llvm.s390.vmaleh(<8 x i16> %a, <8 x i16> %b,1235 <4 x i32> %c)1236 ret <4 x i32> %res1237}1238 1239; VMALEF.1240define <2 x i64> @test_vmalef(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {1241; CHECK-LABEL: test_vmalef:1242; CHECK: # %bb.0:1243; CHECK-NEXT: vmalef %v24, %v24, %v26, %v281244; CHECK-NEXT: br %r141245 %res = call <2 x i64> @llvm.s390.vmalef(<4 x i32> %a, <4 x i32> %b,1246 <2 x i64> %c)1247 ret <2 x i64> %res1248}1249 1250; VMAOB.1251define <8 x i16> @test_vmaob(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {1252; CHECK-LABEL: test_vmaob:1253; CHECK: # %bb.0:1254; CHECK-NEXT: vmaob %v24, %v24, %v26, %v281255; CHECK-NEXT: br %r141256 %res = call <8 x i16> @llvm.s390.vmaob(<16 x i8> %a, <16 x i8> %b,1257 <8 x i16> %c)1258 ret <8 x i16> %res1259}1260 1261; VMAOH.1262define <4 x i32> @test_vmaoh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {1263; CHECK-LABEL: test_vmaoh:1264; CHECK: # %bb.0:1265; CHECK-NEXT: vmaoh %v24, %v24, %v26, %v281266; CHECK-NEXT: br %r141267 %res = call <4 x i32> @llvm.s390.vmaoh(<8 x i16> %a, <8 x i16> %b,1268 <4 x i32> %c)1269 ret <4 x i32> %res1270}1271 1272; VMAOF.1273define <2 x i64> @test_vmaof(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {1274; CHECK-LABEL: test_vmaof:1275; CHECK: # %bb.0:1276; CHECK-NEXT: vmaof %v24, %v24, %v26, %v281277; CHECK-NEXT: br %r141278 %res = call <2 x i64> @llvm.s390.vmaof(<4 x i32> %a, <4 x i32> %b,1279 <2 x i64> %c)1280 ret <2 x i64> %res1281}1282 1283; VMALOB.1284define <8 x i16> @test_vmalob(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c) {1285; CHECK-LABEL: test_vmalob:1286; CHECK: # %bb.0:1287; CHECK-NEXT: vmalob %v24, %v24, %v26, %v281288; CHECK-NEXT: br %r141289 %res = call <8 x i16> @llvm.s390.vmalob(<16 x i8> %a, <16 x i8> %b,1290 <8 x i16> %c)1291 ret <8 x i16> %res1292}1293 1294; VMALOH.1295define <4 x i32> @test_vmaloh(<8 x i16> %a, <8 x i16> %b, <4 x i32> %c) {1296; CHECK-LABEL: test_vmaloh:1297; CHECK: # %bb.0:1298; CHECK-NEXT: vmaloh %v24, %v24, %v26, %v281299; CHECK-NEXT: br %r141300 %res = call <4 x i32> @llvm.s390.vmaloh(<8 x i16> %a, <8 x i16> %b,1301 <4 x i32> %c)1302 ret <4 x i32> %res1303}1304 1305; VMALOF.1306define <2 x i64> @test_vmalof(<4 x i32> %a, <4 x i32> %b, <2 x i64> %c) {1307; CHECK-LABEL: test_vmalof:1308; CHECK: # %bb.0:1309; CHECK-NEXT: vmalof %v24, %v24, %v26, %v281310; CHECK-NEXT: br %r141311 %res = call <2 x i64> @llvm.s390.vmalof(<4 x i32> %a, <4 x i32> %b,1312 <2 x i64> %c)1313 ret <2 x i64> %res1314}1315 1316; VMHB.1317define <16 x i8> @test_vmhb(<16 x i8> %a, <16 x i8> %b) {1318; CHECK-LABEL: test_vmhb:1319; CHECK: # %bb.0:1320; CHECK-NEXT: vmhb %v24, %v24, %v261321; CHECK-NEXT: br %r141322 %res = call <16 x i8> @llvm.s390.vmhb(<16 x i8> %a, <16 x i8> %b)1323 ret <16 x i8> %res1324}1325 1326; VMHH.1327define <8 x i16> @test_vmhh(<8 x i16> %a, <8 x i16> %b) {1328; CHECK-LABEL: test_vmhh:1329; CHECK: # %bb.0:1330; CHECK-NEXT: vmhh %v24, %v24, %v261331; CHECK-NEXT: br %r141332 %res = call <8 x i16> @llvm.s390.vmhh(<8 x i16> %a, <8 x i16> %b)1333 ret <8 x i16> %res1334}1335 1336; VMHF.1337define <4 x i32> @test_vmhf(<4 x i32> %a, <4 x i32> %b) {1338; CHECK-LABEL: test_vmhf:1339; CHECK: # %bb.0:1340; CHECK-NEXT: vmhf %v24, %v24, %v261341; CHECK-NEXT: br %r141342 %res = call <4 x i32> @llvm.s390.vmhf(<4 x i32> %a, <4 x i32> %b)1343 ret <4 x i32> %res1344}1345 1346; VMLHB.1347define <16 x i8> @test_vmlhb(<16 x i8> %a, <16 x i8> %b) {1348; CHECK-LABEL: test_vmlhb:1349; CHECK: # %bb.0:1350; CHECK-NEXT: vmlhb %v24, %v24, %v261351; CHECK-NEXT: br %r141352 %res = call <16 x i8> @llvm.s390.vmlhb(<16 x i8> %a, <16 x i8> %b)1353 ret <16 x i8> %res1354}1355 1356; VMLHH.1357define <8 x i16> @test_vmlhh(<8 x i16> %a, <8 x i16> %b) {1358; CHECK-LABEL: test_vmlhh:1359; CHECK: # %bb.0:1360; CHECK-NEXT: vmlhh %v24, %v24, %v261361; CHECK-NEXT: br %r141362 %res = call <8 x i16> @llvm.s390.vmlhh(<8 x i16> %a, <8 x i16> %b)1363 ret <8 x i16> %res1364}1365 1366; VMLHF.1367define <4 x i32> @test_vmlhf(<4 x i32> %a, <4 x i32> %b) {1368; CHECK-LABEL: test_vmlhf:1369; CHECK: # %bb.0:1370; CHECK-NEXT: vmlhf %v24, %v24, %v261371; CHECK-NEXT: br %r141372 %res = call <4 x i32> @llvm.s390.vmlhf(<4 x i32> %a, <4 x i32> %b)1373 ret <4 x i32> %res1374}1375 1376; VMEB.1377define <8 x i16> @test_vmeb(<16 x i8> %a, <16 x i8> %b) {1378; CHECK-LABEL: test_vmeb:1379; CHECK: # %bb.0:1380; CHECK-NEXT: vmeb %v24, %v24, %v261381; CHECK-NEXT: br %r141382 %res = call <8 x i16> @llvm.s390.vmeb(<16 x i8> %a, <16 x i8> %b)1383 ret <8 x i16> %res1384}1385 1386; VMEH.1387define <4 x i32> @test_vmeh(<8 x i16> %a, <8 x i16> %b) {1388; CHECK-LABEL: test_vmeh:1389; CHECK: # %bb.0:1390; CHECK-NEXT: vmeh %v24, %v24, %v261391; CHECK-NEXT: br %r141392 %res = call <4 x i32> @llvm.s390.vmeh(<8 x i16> %a, <8 x i16> %b)1393 ret <4 x i32> %res1394}1395 1396; VMEF.1397define <2 x i64> @test_vmef(<4 x i32> %a, <4 x i32> %b) {1398; CHECK-LABEL: test_vmef:1399; CHECK: # %bb.0:1400; CHECK-NEXT: vmef %v24, %v24, %v261401; CHECK-NEXT: br %r141402 %res = call <2 x i64> @llvm.s390.vmef(<4 x i32> %a, <4 x i32> %b)1403 ret <2 x i64> %res1404}1405 1406; VMLEB.1407define <8 x i16> @test_vmleb(<16 x i8> %a, <16 x i8> %b) {1408; CHECK-LABEL: test_vmleb:1409; CHECK: # %bb.0:1410; CHECK-NEXT: vmleb %v24, %v24, %v261411; CHECK-NEXT: br %r141412 %res = call <8 x i16> @llvm.s390.vmleb(<16 x i8> %a, <16 x i8> %b)1413 ret <8 x i16> %res1414}1415 1416; VMLEH.1417define <4 x i32> @test_vmleh(<8 x i16> %a, <8 x i16> %b) {1418; CHECK-LABEL: test_vmleh:1419; CHECK: # %bb.0:1420; CHECK-NEXT: vmleh %v24, %v24, %v261421; CHECK-NEXT: br %r141422 %res = call <4 x i32> @llvm.s390.vmleh(<8 x i16> %a, <8 x i16> %b)1423 ret <4 x i32> %res1424}1425 1426; VMLEF.1427define <2 x i64> @test_vmlef(<4 x i32> %a, <4 x i32> %b) {1428; CHECK-LABEL: test_vmlef:1429; CHECK: # %bb.0:1430; CHECK-NEXT: vmlef %v24, %v24, %v261431; CHECK-NEXT: br %r141432 %res = call <2 x i64> @llvm.s390.vmlef(<4 x i32> %a, <4 x i32> %b)1433 ret <2 x i64> %res1434}1435 1436; VMOB.1437define <8 x i16> @test_vmob(<16 x i8> %a, <16 x i8> %b) {1438; CHECK-LABEL: test_vmob:1439; CHECK: # %bb.0:1440; CHECK-NEXT: vmob %v24, %v24, %v261441; CHECK-NEXT: br %r141442 %res = call <8 x i16> @llvm.s390.vmob(<16 x i8> %a, <16 x i8> %b)1443 ret <8 x i16> %res1444}1445 1446; VMOH.1447define <4 x i32> @test_vmoh(<8 x i16> %a, <8 x i16> %b) {1448; CHECK-LABEL: test_vmoh:1449; CHECK: # %bb.0:1450; CHECK-NEXT: vmoh %v24, %v24, %v261451; CHECK-NEXT: br %r141452 %res = call <4 x i32> @llvm.s390.vmoh(<8 x i16> %a, <8 x i16> %b)1453 ret <4 x i32> %res1454}1455 1456; VMOF.1457define <2 x i64> @test_vmof(<4 x i32> %a, <4 x i32> %b) {1458; CHECK-LABEL: test_vmof:1459; CHECK: # %bb.0:1460; CHECK-NEXT: vmof %v24, %v24, %v261461; CHECK-NEXT: br %r141462 %res = call <2 x i64> @llvm.s390.vmof(<4 x i32> %a, <4 x i32> %b)1463 ret <2 x i64> %res1464}1465 1466; VMLOB.1467define <8 x i16> @test_vmlob(<16 x i8> %a, <16 x i8> %b) {1468; CHECK-LABEL: test_vmlob:1469; CHECK: # %bb.0:1470; CHECK-NEXT: vmlob %v24, %v24, %v261471; CHECK-NEXT: br %r141472 %res = call <8 x i16> @llvm.s390.vmlob(<16 x i8> %a, <16 x i8> %b)1473 ret <8 x i16> %res1474}1475 1476; VMLOH.1477define <4 x i32> @test_vmloh(<8 x i16> %a, <8 x i16> %b) {1478; CHECK-LABEL: test_vmloh:1479; CHECK: # %bb.0:1480; CHECK-NEXT: vmloh %v24, %v24, %v261481; CHECK-NEXT: br %r141482 %res = call <4 x i32> @llvm.s390.vmloh(<8 x i16> %a, <8 x i16> %b)1483 ret <4 x i32> %res1484}1485 1486; VMLOF.1487define <2 x i64> @test_vmlof(<4 x i32> %a, <4 x i32> %b) {1488; CHECK-LABEL: test_vmlof:1489; CHECK: # %bb.0:1490; CHECK-NEXT: vmlof %v24, %v24, %v261491; CHECK-NEXT: br %r141492 %res = call <2 x i64> @llvm.s390.vmlof(<4 x i32> %a, <4 x i32> %b)1493 ret <2 x i64> %res1494}1495 1496; VERIMB.1497define <16 x i8> @test_verimb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {1498; CHECK-LABEL: test_verimb:1499; CHECK: # %bb.0:1500; CHECK-NEXT: verimb %v24, %v26, %v28, 11501; CHECK-NEXT: br %r141502 %res = call <16 x i8> @llvm.s390.verimb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c, i32 1)1503 ret <16 x i8> %res1504}1505 1506; VERIMH.1507define <8 x i16> @test_verimh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {1508; CHECK-LABEL: test_verimh:1509; CHECK: # %bb.0:1510; CHECK-NEXT: verimh %v24, %v26, %v28, 11511; CHECK-NEXT: br %r141512 %res = call <8 x i16> @llvm.s390.verimh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c, i32 1)1513 ret <8 x i16> %res1514}1515 1516; VERIMF.1517define <4 x i32> @test_verimf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {1518; CHECK-LABEL: test_verimf:1519; CHECK: # %bb.0:1520; CHECK-NEXT: verimf %v24, %v26, %v28, 11521; CHECK-NEXT: br %r141522 %res = call <4 x i32> @llvm.s390.verimf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, i32 1)1523 ret <4 x i32> %res1524}1525 1526; VERIMG.1527define <2 x i64> @test_verimg(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {1528; CHECK-LABEL: test_verimg:1529; CHECK: # %bb.0:1530; CHECK-NEXT: verimg %v24, %v26, %v28, 11531; CHECK-NEXT: br %r141532 %res = call <2 x i64> @llvm.s390.verimg(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c, i32 1)1533 ret <2 x i64> %res1534}1535 1536; VERIMB with a different mask.1537define <16 x i8> @test_verimb_254(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {1538; CHECK-LABEL: test_verimb_254:1539; CHECK: # %bb.0:1540; CHECK-NEXT: verimb %v24, %v26, %v28, 2541541; CHECK-NEXT: br %r141542 %res = call <16 x i8> @llvm.s390.verimb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c, i32 254)1543 ret <16 x i8> %res1544}1545 1546; VSL.1547define <16 x i8> @test_vsl(<16 x i8> %a, <16 x i8> %b) {1548; CHECK-LABEL: test_vsl:1549; CHECK: # %bb.0:1550; CHECK-NEXT: vsl %v24, %v24, %v261551; CHECK-NEXT: br %r141552 %res = call <16 x i8> @llvm.s390.vsl(<16 x i8> %a, <16 x i8> %b)1553 ret <16 x i8> %res1554}1555 1556; VSLB.1557define <16 x i8> @test_vslb(<16 x i8> %a, <16 x i8> %b) {1558; CHECK-LABEL: test_vslb:1559; CHECK: # %bb.0:1560; CHECK-NEXT: vslb %v24, %v24, %v261561; CHECK-NEXT: br %r141562 %res = call <16 x i8> @llvm.s390.vslb(<16 x i8> %a, <16 x i8> %b)1563 ret <16 x i8> %res1564}1565 1566; VSRA.1567define <16 x i8> @test_vsra(<16 x i8> %a, <16 x i8> %b) {1568; CHECK-LABEL: test_vsra:1569; CHECK: # %bb.0:1570; CHECK-NEXT: vsra %v24, %v24, %v261571; CHECK-NEXT: br %r141572 %res = call <16 x i8> @llvm.s390.vsra(<16 x i8> %a, <16 x i8> %b)1573 ret <16 x i8> %res1574}1575 1576; VSRAB.1577define <16 x i8> @test_vsrab(<16 x i8> %a, <16 x i8> %b) {1578; CHECK-LABEL: test_vsrab:1579; CHECK: # %bb.0:1580; CHECK-NEXT: vsrab %v24, %v24, %v261581; CHECK-NEXT: br %r141582 %res = call <16 x i8> @llvm.s390.vsrab(<16 x i8> %a, <16 x i8> %b)1583 ret <16 x i8> %res1584}1585 1586; VSRL.1587define <16 x i8> @test_vsrl(<16 x i8> %a, <16 x i8> %b) {1588; CHECK-LABEL: test_vsrl:1589; CHECK: # %bb.0:1590; CHECK-NEXT: vsrl %v24, %v24, %v261591; CHECK-NEXT: br %r141592 %res = call <16 x i8> @llvm.s390.vsrl(<16 x i8> %a, <16 x i8> %b)1593 ret <16 x i8> %res1594}1595 1596; VSRLB.1597define <16 x i8> @test_vsrlb(<16 x i8> %a, <16 x i8> %b) {1598; CHECK-LABEL: test_vsrlb:1599; CHECK: # %bb.0:1600; CHECK-NEXT: vsrlb %v24, %v24, %v261601; CHECK-NEXT: br %r141602 %res = call <16 x i8> @llvm.s390.vsrlb(<16 x i8> %a, <16 x i8> %b)1603 ret <16 x i8> %res1604}1605 1606; VSLDB with the minimum useful value.1607define <16 x i8> @test_vsldb_1(<16 x i8> %a, <16 x i8> %b) {1608; CHECK-LABEL: test_vsldb_1:1609; CHECK: # %bb.0:1610; CHECK-NEXT: vsldb %v24, %v24, %v26, 11611; CHECK-NEXT: br %r141612 %res = call <16 x i8> @llvm.s390.vsldb(<16 x i8> %a, <16 x i8> %b, i32 1)1613 ret <16 x i8> %res1614}1615 1616; VSLDB with the maximum value.1617define <16 x i8> @test_vsldb_15(<16 x i8> %a, <16 x i8> %b) {1618; CHECK-LABEL: test_vsldb_15:1619; CHECK: # %bb.0:1620; CHECK-NEXT: vsldb %v24, %v24, %v26, 151621; CHECK-NEXT: br %r141622 %res = call <16 x i8> @llvm.s390.vsldb(<16 x i8> %a, <16 x i8> %b, i32 15)1623 ret <16 x i8> %res1624}1625 1626; VSCBIB.1627define <16 x i8> @test_vscbib(<16 x i8> %a, <16 x i8> %b) {1628; CHECK-LABEL: test_vscbib:1629; CHECK: # %bb.0:1630; CHECK-NEXT: vscbib %v24, %v24, %v261631; CHECK-NEXT: br %r141632 %res = call <16 x i8> @llvm.s390.vscbib(<16 x i8> %a, <16 x i8> %b)1633 ret <16 x i8> %res1634}1635 1636; VSCBIH.1637define <8 x i16> @test_vscbih(<8 x i16> %a, <8 x i16> %b) {1638; CHECK-LABEL: test_vscbih:1639; CHECK: # %bb.0:1640; CHECK-NEXT: vscbih %v24, %v24, %v261641; CHECK-NEXT: br %r141642 %res = call <8 x i16> @llvm.s390.vscbih(<8 x i16> %a, <8 x i16> %b)1643 ret <8 x i16> %res1644}1645 1646; VSCBIF.1647define <4 x i32> @test_vscbif(<4 x i32> %a, <4 x i32> %b) {1648; CHECK-LABEL: test_vscbif:1649; CHECK: # %bb.0:1650; CHECK-NEXT: vscbif %v24, %v24, %v261651; CHECK-NEXT: br %r141652 %res = call <4 x i32> @llvm.s390.vscbif(<4 x i32> %a, <4 x i32> %b)1653 ret <4 x i32> %res1654}1655 1656; VSCBIG.1657define <2 x i64> @test_vscbig(<2 x i64> %a, <2 x i64> %b) {1658; CHECK-LABEL: test_vscbig:1659; CHECK: # %bb.0:1660; CHECK-NEXT: vscbig %v24, %v24, %v261661; CHECK-NEXT: br %r141662 %res = call <2 x i64> @llvm.s390.vscbig(<2 x i64> %a, <2 x i64> %b)1663 ret <2 x i64> %res1664}1665 1666; VSQ.1667define i128 @test_vsq(i128 %a, i128 %b) {1668; CHECK-LABEL: test_vsq:1669; CHECK: # %bb.0:1670; CHECK-NEXT: vl %v0, 0(%r4), 31671; CHECK-NEXT: vl %v1, 0(%r3), 31672; CHECK-NEXT: vsq %v0, %v1, %v01673; CHECK-NEXT: vst %v0, 0(%r2), 31674; CHECK-NEXT: br %r141675 %res = call i128 @llvm.s390.vsq(i128 %a, i128 %b)1676 ret i128 %res1677}1678 1679; VSBIQ.1680define i128 @test_vsbiq(i128 %a, i128 %b, i128 %c) {1681; CHECK-LABEL: test_vsbiq:1682; CHECK: # %bb.0:1683; CHECK-NEXT: vl %v0, 0(%r5), 31684; CHECK-NEXT: vl %v1, 0(%r4), 31685; CHECK-NEXT: vl %v2, 0(%r3), 31686; CHECK-NEXT: vsbiq %v0, %v2, %v1, %v01687; CHECK-NEXT: vst %v0, 0(%r2), 31688; CHECK-NEXT: br %r141689 %res = call i128 @llvm.s390.vsbiq(i128 %a, i128 %b, i128 %c)1690 ret i128 %res1691}1692 1693; VSCBIQ.1694define i128 @test_vscbiq(i128 %a, i128 %b) {1695; CHECK-LABEL: test_vscbiq:1696; CHECK: # %bb.0:1697; CHECK-NEXT: vl %v0, 0(%r4), 31698; CHECK-NEXT: vl %v1, 0(%r3), 31699; CHECK-NEXT: vscbiq %v0, %v1, %v01700; CHECK-NEXT: vst %v0, 0(%r2), 31701; CHECK-NEXT: br %r141702 %res = call i128 @llvm.s390.vscbiq(i128 %a, i128 %b)1703 ret i128 %res1704}1705 1706; VSBCBIQ.1707define i128 @test_vsbcbiq(i128 %a, i128 %b, i128 %c) {1708; CHECK-LABEL: test_vsbcbiq:1709; CHECK: # %bb.0:1710; CHECK-NEXT: vl %v0, 0(%r5), 31711; CHECK-NEXT: vl %v1, 0(%r4), 31712; CHECK-NEXT: vl %v2, 0(%r3), 31713; CHECK-NEXT: vsbcbiq %v0, %v2, %v1, %v01714; CHECK-NEXT: vst %v0, 0(%r2), 31715; CHECK-NEXT: br %r141716 %res = call i128 @llvm.s390.vsbcbiq(i128 %a, i128 %b, i128 %c)1717 ret i128 %res1718}1719 1720; VSUMB.1721define <4 x i32> @test_vsumb(<16 x i8> %a, <16 x i8> %b) {1722; CHECK-LABEL: test_vsumb:1723; CHECK: # %bb.0:1724; CHECK-NEXT: vsumb %v24, %v24, %v261725; CHECK-NEXT: br %r141726 %res = call <4 x i32> @llvm.s390.vsumb(<16 x i8> %a, <16 x i8> %b)1727 ret <4 x i32> %res1728}1729 1730; VSUMH.1731define <4 x i32> @test_vsumh(<8 x i16> %a, <8 x i16> %b) {1732; CHECK-LABEL: test_vsumh:1733; CHECK: # %bb.0:1734; CHECK-NEXT: vsumh %v24, %v24, %v261735; CHECK-NEXT: br %r141736 %res = call <4 x i32> @llvm.s390.vsumh(<8 x i16> %a, <8 x i16> %b)1737 ret <4 x i32> %res1738}1739 1740; VSUMGH.1741define <2 x i64> @test_vsumgh(<8 x i16> %a, <8 x i16> %b) {1742; CHECK-LABEL: test_vsumgh:1743; CHECK: # %bb.0:1744; CHECK-NEXT: vsumgh %v24, %v24, %v261745; CHECK-NEXT: br %r141746 %res = call <2 x i64> @llvm.s390.vsumgh(<8 x i16> %a, <8 x i16> %b)1747 ret <2 x i64> %res1748}1749 1750; VSUMGF.1751define <2 x i64> @test_vsumgf(<4 x i32> %a, <4 x i32> %b) {1752; CHECK-LABEL: test_vsumgf:1753; CHECK: # %bb.0:1754; CHECK-NEXT: vsumgf %v24, %v24, %v261755; CHECK-NEXT: br %r141756 %res = call <2 x i64> @llvm.s390.vsumgf(<4 x i32> %a, <4 x i32> %b)1757 ret <2 x i64> %res1758}1759 1760; VSUMQF.1761define i128 @test_vsumqf(<4 x i32> %a, <4 x i32> %b) {1762; CHECK-LABEL: test_vsumqf:1763; CHECK: # %bb.0:1764; CHECK-NEXT: vsumqf %v0, %v24, %v261765; CHECK-NEXT: vst %v0, 0(%r2), 31766; CHECK-NEXT: br %r141767 %res = call i128 @llvm.s390.vsumqf(<4 x i32> %a, <4 x i32> %b)1768 ret i128 %res1769}1770 1771; VSUMQG.1772define i128 @test_vsumqg(<2 x i64> %a, <2 x i64> %b) {1773; CHECK-LABEL: test_vsumqg:1774; CHECK: # %bb.0:1775; CHECK-NEXT: vsumqg %v0, %v24, %v261776; CHECK-NEXT: vst %v0, 0(%r2), 31777; CHECK-NEXT: br %r141778 %res = call i128 @llvm.s390.vsumqg(<2 x i64> %a, <2 x i64> %b)1779 ret i128 %res1780}1781 1782; VTM with no processing of the result.1783define i32 @test_vtm(<16 x i8> %a, <16 x i8> %b) {1784; CHECK-LABEL: test_vtm:1785; CHECK: # %bb.0:1786; CHECK-NEXT: vtm %v24, %v261787; CHECK-NEXT: ipm %r21788; CHECK-NEXT: srl %r2, 281789; CHECK-NEXT: br %r141790 %res = call i32 @llvm.s390.vtm(<16 x i8> %a, <16 x i8> %b)1791 ret i32 %res1792}1793 1794; VTM, storing to %ptr if all bits are set.1795define void @test_vtm_all_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {1796; CHECK-LABEL: test_vtm_all_store:1797; CHECK: # %bb.0:1798; CHECK-NEXT: vtm %v24, %v261799; CHECK-NEXT: bler %r141800; CHECK-NEXT: .LBB140_1: # %store1801; CHECK-NEXT: mvhi 0(%r2), 01802; CHECK-NEXT: br %r141803 %res = call i32 @llvm.s390.vtm(<16 x i8> %a, <16 x i8> %b)1804 %cmp = icmp sge i32 %res, 31805 br i1 %cmp, label %store, label %exit1806 1807store:1808 store i32 0, ptr %ptr1809 br label %exit1810 1811exit:1812 ret void1813}1814 1815; VCEQBS with no processing of the result.1816define i32 @test_vceqbs(<16 x i8> %a, <16 x i8> %b) {1817; CHECK-LABEL: test_vceqbs:1818; CHECK: # %bb.0:1819; CHECK-NEXT: vceqbs %v0, %v24, %v261820; CHECK-NEXT: ipm %r21821; CHECK-NEXT: srl %r2, 281822; CHECK-NEXT: br %r141823 %call = call {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8> %a, <16 x i8> %b)1824 %res = extractvalue {<16 x i8>, i32} %call, 11825 ret i32 %res1826}1827 1828; VCEQBS, returning 1 if any elements are equal (CC != 3).1829define i32 @test_vceqbs_any_bool(<16 x i8> %a, <16 x i8> %b) {1830; CHECK-LABEL: test_vceqbs_any_bool:1831; CHECK: # %bb.0:1832; CHECK-NEXT: vceqbs %v0, %v24, %v261833; CHECK-NEXT: lhi %r2, 01834; CHECK-NEXT: lochile %r2, 11835; CHECK-NEXT: br %r141836 %call = call {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8> %a, <16 x i8> %b)1837 %res = extractvalue {<16 x i8>, i32} %call, 11838 %cmp = icmp ne i32 %res, 31839 %ext = zext i1 %cmp to i321840 ret i32 %ext1841}1842 1843; VCEQBS, storing to %ptr if any elements are equal.1844define <16 x i8> @test_vceqbs_any_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {1845; CHECK-LABEL: test_vceqbs_any_store:1846; CHECK: # %bb.0:1847; CHECK-NEXT: vceqbs %v24, %v24, %v261848; CHECK-NEXT: bor %r141849; CHECK-NEXT: .LBB143_1: # %store1850; CHECK-NEXT: mvhi 0(%r2), 01851; CHECK-NEXT: br %r141852 %call = call {<16 x i8>, i32} @llvm.s390.vceqbs(<16 x i8> %a, <16 x i8> %b)1853 %res = extractvalue {<16 x i8>, i32} %call, 01854 %cc = extractvalue {<16 x i8>, i32} %call, 11855 %cmp = icmp ule i32 %cc, 21856 br i1 %cmp, label %store, label %exit1857 1858store:1859 store i32 0, ptr %ptr1860 br label %exit1861 1862exit:1863 ret <16 x i8> %res1864}1865 1866; VCEQHS with no processing of the result.1867define i32 @test_vceqhs(<8 x i16> %a, <8 x i16> %b) {1868; CHECK-LABEL: test_vceqhs:1869; CHECK: # %bb.0:1870; CHECK-NEXT: vceqhs %v0, %v24, %v261871; CHECK-NEXT: ipm %r21872; CHECK-NEXT: srl %r2, 281873; CHECK-NEXT: br %r141874 %call = call {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16> %a, <8 x i16> %b)1875 %res = extractvalue {<8 x i16>, i32} %call, 11876 ret i32 %res1877}1878 1879; VCEQHS, returning 1 if not all elements are equal.1880define i32 @test_vceqhs_notall_bool(<8 x i16> %a, <8 x i16> %b) {1881; CHECK-LABEL: test_vceqhs_notall_bool:1882; CHECK: # %bb.0:1883; CHECK-NEXT: vceqhs %v0, %v24, %v261884; CHECK-NEXT: lhi %r2, 01885; CHECK-NEXT: lochinhe %r2, 11886; CHECK-NEXT: br %r141887 %call = call {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16> %a, <8 x i16> %b)1888 %res = extractvalue {<8 x i16>, i32} %call, 11889 %cmp = icmp sge i32 %res, 11890 %ext = zext i1 %cmp to i321891 ret i32 %ext1892}1893 1894; VCEQHS, storing to %ptr if not all elements are equal.1895define <8 x i16> @test_vceqhs_notall_store(<8 x i16> %a, <8 x i16> %b,1896; CHECK-LABEL: test_vceqhs_notall_store:1897; CHECK: # %bb.0:1898; CHECK-NEXT: vceqhs %v24, %v24, %v261899; CHECK-NEXT: ber %r141900; CHECK-NEXT: .LBB146_1: # %store1901; CHECK-NEXT: mvhi 0(%r2), 01902; CHECK-NEXT: br %r141903 ptr %ptr) {1904 %call = call {<8 x i16>, i32} @llvm.s390.vceqhs(<8 x i16> %a, <8 x i16> %b)1905 %res = extractvalue {<8 x i16>, i32} %call, 01906 %cc = extractvalue {<8 x i16>, i32} %call, 11907 %cmp = icmp ugt i32 %cc, 01908 br i1 %cmp, label %store, label %exit1909 1910store:1911 store i32 0, ptr %ptr1912 br label %exit1913 1914exit:1915 ret <8 x i16> %res1916}1917 1918; VCEQFS with no processing of the result.1919define i32 @test_vceqfs(<4 x i32> %a, <4 x i32> %b) {1920; CHECK-LABEL: test_vceqfs:1921; CHECK: # %bb.0:1922; CHECK-NEXT: vceqfs %v0, %v24, %v261923; CHECK-NEXT: ipm %r21924; CHECK-NEXT: srl %r2, 281925; CHECK-NEXT: br %r141926 %call = call {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32> %a, <4 x i32> %b)1927 %res = extractvalue {<4 x i32>, i32} %call, 11928 ret i32 %res1929}1930 1931; VCEQFS, returning 1 if no elements are equal.1932define i32 @test_vceqfs_none_bool(<4 x i32> %a, <4 x i32> %b) {1933; CHECK-LABEL: test_vceqfs_none_bool:1934; CHECK: # %bb.0:1935; CHECK-NEXT: vceqfs %v0, %v24, %v261936; CHECK-NEXT: lhi %r2, 01937; CHECK-NEXT: lochio %r2, 11938; CHECK-NEXT: br %r141939 %call = call {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32> %a, <4 x i32> %b)1940 %res = extractvalue {<4 x i32>, i32} %call, 11941 %cmp = icmp eq i32 %res, 31942 %ext = zext i1 %cmp to i321943 ret i32 %ext1944}1945 1946; VCEQFS, storing to %ptr if no elements are equal.1947define <4 x i32> @test_vceqfs_none_store(<4 x i32> %a, <4 x i32> %b,1948; CHECK-LABEL: test_vceqfs_none_store:1949; CHECK: # %bb.0:1950; CHECK-NEXT: vceqfs %v24, %v24, %v261951; CHECK-NEXT: bler %r141952; CHECK-NEXT: .LBB149_1: # %store1953; CHECK-NEXT: mvhi 0(%r2), 01954; CHECK-NEXT: br %r141955 ptr %ptr) {1956 %call = call {<4 x i32>, i32} @llvm.s390.vceqfs(<4 x i32> %a, <4 x i32> %b)1957 %res = extractvalue {<4 x i32>, i32} %call, 01958 %cc = extractvalue {<4 x i32>, i32} %call, 11959 %cmp = icmp uge i32 %cc, 31960 br i1 %cmp, label %store, label %exit1961 1962store:1963 store i32 0, ptr %ptr1964 br label %exit1965 1966exit:1967 ret <4 x i32> %res1968}1969 1970; VCEQGS with no processing of the result.1971define i32 @test_vceqgs(<2 x i64> %a, <2 x i64> %b) {1972; CHECK-LABEL: test_vceqgs:1973; CHECK: # %bb.0:1974; CHECK-NEXT: vceqgs %v0, %v24, %v261975; CHECK-NEXT: ipm %r21976; CHECK-NEXT: srl %r2, 281977; CHECK-NEXT: br %r141978 %call = call {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64> %a, <2 x i64> %b)1979 %res = extractvalue {<2 x i64>, i32} %call, 11980 ret i32 %res1981}1982 1983; VCEQGS returning 1 if all elements are equal (CC == 0).1984define i32 @test_vceqgs_all_bool(<2 x i64> %a, <2 x i64> %b) {1985; CHECK-LABEL: test_vceqgs_all_bool:1986; CHECK: # %bb.0:1987; CHECK-NEXT: vceqgs %v0, %v24, %v261988; CHECK-NEXT: lhi %r2, 01989; CHECK-NEXT: lochie %r2, 11990; CHECK-NEXT: br %r141991 %call = call {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64> %a, <2 x i64> %b)1992 %res = extractvalue {<2 x i64>, i32} %call, 11993 %cmp = icmp ult i32 %res, 11994 %ext = zext i1 %cmp to i321995 ret i32 %ext1996}1997 1998; VCEQGS, storing to %ptr if all elements are equal.1999define <2 x i64> @test_vceqgs_all_store(<2 x i64> %a, <2 x i64> %b, ptr %ptr) {2000; CHECK-LABEL: test_vceqgs_all_store:2001; CHECK: # %bb.0:2002; CHECK-NEXT: vceqgs %v24, %v24, %v262003; CHECK-NEXT: bnher %r142004; CHECK-NEXT: .LBB152_1: # %store2005; CHECK-NEXT: mvhi 0(%r2), 02006; CHECK-NEXT: br %r142007 %call = call {<2 x i64>, i32} @llvm.s390.vceqgs(<2 x i64> %a, <2 x i64> %b)2008 %res = extractvalue {<2 x i64>, i32} %call, 02009 %cc = extractvalue {<2 x i64>, i32} %call, 12010 %cmp = icmp sle i32 %cc, 02011 br i1 %cmp, label %store, label %exit2012 2013store:2014 store i32 0, ptr %ptr2015 br label %exit2016 2017exit:2018 ret <2 x i64> %res2019}2020 2021; VCHBS with no processing of the result.2022define i32 @test_vchbs(<16 x i8> %a, <16 x i8> %b) {2023; CHECK-LABEL: test_vchbs:2024; CHECK: # %bb.0:2025; CHECK-NEXT: vchbs %v0, %v24, %v262026; CHECK-NEXT: ipm %r22027; CHECK-NEXT: srl %r2, 282028; CHECK-NEXT: br %r142029 %call = call {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8> %a, <16 x i8> %b)2030 %res = extractvalue {<16 x i8>, i32} %call, 12031 ret i32 %res2032}2033 2034; VCHBS, returning 1 if any elements are higher (CC != 3).2035define i32 @test_vchbs_any_bool(<16 x i8> %a, <16 x i8> %b) {2036; CHECK-LABEL: test_vchbs_any_bool:2037; CHECK: # %bb.0:2038; CHECK-NEXT: vchbs %v0, %v24, %v262039; CHECK-NEXT: lhi %r2, 02040; CHECK-NEXT: lochile %r2, 12041; CHECK-NEXT: br %r142042 %call = call {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8> %a, <16 x i8> %b)2043 %res = extractvalue {<16 x i8>, i32} %call, 12044 %cmp = icmp ne i32 %res, 32045 %ext = zext i1 %cmp to i322046 ret i32 %ext2047}2048 2049; VCHBS, storing to %ptr if any elements are higher.2050define <16 x i8> @test_vchbs_any_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {2051; CHECK-LABEL: test_vchbs_any_store:2052; CHECK: # %bb.0:2053; CHECK-NEXT: vchbs %v24, %v24, %v262054; CHECK-NEXT: bor %r142055; CHECK-NEXT: .LBB155_1: # %store2056; CHECK-NEXT: mvhi 0(%r2), 02057; CHECK-NEXT: br %r142058 %call = call {<16 x i8>, i32} @llvm.s390.vchbs(<16 x i8> %a, <16 x i8> %b)2059 %res = extractvalue {<16 x i8>, i32} %call, 02060 %cc = extractvalue {<16 x i8>, i32} %call, 12061 %cmp = icmp ule i32 %cc, 22062 br i1 %cmp, label %store, label %exit2063 2064store:2065 store i32 0, ptr %ptr2066 br label %exit2067 2068exit:2069 ret <16 x i8> %res2070}2071 2072; VCHHS with no processing of the result.2073define i32 @test_vchhs(<8 x i16> %a, <8 x i16> %b) {2074; CHECK-LABEL: test_vchhs:2075; CHECK: # %bb.0:2076; CHECK-NEXT: vchhs %v0, %v24, %v262077; CHECK-NEXT: ipm %r22078; CHECK-NEXT: srl %r2, 282079; CHECK-NEXT: br %r142080 %call = call {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16> %a, <8 x i16> %b)2081 %res = extractvalue {<8 x i16>, i32} %call, 12082 ret i32 %res2083}2084 2085; VCHHS, returning 1 if not all elements are higher.2086define i32 @test_vchhs_notall_bool(<8 x i16> %a, <8 x i16> %b) {2087; CHECK-LABEL: test_vchhs_notall_bool:2088; CHECK: # %bb.0:2089; CHECK-NEXT: vchhs %v0, %v24, %v262090; CHECK-NEXT: lhi %r2, 02091; CHECK-NEXT: lochinhe %r2, 12092; CHECK-NEXT: br %r142093 %call = call {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16> %a, <8 x i16> %b)2094 %res = extractvalue {<8 x i16>, i32} %call, 12095 %cmp = icmp sge i32 %res, 12096 %ext = zext i1 %cmp to i322097 ret i32 %ext2098}2099 2100; VCHHS, storing to %ptr if not all elements are higher.2101define <8 x i16> @test_vchhs_notall_store(<8 x i16> %a, <8 x i16> %b,2102; CHECK-LABEL: test_vchhs_notall_store:2103; CHECK: # %bb.0:2104; CHECK-NEXT: vchhs %v24, %v24, %v262105; CHECK-NEXT: ber %r142106; CHECK-NEXT: .LBB158_1: # %store2107; CHECK-NEXT: mvhi 0(%r2), 02108; CHECK-NEXT: br %r142109 ptr %ptr) {2110 %call = call {<8 x i16>, i32} @llvm.s390.vchhs(<8 x i16> %a, <8 x i16> %b)2111 %res = extractvalue {<8 x i16>, i32} %call, 02112 %cc = extractvalue {<8 x i16>, i32} %call, 12113 %cmp = icmp ugt i32 %cc, 02114 br i1 %cmp, label %store, label %exit2115 2116store:2117 store i32 0, ptr %ptr2118 br label %exit2119 2120exit:2121 ret <8 x i16> %res2122}2123 2124; VCHFS with no processing of the result.2125define i32 @test_vchfs(<4 x i32> %a, <4 x i32> %b) {2126; CHECK-LABEL: test_vchfs:2127; CHECK: # %bb.0:2128; CHECK-NEXT: vchfs %v0, %v24, %v262129; CHECK-NEXT: ipm %r22130; CHECK-NEXT: srl %r2, 282131; CHECK-NEXT: br %r142132 %call = call {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32> %a, <4 x i32> %b)2133 %res = extractvalue {<4 x i32>, i32} %call, 12134 ret i32 %res2135}2136 2137; VCHFS, returning 1 if no elements are higher.2138define i32 @test_vchfs_none_bool(<4 x i32> %a, <4 x i32> %b) {2139; CHECK-LABEL: test_vchfs_none_bool:2140; CHECK: # %bb.0:2141; CHECK-NEXT: vchfs %v0, %v24, %v262142; CHECK-NEXT: lhi %r2, 02143; CHECK-NEXT: lochio %r2, 12144; CHECK-NEXT: br %r142145 %call = call {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32> %a, <4 x i32> %b)2146 %res = extractvalue {<4 x i32>, i32} %call, 12147 %cmp = icmp eq i32 %res, 32148 %ext = zext i1 %cmp to i322149 ret i32 %ext2150}2151 2152; VCHFS, storing to %ptr if no elements are higher.2153define <4 x i32> @test_vchfs_none_store(<4 x i32> %a, <4 x i32> %b, ptr %ptr) {2154; CHECK-LABEL: test_vchfs_none_store:2155; CHECK: # %bb.0:2156; CHECK-NEXT: vchfs %v24, %v24, %v262157; CHECK-NEXT: bler %r142158; CHECK-NEXT: .LBB161_1: # %store2159; CHECK-NEXT: mvhi 0(%r2), 02160; CHECK-NEXT: br %r142161 %call = call {<4 x i32>, i32} @llvm.s390.vchfs(<4 x i32> %a, <4 x i32> %b)2162 %res = extractvalue {<4 x i32>, i32} %call, 02163 %cc = extractvalue {<4 x i32>, i32} %call, 12164 %cmp = icmp uge i32 %cc, 32165 br i1 %cmp, label %store, label %exit2166 2167store:2168 store i32 0, ptr %ptr2169 br label %exit2170 2171exit:2172 ret <4 x i32> %res2173}2174 2175; VCHGS with no processing of the result.2176define i32 @test_vchgs(<2 x i64> %a, <2 x i64> %b) {2177; CHECK-LABEL: test_vchgs:2178; CHECK: # %bb.0:2179; CHECK-NEXT: vchgs %v0, %v24, %v262180; CHECK-NEXT: ipm %r22181; CHECK-NEXT: srl %r2, 282182; CHECK-NEXT: br %r142183 %call = call {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64> %a, <2 x i64> %b)2184 %res = extractvalue {<2 x i64>, i32} %call, 12185 ret i32 %res2186}2187 2188; VCHGS returning 1 if all elements are higher (CC == 0).2189define i32 @test_vchgs_all_bool(<2 x i64> %a, <2 x i64> %b) {2190; CHECK-LABEL: test_vchgs_all_bool:2191; CHECK: # %bb.0:2192; CHECK-NEXT: vchgs %v0, %v24, %v262193; CHECK-NEXT: lhi %r2, 02194; CHECK-NEXT: lochie %r2, 12195; CHECK-NEXT: br %r142196 %call = call {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64> %a, <2 x i64> %b)2197 %res = extractvalue {<2 x i64>, i32} %call, 12198 %cmp = icmp ult i32 %res, 12199 %ext = zext i1 %cmp to i322200 ret i32 %ext2201}2202 2203; VCHGS, storing to %ptr if all elements are higher.2204define <2 x i64> @test_vchgs_all_store(<2 x i64> %a, <2 x i64> %b, ptr %ptr) {2205; CHECK-LABEL: test_vchgs_all_store:2206; CHECK: # %bb.0:2207; CHECK-NEXT: vchgs %v24, %v24, %v262208; CHECK-NEXT: bnher %r142209; CHECK-NEXT: .LBB164_1: # %store2210; CHECK-NEXT: mvhi 0(%r2), 02211; CHECK-NEXT: br %r142212 %call = call {<2 x i64>, i32} @llvm.s390.vchgs(<2 x i64> %a, <2 x i64> %b)2213 %res = extractvalue {<2 x i64>, i32} %call, 02214 %cc = extractvalue {<2 x i64>, i32} %call, 12215 %cmp = icmp sle i32 %cc, 02216 br i1 %cmp, label %store, label %exit2217 2218store:2219 store i32 0, ptr %ptr2220 br label %exit2221 2222exit:2223 ret <2 x i64> %res2224}2225 2226; VCHLBS with no processing of the result.2227define i32 @test_vchlbs(<16 x i8> %a, <16 x i8> %b) {2228; CHECK-LABEL: test_vchlbs:2229; CHECK: # %bb.0:2230; CHECK-NEXT: vchlbs %v0, %v24, %v262231; CHECK-NEXT: ipm %r22232; CHECK-NEXT: srl %r2, 282233; CHECK-NEXT: br %r142234 %call = call {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8> %a, <16 x i8> %b)2235 %res = extractvalue {<16 x i8>, i32} %call, 12236 ret i32 %res2237}2238 2239; VCHLBS, returning 1 if any elements are higher (CC != 3).2240define i32 @test_vchlbs_any_bool(<16 x i8> %a, <16 x i8> %b) {2241; CHECK-LABEL: test_vchlbs_any_bool:2242; CHECK: # %bb.0:2243; CHECK-NEXT: vchlbs %v0, %v24, %v262244; CHECK-NEXT: lhi %r2, 02245; CHECK-NEXT: lochile %r2, 12246; CHECK-NEXT: br %r142247 %call = call {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8> %a, <16 x i8> %b)2248 %res = extractvalue {<16 x i8>, i32} %call, 12249 %cmp = icmp ne i32 %res, 32250 %ext = zext i1 %cmp to i322251 ret i32 %ext2252}2253 2254; VCHLBS, storing to %ptr if any elements are higher.2255define <16 x i8> @test_vchlbs_any_store(<16 x i8> %a, <16 x i8> %b, ptr %ptr) {2256; CHECK-LABEL: test_vchlbs_any_store:2257; CHECK: # %bb.0:2258; CHECK-NEXT: vchlbs %v24, %v24, %v262259; CHECK-NEXT: bor %r142260; CHECK-NEXT: .LBB167_1: # %store2261; CHECK-NEXT: mvhi 0(%r2), 02262; CHECK-NEXT: br %r142263 %call = call {<16 x i8>, i32} @llvm.s390.vchlbs(<16 x i8> %a, <16 x i8> %b)2264 %res = extractvalue {<16 x i8>, i32} %call, 02265 %cc = extractvalue {<16 x i8>, i32} %call, 12266 %cmp = icmp sle i32 %cc, 22267 br i1 %cmp, label %store, label %exit2268 2269store:2270 store i32 0, ptr %ptr2271 br label %exit2272 2273exit:2274 ret <16 x i8> %res2275}2276 2277; VCHLHS with no processing of the result.2278define i32 @test_vchlhs(<8 x i16> %a, <8 x i16> %b) {2279; CHECK-LABEL: test_vchlhs:2280; CHECK: # %bb.0:2281; CHECK-NEXT: vchlhs %v0, %v24, %v262282; CHECK-NEXT: ipm %r22283; CHECK-NEXT: srl %r2, 282284; CHECK-NEXT: br %r142285 %call = call {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16> %a, <8 x i16> %b)2286 %res = extractvalue {<8 x i16>, i32} %call, 12287 ret i32 %res2288}2289 2290; VCHLHS, returning 1 if not all elements are higher.2291define i32 @test_vchlhs_notall_bool(<8 x i16> %a, <8 x i16> %b) {2292; CHECK-LABEL: test_vchlhs_notall_bool:2293; CHECK: # %bb.0:2294; CHECK-NEXT: vchlhs %v0, %v24, %v262295; CHECK-NEXT: lhi %r2, 02296; CHECK-NEXT: lochinhe %r2, 12297; CHECK-NEXT: br %r142298 %call = call {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16> %a, <8 x i16> %b)2299 %res = extractvalue {<8 x i16>, i32} %call, 12300 %cmp = icmp uge i32 %res, 12301 %ext = zext i1 %cmp to i322302 ret i32 %ext2303}2304 2305; VCHLHS, storing to %ptr if not all elements are higher.2306define <8 x i16> @test_vchlhs_notall_store(<8 x i16> %a, <8 x i16> %b,2307; CHECK-LABEL: test_vchlhs_notall_store:2308; CHECK: # %bb.0:2309; CHECK-NEXT: vchlhs %v24, %v24, %v262310; CHECK-NEXT: ber %r142311; CHECK-NEXT: .LBB170_1: # %store2312; CHECK-NEXT: mvhi 0(%r2), 02313; CHECK-NEXT: br %r142314 ptr %ptr) {2315 %call = call {<8 x i16>, i32} @llvm.s390.vchlhs(<8 x i16> %a, <8 x i16> %b)2316 %res = extractvalue {<8 x i16>, i32} %call, 02317 %cc = extractvalue {<8 x i16>, i32} %call, 12318 %cmp = icmp sgt i32 %cc, 02319 br i1 %cmp, label %store, label %exit2320 2321store:2322 store i32 0, ptr %ptr2323 br label %exit2324 2325exit:2326 ret <8 x i16> %res2327}2328 2329; VCHLFS with no processing of the result.2330define i32 @test_vchlfs(<4 x i32> %a, <4 x i32> %b) {2331; CHECK-LABEL: test_vchlfs:2332; CHECK: # %bb.0:2333; CHECK-NEXT: vchlfs %v0, %v24, %v262334; CHECK-NEXT: ipm %r22335; CHECK-NEXT: srl %r2, 282336; CHECK-NEXT: br %r142337 %call = call {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32> %a, <4 x i32> %b)2338 %res = extractvalue {<4 x i32>, i32} %call, 12339 ret i32 %res2340}2341 2342; VCHLFS, returning 1 if no elements are higher.2343define i32 @test_vchlfs_none_bool(<4 x i32> %a, <4 x i32> %b) {2344; CHECK-LABEL: test_vchlfs_none_bool:2345; CHECK: # %bb.0:2346; CHECK-NEXT: vchlfs %v0, %v24, %v262347; CHECK-NEXT: lhi %r2, 02348; CHECK-NEXT: lochio %r2, 12349; CHECK-NEXT: br %r142350 %call = call {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32> %a, <4 x i32> %b)2351 %res = extractvalue {<4 x i32>, i32} %call, 12352 %cmp = icmp eq i32 %res, 32353 %ext = zext i1 %cmp to i322354 ret i32 %ext2355}2356 2357; VCHLFS, storing to %ptr if no elements are higher.2358define <4 x i32> @test_vchlfs_none_store(<4 x i32> %a, <4 x i32> %b,2359; CHECK-LABEL: test_vchlfs_none_store:2360; CHECK: # %bb.0:2361; CHECK-NEXT: vchlfs %v24, %v24, %v262362; CHECK-NEXT: bler %r142363; CHECK-NEXT: .LBB173_1: # %store2364; CHECK-NEXT: mvhi 0(%r2), 02365; CHECK-NEXT: br %r142366 ptr %ptr) {2367 %call = call {<4 x i32>, i32} @llvm.s390.vchlfs(<4 x i32> %a, <4 x i32> %b)2368 %res = extractvalue {<4 x i32>, i32} %call, 02369 %cc = extractvalue {<4 x i32>, i32} %call, 12370 %cmp = icmp sge i32 %cc, 32371 br i1 %cmp, label %store, label %exit2372 2373store:2374 store i32 0, ptr %ptr2375 br label %exit2376 2377exit:2378 ret <4 x i32> %res2379}2380 2381; VCHLGS with no processing of the result.2382define i32 @test_vchlgs(<2 x i64> %a, <2 x i64> %b) {2383; CHECK-LABEL: test_vchlgs:2384; CHECK: # %bb.0:2385; CHECK-NEXT: vchlgs %v0, %v24, %v262386; CHECK-NEXT: ipm %r22387; CHECK-NEXT: srl %r2, 282388; CHECK-NEXT: br %r142389 %call = call {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64> %a, <2 x i64> %b)2390 %res = extractvalue {<2 x i64>, i32} %call, 12391 ret i32 %res2392}2393 2394; VCHLGS returning 1 if all elements are higher (CC == 0).2395define i32 @test_vchlgs_all_bool(<2 x i64> %a, <2 x i64> %b) {2396; CHECK-LABEL: test_vchlgs_all_bool:2397; CHECK: # %bb.0:2398; CHECK-NEXT: vchlgs %v0, %v24, %v262399; CHECK-NEXT: lhi %r2, 02400; CHECK-NEXT: lochie %r2, 12401; CHECK-NEXT: br %r142402 %call = call {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64> %a, <2 x i64> %b)2403 %res = extractvalue {<2 x i64>, i32} %call, 12404 %cmp = icmp slt i32 %res, 12405 %ext = zext i1 %cmp to i322406 ret i32 %ext2407}2408 2409; VCHLGS, storing to %ptr if all elements are higher.2410define <2 x i64> @test_vchlgs_all_store(<2 x i64> %a, <2 x i64> %b, ptr %ptr) {2411; CHECK-LABEL: test_vchlgs_all_store:2412; CHECK: # %bb.0:2413; CHECK-NEXT: vchlgs %v24, %v24, %v262414; CHECK-NEXT: bnher %r142415; CHECK-NEXT: .LBB176_1: # %store2416; CHECK-NEXT: mvhi 0(%r2), 02417; CHECK-NEXT: br %r142418 %call = call {<2 x i64>, i32} @llvm.s390.vchlgs(<2 x i64> %a, <2 x i64> %b)2419 %res = extractvalue {<2 x i64>, i32} %call, 02420 %cc = extractvalue {<2 x i64>, i32} %call, 12421 %cmp = icmp ule i32 %cc, 02422 br i1 %cmp, label %store, label %exit2423 2424store:2425 store i32 0, ptr %ptr2426 br label %exit2427 2428exit:2429 ret <2 x i64> %res2430}2431 2432; VFAEB with !IN !RT.2433define <16 x i8> @test_vfaeb_0(<16 x i8> %a, <16 x i8> %b) {2434; CHECK-LABEL: test_vfaeb_0:2435; CHECK: # %bb.0:2436; CHECK-NEXT: vfaeb %v24, %v24, %v26, 02437; CHECK-NEXT: br %r142438 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 0)2439 ret <16 x i8> %res2440}2441 2442; VFAEB with !IN RT.2443define <16 x i8> @test_vfaeb_4(<16 x i8> %a, <16 x i8> %b) {2444; CHECK-LABEL: test_vfaeb_4:2445; CHECK: # %bb.0:2446; CHECK-NEXT: vfaeb %v24, %v24, %v26, 42447; CHECK-NEXT: br %r142448 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 4)2449 ret <16 x i8> %res2450}2451 2452; VFAEB with IN !RT.2453define <16 x i8> @test_vfaeb_8(<16 x i8> %a, <16 x i8> %b) {2454; CHECK-LABEL: test_vfaeb_8:2455; CHECK: # %bb.0:2456; CHECK-NEXT: vfaeb %v24, %v24, %v26, 82457; CHECK-NEXT: br %r142458 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 8)2459 ret <16 x i8> %res2460}2461 2462; VFAEB with IN RT.2463define <16 x i8> @test_vfaeb_12(<16 x i8> %a, <16 x i8> %b) {2464; CHECK-LABEL: test_vfaeb_12:2465; CHECK: # %bb.0:2466; CHECK-NEXT: vfaeb %v24, %v24, %v26, 122467; CHECK-NEXT: br %r142468 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 12)2469 ret <16 x i8> %res2470}2471 2472; VFAEB with CS -- should be ignored.2473define <16 x i8> @test_vfaeb_1(<16 x i8> %a, <16 x i8> %b) {2474; CHECK-LABEL: test_vfaeb_1:2475; CHECK: # %bb.0:2476; CHECK-NEXT: vfaeb %v24, %v24, %v26, 02477; CHECK-NEXT: br %r142478 %res = call <16 x i8> @llvm.s390.vfaeb(<16 x i8> %a, <16 x i8> %b, i32 1)2479 ret <16 x i8> %res2480}2481 2482; VFAEH.2483define <8 x i16> @test_vfaeh(<8 x i16> %a, <8 x i16> %b) {2484; CHECK-LABEL: test_vfaeh:2485; CHECK: # %bb.0:2486; CHECK-NEXT: vfaeh %v24, %v24, %v26, 42487; CHECK-NEXT: br %r142488 %res = call <8 x i16> @llvm.s390.vfaeh(<8 x i16> %a, <8 x i16> %b, i32 4)2489 ret <8 x i16> %res2490}2491 2492; VFAEF.2493define <4 x i32> @test_vfaef(<4 x i32> %a, <4 x i32> %b) {2494; CHECK-LABEL: test_vfaef:2495; CHECK: # %bb.0:2496; CHECK-NEXT: vfaef %v24, %v24, %v26, 82497; CHECK-NEXT: br %r142498 %res = call <4 x i32> @llvm.s390.vfaef(<4 x i32> %a, <4 x i32> %b, i32 8)2499 ret <4 x i32> %res2500}2501 2502; VFAEBS.2503define <16 x i8> @test_vfaebs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {2504; CHECK-LABEL: test_vfaebs:2505; CHECK: # %bb.0:2506; CHECK-NEXT: vfaebs %v24, %v24, %v26, 02507; CHECK-NEXT: ipm %r02508; CHECK-NEXT: srl %r0, 282509; CHECK-NEXT: st %r0, 0(%r2)2510; CHECK-NEXT: br %r142511 %call = call {<16 x i8>, i32} @llvm.s390.vfaebs(<16 x i8> %a, <16 x i8> %b,2512 i32 0)2513 %res = extractvalue {<16 x i8>, i32} %call, 02514 %cc = extractvalue {<16 x i8>, i32} %call, 12515 store i32 %cc, ptr %ccptr2516 ret <16 x i8> %res2517}2518 2519; VFAEHS.2520define <8 x i16> @test_vfaehs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {2521; CHECK-LABEL: test_vfaehs:2522; CHECK: # %bb.0:2523; CHECK-NEXT: vfaehs %v24, %v24, %v26, 42524; CHECK-NEXT: ipm %r02525; CHECK-NEXT: srl %r0, 282526; CHECK-NEXT: st %r0, 0(%r2)2527; CHECK-NEXT: br %r142528 %call = call {<8 x i16>, i32} @llvm.s390.vfaehs(<8 x i16> %a, <8 x i16> %b,2529 i32 4)2530 %res = extractvalue {<8 x i16>, i32} %call, 02531 %cc = extractvalue {<8 x i16>, i32} %call, 12532 store i32 %cc, ptr %ccptr2533 ret <8 x i16> %res2534}2535 2536; VFAEFS.2537define <4 x i32> @test_vfaefs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {2538; CHECK-LABEL: test_vfaefs:2539; CHECK: # %bb.0:2540; CHECK-NEXT: vfaefs %v24, %v24, %v26, 82541; CHECK-NEXT: ipm %r02542; CHECK-NEXT: srl %r0, 282543; CHECK-NEXT: st %r0, 0(%r2)2544; CHECK-NEXT: br %r142545 %call = call {<4 x i32>, i32} @llvm.s390.vfaefs(<4 x i32> %a, <4 x i32> %b,2546 i32 8)2547 %res = extractvalue {<4 x i32>, i32} %call, 02548 %cc = extractvalue {<4 x i32>, i32} %call, 12549 store i32 %cc, ptr %ccptr2550 ret <4 x i32> %res2551}2552 2553; VFAEZB with !IN !RT.2554define <16 x i8> @test_vfaezb_0(<16 x i8> %a, <16 x i8> %b) {2555; CHECK-LABEL: test_vfaezb_0:2556; CHECK: # %bb.0:2557; CHECK-NEXT: vfaezb %v24, %v24, %v26, 02558; CHECK-NEXT: br %r142559 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 0)2560 ret <16 x i8> %res2561}2562 2563; VFAEZB with !IN RT.2564define <16 x i8> @test_vfaezb_4(<16 x i8> %a, <16 x i8> %b) {2565; CHECK-LABEL: test_vfaezb_4:2566; CHECK: # %bb.0:2567; CHECK-NEXT: vfaezb %v24, %v24, %v26, 42568; CHECK-NEXT: br %r142569 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 4)2570 ret <16 x i8> %res2571}2572 2573; VFAEZB with IN !RT.2574define <16 x i8> @test_vfaezb_8(<16 x i8> %a, <16 x i8> %b) {2575; CHECK-LABEL: test_vfaezb_8:2576; CHECK: # %bb.0:2577; CHECK-NEXT: vfaezb %v24, %v24, %v26, 82578; CHECK-NEXT: br %r142579 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 8)2580 ret <16 x i8> %res2581}2582 2583; VFAEZB with IN RT.2584define <16 x i8> @test_vfaezb_12(<16 x i8> %a, <16 x i8> %b) {2585; CHECK-LABEL: test_vfaezb_12:2586; CHECK: # %bb.0:2587; CHECK-NEXT: vfaezb %v24, %v24, %v26, 122588; CHECK-NEXT: br %r142589 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 12)2590 ret <16 x i8> %res2591}2592 2593; VFAEZB with CS -- should be ignored.2594define <16 x i8> @test_vfaezb_1(<16 x i8> %a, <16 x i8> %b) {2595; CHECK-LABEL: test_vfaezb_1:2596; CHECK: # %bb.0:2597; CHECK-NEXT: vfaezb %v24, %v24, %v26, 02598; CHECK-NEXT: br %r142599 %res = call <16 x i8> @llvm.s390.vfaezb(<16 x i8> %a, <16 x i8> %b, i32 1)2600 ret <16 x i8> %res2601}2602 2603; VFAEZH.2604define <8 x i16> @test_vfaezh(<8 x i16> %a, <8 x i16> %b) {2605; CHECK-LABEL: test_vfaezh:2606; CHECK: # %bb.0:2607; CHECK-NEXT: vfaezh %v24, %v24, %v26, 42608; CHECK-NEXT: br %r142609 %res = call <8 x i16> @llvm.s390.vfaezh(<8 x i16> %a, <8 x i16> %b, i32 4)2610 ret <8 x i16> %res2611}2612 2613; VFAEZF.2614define <4 x i32> @test_vfaezf(<4 x i32> %a, <4 x i32> %b) {2615; CHECK-LABEL: test_vfaezf:2616; CHECK: # %bb.0:2617; CHECK-NEXT: vfaezf %v24, %v24, %v26, 82618; CHECK-NEXT: br %r142619 %res = call <4 x i32> @llvm.s390.vfaezf(<4 x i32> %a, <4 x i32> %b, i32 8)2620 ret <4 x i32> %res2621}2622 2623; VFAEZBS.2624define <16 x i8> @test_vfaezbs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {2625; CHECK-LABEL: test_vfaezbs:2626; CHECK: # %bb.0:2627; CHECK-NEXT: vfaezbs %v24, %v24, %v26, 02628; CHECK-NEXT: ipm %r02629; CHECK-NEXT: srl %r0, 282630; CHECK-NEXT: st %r0, 0(%r2)2631; CHECK-NEXT: br %r142632 %call = call {<16 x i8>, i32} @llvm.s390.vfaezbs(<16 x i8> %a, <16 x i8> %b,2633 i32 0)2634 %res = extractvalue {<16 x i8>, i32} %call, 02635 %cc = extractvalue {<16 x i8>, i32} %call, 12636 store i32 %cc, ptr %ccptr2637 ret <16 x i8> %res2638}2639 2640; VFAEZHS.2641define <8 x i16> @test_vfaezhs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {2642; CHECK-LABEL: test_vfaezhs:2643; CHECK: # %bb.0:2644; CHECK-NEXT: vfaezhs %v24, %v24, %v26, 42645; CHECK-NEXT: ipm %r02646; CHECK-NEXT: srl %r0, 282647; CHECK-NEXT: st %r0, 0(%r2)2648; CHECK-NEXT: br %r142649 %call = call {<8 x i16>, i32} @llvm.s390.vfaezhs(<8 x i16> %a, <8 x i16> %b,2650 i32 4)2651 %res = extractvalue {<8 x i16>, i32} %call, 02652 %cc = extractvalue {<8 x i16>, i32} %call, 12653 store i32 %cc, ptr %ccptr2654 ret <8 x i16> %res2655}2656 2657; VFAEZFS.2658define <4 x i32> @test_vfaezfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {2659; CHECK-LABEL: test_vfaezfs:2660; CHECK: # %bb.0:2661; CHECK-NEXT: vfaezfs %v24, %v24, %v26, 82662; CHECK-NEXT: ipm %r02663; CHECK-NEXT: srl %r0, 282664; CHECK-NEXT: st %r0, 0(%r2)2665; CHECK-NEXT: br %r142666 %call = call {<4 x i32>, i32} @llvm.s390.vfaezfs(<4 x i32> %a, <4 x i32> %b,2667 i32 8)2668 %res = extractvalue {<4 x i32>, i32} %call, 02669 %cc = extractvalue {<4 x i32>, i32} %call, 12670 store i32 %cc, ptr %ccptr2671 ret <4 x i32> %res2672}2673 2674; VFEEB.2675define <16 x i8> @test_vfeeb_0(<16 x i8> %a, <16 x i8> %b) {2676; CHECK-LABEL: test_vfeeb_0:2677; CHECK: # %bb.0:2678; CHECK-NEXT: vfeeb %v24, %v24, %v26, 02679; CHECK-NEXT: br %r142680 %res = call <16 x i8> @llvm.s390.vfeeb(<16 x i8> %a, <16 x i8> %b)2681 ret <16 x i8> %res2682}2683 2684; VFEEH.2685define <8 x i16> @test_vfeeh(<8 x i16> %a, <8 x i16> %b) {2686; CHECK-LABEL: test_vfeeh:2687; CHECK: # %bb.0:2688; CHECK-NEXT: vfeeh %v24, %v24, %v26, 02689; CHECK-NEXT: br %r142690 %res = call <8 x i16> @llvm.s390.vfeeh(<8 x i16> %a, <8 x i16> %b)2691 ret <8 x i16> %res2692}2693 2694; VFEEF.2695define <4 x i32> @test_vfeef(<4 x i32> %a, <4 x i32> %b) {2696; CHECK-LABEL: test_vfeef:2697; CHECK: # %bb.0:2698; CHECK-NEXT: vfeef %v24, %v24, %v26, 02699; CHECK-NEXT: br %r142700 %res = call <4 x i32> @llvm.s390.vfeef(<4 x i32> %a, <4 x i32> %b)2701 ret <4 x i32> %res2702}2703 2704; VFEEBS.2705define <16 x i8> @test_vfeebs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {2706; CHECK-LABEL: test_vfeebs:2707; CHECK: # %bb.0:2708; CHECK-NEXT: vfeebs %v24, %v24, %v262709; CHECK-NEXT: ipm %r02710; CHECK-NEXT: srl %r0, 282711; CHECK-NEXT: st %r0, 0(%r2)2712; CHECK-NEXT: br %r142713 %call = call {<16 x i8>, i32} @llvm.s390.vfeebs(<16 x i8> %a, <16 x i8> %b)2714 %res = extractvalue {<16 x i8>, i32} %call, 02715 %cc = extractvalue {<16 x i8>, i32} %call, 12716 store i32 %cc, ptr %ccptr2717 ret <16 x i8> %res2718}2719 2720; VFEEHS.2721define <8 x i16> @test_vfeehs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {2722; CHECK-LABEL: test_vfeehs:2723; CHECK: # %bb.0:2724; CHECK-NEXT: vfeehs %v24, %v24, %v262725; CHECK-NEXT: ipm %r02726; CHECK-NEXT: srl %r0, 282727; CHECK-NEXT: st %r0, 0(%r2)2728; CHECK-NEXT: br %r142729 %call = call {<8 x i16>, i32} @llvm.s390.vfeehs(<8 x i16> %a, <8 x i16> %b)2730 %res = extractvalue {<8 x i16>, i32} %call, 02731 %cc = extractvalue {<8 x i16>, i32} %call, 12732 store i32 %cc, ptr %ccptr2733 ret <8 x i16> %res2734}2735 2736; VFEEFS.2737define <4 x i32> @test_vfeefs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {2738; CHECK-LABEL: test_vfeefs:2739; CHECK: # %bb.0:2740; CHECK-NEXT: vfeefs %v24, %v24, %v262741; CHECK-NEXT: ipm %r02742; CHECK-NEXT: srl %r0, 282743; CHECK-NEXT: st %r0, 0(%r2)2744; CHECK-NEXT: br %r142745 %call = call {<4 x i32>, i32} @llvm.s390.vfeefs(<4 x i32> %a, <4 x i32> %b)2746 %res = extractvalue {<4 x i32>, i32} %call, 02747 %cc = extractvalue {<4 x i32>, i32} %call, 12748 store i32 %cc, ptr %ccptr2749 ret <4 x i32> %res2750}2751 2752; VFEEZB.2753define <16 x i8> @test_vfeezb(<16 x i8> %a, <16 x i8> %b) {2754; CHECK-LABEL: test_vfeezb:2755; CHECK: # %bb.0:2756; CHECK-NEXT: vfeezb %v24, %v24, %v262757; CHECK-NEXT: br %r142758 %res = call <16 x i8> @llvm.s390.vfeezb(<16 x i8> %a, <16 x i8> %b)2759 ret <16 x i8> %res2760}2761 2762; VFEEZH.2763define <8 x i16> @test_vfeezh(<8 x i16> %a, <8 x i16> %b) {2764; CHECK-LABEL: test_vfeezh:2765; CHECK: # %bb.0:2766; CHECK-NEXT: vfeezh %v24, %v24, %v262767; CHECK-NEXT: br %r142768 %res = call <8 x i16> @llvm.s390.vfeezh(<8 x i16> %a, <8 x i16> %b)2769 ret <8 x i16> %res2770}2771 2772; VFEEZF.2773define <4 x i32> @test_vfeezf(<4 x i32> %a, <4 x i32> %b) {2774; CHECK-LABEL: test_vfeezf:2775; CHECK: # %bb.0:2776; CHECK-NEXT: vfeezf %v24, %v24, %v262777; CHECK-NEXT: br %r142778 %res = call <4 x i32> @llvm.s390.vfeezf(<4 x i32> %a, <4 x i32> %b)2779 ret <4 x i32> %res2780}2781 2782; VFEEZBS.2783define <16 x i8> @test_vfeezbs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {2784; CHECK-LABEL: test_vfeezbs:2785; CHECK: # %bb.0:2786; CHECK-NEXT: vfeezbs %v24, %v24, %v262787; CHECK-NEXT: ipm %r02788; CHECK-NEXT: srl %r0, 282789; CHECK-NEXT: st %r0, 0(%r2)2790; CHECK-NEXT: br %r142791 %call = call {<16 x i8>, i32} @llvm.s390.vfeezbs(<16 x i8> %a, <16 x i8> %b)2792 %res = extractvalue {<16 x i8>, i32} %call, 02793 %cc = extractvalue {<16 x i8>, i32} %call, 12794 store i32 %cc, ptr %ccptr2795 ret <16 x i8> %res2796}2797 2798; VFEEZHS.2799define <8 x i16> @test_vfeezhs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {2800; CHECK-LABEL: test_vfeezhs:2801; CHECK: # %bb.0:2802; CHECK-NEXT: vfeezhs %v24, %v24, %v262803; CHECK-NEXT: ipm %r02804; CHECK-NEXT: srl %r0, 282805; CHECK-NEXT: st %r0, 0(%r2)2806; CHECK-NEXT: br %r142807 %call = call {<8 x i16>, i32} @llvm.s390.vfeezhs(<8 x i16> %a, <8 x i16> %b)2808 %res = extractvalue {<8 x i16>, i32} %call, 02809 %cc = extractvalue {<8 x i16>, i32} %call, 12810 store i32 %cc, ptr %ccptr2811 ret <8 x i16> %res2812}2813 2814; VFEEZFS.2815define <4 x i32> @test_vfeezfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {2816; CHECK-LABEL: test_vfeezfs:2817; CHECK: # %bb.0:2818; CHECK-NEXT: vfeezfs %v24, %v24, %v262819; CHECK-NEXT: ipm %r02820; CHECK-NEXT: srl %r0, 282821; CHECK-NEXT: st %r0, 0(%r2)2822; CHECK-NEXT: br %r142823 %call = call {<4 x i32>, i32} @llvm.s390.vfeezfs(<4 x i32> %a, <4 x i32> %b)2824 %res = extractvalue {<4 x i32>, i32} %call, 02825 %cc = extractvalue {<4 x i32>, i32} %call, 12826 store i32 %cc, ptr %ccptr2827 ret <4 x i32> %res2828}2829 2830; VFENEB.2831define <16 x i8> @test_vfeneb_0(<16 x i8> %a, <16 x i8> %b) {2832; CHECK-LABEL: test_vfeneb_0:2833; CHECK: # %bb.0:2834; CHECK-NEXT: vfeneb %v24, %v24, %v26, 02835; CHECK-NEXT: br %r142836 %res = call <16 x i8> @llvm.s390.vfeneb(<16 x i8> %a, <16 x i8> %b)2837 ret <16 x i8> %res2838}2839 2840; VFENEH.2841define <8 x i16> @test_vfeneh(<8 x i16> %a, <8 x i16> %b) {2842; CHECK-LABEL: test_vfeneh:2843; CHECK: # %bb.0:2844; CHECK-NEXT: vfeneh %v24, %v24, %v26, 02845; CHECK-NEXT: br %r142846 %res = call <8 x i16> @llvm.s390.vfeneh(<8 x i16> %a, <8 x i16> %b)2847 ret <8 x i16> %res2848}2849 2850; VFENEF.2851define <4 x i32> @test_vfenef(<4 x i32> %a, <4 x i32> %b) {2852; CHECK-LABEL: test_vfenef:2853; CHECK: # %bb.0:2854; CHECK-NEXT: vfenef %v24, %v24, %v26, 02855; CHECK-NEXT: br %r142856 %res = call <4 x i32> @llvm.s390.vfenef(<4 x i32> %a, <4 x i32> %b)2857 ret <4 x i32> %res2858}2859 2860; VFENEBS.2861define <16 x i8> @test_vfenebs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {2862; CHECK-LABEL: test_vfenebs:2863; CHECK: # %bb.0:2864; CHECK-NEXT: vfenebs %v24, %v24, %v262865; CHECK-NEXT: ipm %r02866; CHECK-NEXT: srl %r0, 282867; CHECK-NEXT: st %r0, 0(%r2)2868; CHECK-NEXT: br %r142869 %call = call {<16 x i8>, i32} @llvm.s390.vfenebs(<16 x i8> %a, <16 x i8> %b)2870 %res = extractvalue {<16 x i8>, i32} %call, 02871 %cc = extractvalue {<16 x i8>, i32} %call, 12872 store i32 %cc, ptr %ccptr2873 ret <16 x i8> %res2874}2875 2876; VFENEHS.2877define <8 x i16> @test_vfenehs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {2878; CHECK-LABEL: test_vfenehs:2879; CHECK: # %bb.0:2880; CHECK-NEXT: vfenehs %v24, %v24, %v262881; CHECK-NEXT: ipm %r02882; CHECK-NEXT: srl %r0, 282883; CHECK-NEXT: st %r0, 0(%r2)2884; CHECK-NEXT: br %r142885 %call = call {<8 x i16>, i32} @llvm.s390.vfenehs(<8 x i16> %a, <8 x i16> %b)2886 %res = extractvalue {<8 x i16>, i32} %call, 02887 %cc = extractvalue {<8 x i16>, i32} %call, 12888 store i32 %cc, ptr %ccptr2889 ret <8 x i16> %res2890}2891 2892; VFENEFS.2893define <4 x i32> @test_vfenefs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {2894; CHECK-LABEL: test_vfenefs:2895; CHECK: # %bb.0:2896; CHECK-NEXT: vfenefs %v24, %v24, %v262897; CHECK-NEXT: ipm %r02898; CHECK-NEXT: srl %r0, 282899; CHECK-NEXT: st %r0, 0(%r2)2900; CHECK-NEXT: br %r142901 %call = call {<4 x i32>, i32} @llvm.s390.vfenefs(<4 x i32> %a, <4 x i32> %b)2902 %res = extractvalue {<4 x i32>, i32} %call, 02903 %cc = extractvalue {<4 x i32>, i32} %call, 12904 store i32 %cc, ptr %ccptr2905 ret <4 x i32> %res2906}2907 2908; VFENEZB.2909define <16 x i8> @test_vfenezb(<16 x i8> %a, <16 x i8> %b) {2910; CHECK-LABEL: test_vfenezb:2911; CHECK: # %bb.0:2912; CHECK-NEXT: vfenezb %v24, %v24, %v262913; CHECK-NEXT: br %r142914 %res = call <16 x i8> @llvm.s390.vfenezb(<16 x i8> %a, <16 x i8> %b)2915 ret <16 x i8> %res2916}2917 2918; VFENEZH.2919define <8 x i16> @test_vfenezh(<8 x i16> %a, <8 x i16> %b) {2920; CHECK-LABEL: test_vfenezh:2921; CHECK: # %bb.0:2922; CHECK-NEXT: vfenezh %v24, %v24, %v262923; CHECK-NEXT: br %r142924 %res = call <8 x i16> @llvm.s390.vfenezh(<8 x i16> %a, <8 x i16> %b)2925 ret <8 x i16> %res2926}2927 2928; VFENEZF.2929define <4 x i32> @test_vfenezf(<4 x i32> %a, <4 x i32> %b) {2930; CHECK-LABEL: test_vfenezf:2931; CHECK: # %bb.0:2932; CHECK-NEXT: vfenezf %v24, %v24, %v262933; CHECK-NEXT: br %r142934 %res = call <4 x i32> @llvm.s390.vfenezf(<4 x i32> %a, <4 x i32> %b)2935 ret <4 x i32> %res2936}2937 2938; VFENEZBS.2939define <16 x i8> @test_vfenezbs(<16 x i8> %a, <16 x i8> %b, ptr %ccptr) {2940; CHECK-LABEL: test_vfenezbs:2941; CHECK: # %bb.0:2942; CHECK-NEXT: vfenezbs %v24, %v24, %v262943; CHECK-NEXT: ipm %r02944; CHECK-NEXT: srl %r0, 282945; CHECK-NEXT: st %r0, 0(%r2)2946; CHECK-NEXT: br %r142947 %call = call {<16 x i8>, i32} @llvm.s390.vfenezbs(<16 x i8> %a, <16 x i8> %b)2948 %res = extractvalue {<16 x i8>, i32} %call, 02949 %cc = extractvalue {<16 x i8>, i32} %call, 12950 store i32 %cc, ptr %ccptr2951 ret <16 x i8> %res2952}2953 2954; VFENEZHS.2955define <8 x i16> @test_vfenezhs(<8 x i16> %a, <8 x i16> %b, ptr %ccptr) {2956; CHECK-LABEL: test_vfenezhs:2957; CHECK: # %bb.0:2958; CHECK-NEXT: vfenezhs %v24, %v24, %v262959; CHECK-NEXT: ipm %r02960; CHECK-NEXT: srl %r0, 282961; CHECK-NEXT: st %r0, 0(%r2)2962; CHECK-NEXT: br %r142963 %call = call {<8 x i16>, i32} @llvm.s390.vfenezhs(<8 x i16> %a, <8 x i16> %b)2964 %res = extractvalue {<8 x i16>, i32} %call, 02965 %cc = extractvalue {<8 x i16>, i32} %call, 12966 store i32 %cc, ptr %ccptr2967 ret <8 x i16> %res2968}2969 2970; VFENEZFS.2971define <4 x i32> @test_vfenezfs(<4 x i32> %a, <4 x i32> %b, ptr %ccptr) {2972; CHECK-LABEL: test_vfenezfs:2973; CHECK: # %bb.0:2974; CHECK-NEXT: vfenezfs %v24, %v24, %v262975; CHECK-NEXT: ipm %r02976; CHECK-NEXT: srl %r0, 282977; CHECK-NEXT: st %r0, 0(%r2)2978; CHECK-NEXT: br %r142979 %call = call {<4 x i32>, i32} @llvm.s390.vfenezfs(<4 x i32> %a, <4 x i32> %b)2980 %res = extractvalue {<4 x i32>, i32} %call, 02981 %cc = extractvalue {<4 x i32>, i32} %call, 12982 store i32 %cc, ptr %ccptr2983 ret <4 x i32> %res2984}2985 2986; VISTRB.2987define <16 x i8> @test_vistrb(<16 x i8> %a) {2988; CHECK-LABEL: test_vistrb:2989; CHECK: # %bb.0:2990; CHECK-NEXT: vistrb %v24, %v24, 02991; CHECK-NEXT: br %r142992 %res = call <16 x i8> @llvm.s390.vistrb(<16 x i8> %a)2993 ret <16 x i8> %res2994}2995 2996; VISTRH.2997define <8 x i16> @test_vistrh(<8 x i16> %a) {2998; CHECK-LABEL: test_vistrh:2999; CHECK: # %bb.0:3000; CHECK-NEXT: vistrh %v24, %v24, 03001; CHECK-NEXT: br %r143002 %res = call <8 x i16> @llvm.s390.vistrh(<8 x i16> %a)3003 ret <8 x i16> %res3004}3005 3006; VISTRF.3007define <4 x i32> @test_vistrf(<4 x i32> %a) {3008; CHECK-LABEL: test_vistrf:3009; CHECK: # %bb.0:3010; CHECK-NEXT: vistrf %v24, %v24, 03011; CHECK-NEXT: br %r143012 %res = call <4 x i32> @llvm.s390.vistrf(<4 x i32> %a)3013 ret <4 x i32> %res3014}3015 3016; VISTRBS.3017define <16 x i8> @test_vistrbs(<16 x i8> %a, ptr %ccptr) {3018; CHECK-LABEL: test_vistrbs:3019; CHECK: # %bb.0:3020; CHECK-NEXT: vistrbs %v24, %v243021; CHECK-NEXT: ipm %r03022; CHECK-NEXT: srl %r0, 283023; CHECK-NEXT: st %r0, 0(%r2)3024; CHECK-NEXT: br %r143025 %call = call {<16 x i8>, i32} @llvm.s390.vistrbs(<16 x i8> %a)3026 %res = extractvalue {<16 x i8>, i32} %call, 03027 %cc = extractvalue {<16 x i8>, i32} %call, 13028 store i32 %cc, ptr %ccptr3029 ret <16 x i8> %res3030}3031 3032; VISTRHS.3033define <8 x i16> @test_vistrhs(<8 x i16> %a, ptr %ccptr) {3034; CHECK-LABEL: test_vistrhs:3035; CHECK: # %bb.0:3036; CHECK-NEXT: vistrhs %v24, %v243037; CHECK-NEXT: ipm %r03038; CHECK-NEXT: srl %r0, 283039; CHECK-NEXT: st %r0, 0(%r2)3040; CHECK-NEXT: br %r143041 %call = call {<8 x i16>, i32} @llvm.s390.vistrhs(<8 x i16> %a)3042 %res = extractvalue {<8 x i16>, i32} %call, 03043 %cc = extractvalue {<8 x i16>, i32} %call, 13044 store i32 %cc, ptr %ccptr3045 ret <8 x i16> %res3046}3047 3048; VISTRFS.3049define <4 x i32> @test_vistrfs(<4 x i32> %a, ptr %ccptr) {3050; CHECK-LABEL: test_vistrfs:3051; CHECK: # %bb.0:3052; CHECK-NEXT: vistrfs %v24, %v243053; CHECK-NEXT: ipm %r03054; CHECK-NEXT: srl %r0, 283055; CHECK-NEXT: st %r0, 0(%r2)3056; CHECK-NEXT: br %r143057 %call = call {<4 x i32>, i32} @llvm.s390.vistrfs(<4 x i32> %a)3058 %res = extractvalue {<4 x i32>, i32} %call, 03059 %cc = extractvalue {<4 x i32>, i32} %call, 13060 store i32 %cc, ptr %ccptr3061 ret <4 x i32> %res3062}3063 3064; VSTRCB with !IN !RT.3065define <16 x i8> @test_vstrcb_0(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3066; CHECK-LABEL: test_vstrcb_0:3067; CHECK: # %bb.0:3068; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 03069; CHECK-NEXT: br %r143070 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,3071 <16 x i8> %c, i32 0)3072 ret <16 x i8> %res3073}3074 3075; VSTRCB with !IN RT.3076define <16 x i8> @test_vstrcb_4(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3077; CHECK-LABEL: test_vstrcb_4:3078; CHECK: # %bb.0:3079; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 43080; CHECK-NEXT: br %r143081 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,3082 <16 x i8> %c, i32 4)3083 ret <16 x i8> %res3084}3085 3086; VSTRCB with IN !RT.3087define <16 x i8> @test_vstrcb_8(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3088; CHECK-LABEL: test_vstrcb_8:3089; CHECK: # %bb.0:3090; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 83091; CHECK-NEXT: br %r143092 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,3093 <16 x i8> %c, i32 8)3094 ret <16 x i8> %res3095}3096 3097; VSTRCB with IN RT.3098define <16 x i8> @test_vstrcb_12(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3099; CHECK-LABEL: test_vstrcb_12:3100; CHECK: # %bb.0:3101; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 123102; CHECK-NEXT: br %r143103 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,3104 <16 x i8> %c, i32 12)3105 ret <16 x i8> %res3106}3107 3108; VSTRCB with CS -- should be ignored.3109define <16 x i8> @test_vstrcb_1(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3110; CHECK-LABEL: test_vstrcb_1:3111; CHECK: # %bb.0:3112; CHECK-NEXT: vstrcb %v24, %v24, %v26, %v28, 03113; CHECK-NEXT: br %r143114 %res = call <16 x i8> @llvm.s390.vstrcb(<16 x i8> %a, <16 x i8> %b,3115 <16 x i8> %c, i32 1)3116 ret <16 x i8> %res3117}3118 3119; VSTRCH.3120define <8 x i16> @test_vstrch(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {3121; CHECK-LABEL: test_vstrch:3122; CHECK: # %bb.0:3123; CHECK-NEXT: vstrch %v24, %v24, %v26, %v28, 43124; CHECK-NEXT: br %r143125 %res = call <8 x i16> @llvm.s390.vstrch(<8 x i16> %a, <8 x i16> %b,3126 <8 x i16> %c, i32 4)3127 ret <8 x i16> %res3128}3129 3130; VSTRCF.3131define <4 x i32> @test_vstrcf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {3132; CHECK-LABEL: test_vstrcf:3133; CHECK: # %bb.0:3134; CHECK-NEXT: vstrcf %v24, %v24, %v26, %v28, 83135; CHECK-NEXT: br %r143136 %res = call <4 x i32> @llvm.s390.vstrcf(<4 x i32> %a, <4 x i32> %b,3137 <4 x i32> %c, i32 8)3138 ret <4 x i32> %res3139}3140 3141; VSTRCBS.3142define <16 x i8> @test_vstrcbs(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c,3143; CHECK-LABEL: test_vstrcbs:3144; CHECK: # %bb.0:3145; CHECK-NEXT: vstrcbs %v24, %v24, %v26, %v28, 03146; CHECK-NEXT: ipm %r03147; CHECK-NEXT: srl %r0, 283148; CHECK-NEXT: st %r0, 0(%r2)3149; CHECK-NEXT: br %r143150 ptr %ccptr) {3151 %call = call {<16 x i8>, i32} @llvm.s390.vstrcbs(<16 x i8> %a, <16 x i8> %b,3152 <16 x i8> %c, i32 0)3153 %res = extractvalue {<16 x i8>, i32} %call, 03154 %cc = extractvalue {<16 x i8>, i32} %call, 13155 store i32 %cc, ptr %ccptr3156 ret <16 x i8> %res3157}3158 3159; VSTRCHS.3160define <8 x i16> @test_vstrchs(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c,3161; CHECK-LABEL: test_vstrchs:3162; CHECK: # %bb.0:3163; CHECK-NEXT: vstrchs %v24, %v24, %v26, %v28, 43164; CHECK-NEXT: ipm %r03165; CHECK-NEXT: srl %r0, 283166; CHECK-NEXT: st %r0, 0(%r2)3167; CHECK-NEXT: br %r143168 ptr %ccptr) {3169 %call = call {<8 x i16>, i32} @llvm.s390.vstrchs(<8 x i16> %a, <8 x i16> %b,3170 <8 x i16> %c, i32 4)3171 %res = extractvalue {<8 x i16>, i32} %call, 03172 %cc = extractvalue {<8 x i16>, i32} %call, 13173 store i32 %cc, ptr %ccptr3174 ret <8 x i16> %res3175}3176 3177; VSTRCFS.3178define <4 x i32> @test_vstrcfs(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c,3179; CHECK-LABEL: test_vstrcfs:3180; CHECK: # %bb.0:3181; CHECK-NEXT: vstrcfs %v24, %v24, %v26, %v28, 83182; CHECK-NEXT: ipm %r03183; CHECK-NEXT: srl %r0, 283184; CHECK-NEXT: st %r0, 0(%r2)3185; CHECK-NEXT: br %r143186 ptr %ccptr) {3187 %call = call {<4 x i32>, i32} @llvm.s390.vstrcfs(<4 x i32> %a, <4 x i32> %b,3188 <4 x i32> %c, i32 8)3189 %res = extractvalue {<4 x i32>, i32} %call, 03190 %cc = extractvalue {<4 x i32>, i32} %call, 13191 store i32 %cc, ptr %ccptr3192 ret <4 x i32> %res3193}3194 3195; VSTRCZB with !IN !RT.3196define <16 x i8> @test_vstrczb_0(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3197; CHECK-LABEL: test_vstrczb_0:3198; CHECK: # %bb.0:3199; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 03200; CHECK-NEXT: br %r143201 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,3202 <16 x i8> %c, i32 0)3203 ret <16 x i8> %res3204}3205 3206; VSTRCZB with !IN RT.3207define <16 x i8> @test_vstrczb_4(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3208; CHECK-LABEL: test_vstrczb_4:3209; CHECK: # %bb.0:3210; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 43211; CHECK-NEXT: br %r143212 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,3213 <16 x i8> %c, i32 4)3214 ret <16 x i8> %res3215}3216 3217; VSTRCZB with IN !RT.3218define <16 x i8> @test_vstrczb_8(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3219; CHECK-LABEL: test_vstrczb_8:3220; CHECK: # %bb.0:3221; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 83222; CHECK-NEXT: br %r143223 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,3224 <16 x i8> %c, i32 8)3225 ret <16 x i8> %res3226}3227 3228; VSTRCZB with IN RT.3229define <16 x i8> @test_vstrczb_12(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3230; CHECK-LABEL: test_vstrczb_12:3231; CHECK: # %bb.0:3232; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 123233; CHECK-NEXT: br %r143234 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,3235 <16 x i8> %c, i32 12)3236 ret <16 x i8> %res3237}3238 3239; VSTRCZB with CS -- should be ignored.3240define <16 x i8> @test_vstrczb_1(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c) {3241; CHECK-LABEL: test_vstrczb_1:3242; CHECK: # %bb.0:3243; CHECK-NEXT: vstrczb %v24, %v24, %v26, %v28, 03244; CHECK-NEXT: br %r143245 %res = call <16 x i8> @llvm.s390.vstrczb(<16 x i8> %a, <16 x i8> %b,3246 <16 x i8> %c, i32 1)3247 ret <16 x i8> %res3248}3249 3250; VSTRCZH.3251define <8 x i16> @test_vstrczh(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c) {3252; CHECK-LABEL: test_vstrczh:3253; CHECK: # %bb.0:3254; CHECK-NEXT: vstrczh %v24, %v24, %v26, %v28, 43255; CHECK-NEXT: br %r143256 %res = call <8 x i16> @llvm.s390.vstrczh(<8 x i16> %a, <8 x i16> %b,3257 <8 x i16> %c, i32 4)3258 ret <8 x i16> %res3259}3260 3261; VSTRCZF.3262define <4 x i32> @test_vstrczf(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {3263; CHECK-LABEL: test_vstrczf:3264; CHECK: # %bb.0:3265; CHECK-NEXT: vstrczf %v24, %v24, %v26, %v28, 83266; CHECK-NEXT: br %r143267 %res = call <4 x i32> @llvm.s390.vstrczf(<4 x i32> %a, <4 x i32> %b,3268 <4 x i32> %c, i32 8)3269 ret <4 x i32> %res3270}3271 3272; VSTRCZBS.3273define <16 x i8> @test_vstrczbs(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c,3274; CHECK-LABEL: test_vstrczbs:3275; CHECK: # %bb.0:3276; CHECK-NEXT: vstrczbs %v24, %v24, %v26, %v28, 03277; CHECK-NEXT: ipm %r03278; CHECK-NEXT: srl %r0, 283279; CHECK-NEXT: st %r0, 0(%r2)3280; CHECK-NEXT: br %r143281 ptr %ccptr) {3282 %call = call {<16 x i8>, i32} @llvm.s390.vstrczbs(<16 x i8> %a, <16 x i8> %b,3283 <16 x i8> %c, i32 0)3284 %res = extractvalue {<16 x i8>, i32} %call, 03285 %cc = extractvalue {<16 x i8>, i32} %call, 13286 store i32 %cc, ptr %ccptr3287 ret <16 x i8> %res3288}3289 3290; VSTRCZHS.3291define <8 x i16> @test_vstrczhs(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c,3292; CHECK-LABEL: test_vstrczhs:3293; CHECK: # %bb.0:3294; CHECK-NEXT: vstrczhs %v24, %v24, %v26, %v28, 43295; CHECK-NEXT: ipm %r03296; CHECK-NEXT: srl %r0, 283297; CHECK-NEXT: st %r0, 0(%r2)3298; CHECK-NEXT: br %r143299 ptr %ccptr) {3300 %call = call {<8 x i16>, i32} @llvm.s390.vstrczhs(<8 x i16> %a, <8 x i16> %b,3301 <8 x i16> %c, i32 4)3302 %res = extractvalue {<8 x i16>, i32} %call, 03303 %cc = extractvalue {<8 x i16>, i32} %call, 13304 store i32 %cc, ptr %ccptr3305 ret <8 x i16> %res3306}3307 3308; VSTRCZFS.3309define <4 x i32> @test_vstrczfs(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c,3310; CHECK-LABEL: test_vstrczfs:3311; CHECK: # %bb.0:3312; CHECK-NEXT: vstrczfs %v24, %v24, %v26, %v28, 83313; CHECK-NEXT: ipm %r03314; CHECK-NEXT: srl %r0, 283315; CHECK-NEXT: st %r0, 0(%r2)3316; CHECK-NEXT: br %r143317 ptr %ccptr) {3318 %call = call {<4 x i32>, i32} @llvm.s390.vstrczfs(<4 x i32> %a, <4 x i32> %b,3319 <4 x i32> %c, i32 8)3320 %res = extractvalue {<4 x i32>, i32} %call, 03321 %cc = extractvalue {<4 x i32>, i32} %call, 13322 store i32 %cc, ptr %ccptr3323 ret <4 x i32> %res3324}3325 3326; VFCEDBS with no processing of the result.3327define i32 @test_vfcedbs(<2 x double> %a, <2 x double> %b) {3328; CHECK-LABEL: test_vfcedbs:3329; CHECK: # %bb.0:3330; CHECK-NEXT: vfcedbs %v0, %v24, %v263331; CHECK-NEXT: ipm %r23332; CHECK-NEXT: srl %r2, 283333; CHECK-NEXT: br %r143334 %call = call {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double> %a,3335 <2 x double> %b)3336 %res = extractvalue {<2 x i64>, i32} %call, 13337 ret i32 %res3338}3339 3340; VFCEDBS, returning 1 if any elements are equal (CC != 3).3341define i32 @test_vfcedbs_any_bool(<2 x double> %a, <2 x double> %b) {3342; CHECK-LABEL: test_vfcedbs_any_bool:3343; CHECK: # %bb.0:3344; CHECK-NEXT: vfcedbs %v0, %v24, %v263345; CHECK-NEXT: lhi %r2, 03346; CHECK-NEXT: lochile %r2, 13347; CHECK-NEXT: br %r143348 %call = call {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double> %a,3349 <2 x double> %b)3350 %res = extractvalue {<2 x i64>, i32} %call, 13351 %cmp = icmp ne i32 %res, 33352 %ext = zext i1 %cmp to i323353 ret i32 %ext3354}3355 3356; VFCEDBS, storing to %ptr if any elements are equal.3357define <2 x i64> @test_vfcedbs_any_store(<2 x double> %a, <2 x double> %b,3358; CHECK-LABEL: test_vfcedbs_any_store:3359; CHECK: # %bb.0:3360; CHECK-NEXT: vfcedbs %v24, %v24, %v263361; CHECK-NEXT: bor %r143362; CHECK-NEXT: .LBB249_1: # %store3363; CHECK-NEXT: mvhi 0(%r2), 03364; CHECK-NEXT: br %r143365 ptr %ptr) {3366 %call = call {<2 x i64>, i32} @llvm.s390.vfcedbs(<2 x double> %a,3367 <2 x double> %b)3368 %res = extractvalue {<2 x i64>, i32} %call, 03369 %cc = extractvalue {<2 x i64>, i32} %call, 13370 %cmp = icmp ule i32 %cc, 23371 br i1 %cmp, label %store, label %exit3372 3373store:3374 store i32 0, ptr %ptr3375 br label %exit3376 3377exit:3378 ret <2 x i64> %res3379}3380 3381; VFCHDBS with no processing of the result.3382define i32 @test_vfchdbs(<2 x double> %a, <2 x double> %b) {3383; CHECK-LABEL: test_vfchdbs:3384; CHECK: # %bb.0:3385; CHECK-NEXT: vfchdbs %v0, %v24, %v263386; CHECK-NEXT: ipm %r23387; CHECK-NEXT: srl %r2, 283388; CHECK-NEXT: br %r143389 %call = call {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double> %a,3390 <2 x double> %b)3391 %res = extractvalue {<2 x i64>, i32} %call, 13392 ret i32 %res3393}3394 3395; VFCHDBS, returning 1 if not all elements are higher.3396define i32 @test_vfchdbs_notall_bool(<2 x double> %a, <2 x double> %b) {3397; CHECK-LABEL: test_vfchdbs_notall_bool:3398; CHECK: # %bb.0:3399; CHECK-NEXT: vfchdbs %v0, %v24, %v263400; CHECK-NEXT: lhi %r2, 03401; CHECK-NEXT: lochinhe %r2, 13402; CHECK-NEXT: br %r143403 %call = call {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double> %a,3404 <2 x double> %b)3405 %res = extractvalue {<2 x i64>, i32} %call, 13406 %cmp = icmp sge i32 %res, 13407 %ext = zext i1 %cmp to i323408 ret i32 %ext3409}3410 3411; VFCHDBS, storing to %ptr if not all elements are higher.3412define <2 x i64> @test_vfchdbs_notall_store(<2 x double> %a, <2 x double> %b,3413; CHECK-LABEL: test_vfchdbs_notall_store:3414; CHECK: # %bb.0:3415; CHECK-NEXT: vfchdbs %v24, %v24, %v263416; CHECK-NEXT: ber %r143417; CHECK-NEXT: .LBB252_1: # %store3418; CHECK-NEXT: mvhi 0(%r2), 03419; CHECK-NEXT: br %r143420 ptr %ptr) {3421 %call = call {<2 x i64>, i32} @llvm.s390.vfchdbs(<2 x double> %a,3422 <2 x double> %b)3423 %res = extractvalue {<2 x i64>, i32} %call, 03424 %cc = extractvalue {<2 x i64>, i32} %call, 13425 %cmp = icmp ugt i32 %cc, 03426 br i1 %cmp, label %store, label %exit3427 3428store:3429 store i32 0, ptr %ptr3430 br label %exit3431 3432exit:3433 ret <2 x i64> %res3434}3435 3436; VFCHEDBS with no processing of the result.3437define i32 @test_vfchedbs(<2 x double> %a, <2 x double> %b) {3438; CHECK-LABEL: test_vfchedbs:3439; CHECK: # %bb.0:3440; CHECK-NEXT: vfchedbs %v0, %v24, %v263441; CHECK-NEXT: ipm %r23442; CHECK-NEXT: srl %r2, 283443; CHECK-NEXT: br %r143444 %call = call {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double> %a,3445 <2 x double> %b)3446 %res = extractvalue {<2 x i64>, i32} %call, 13447 ret i32 %res3448}3449 3450; VFCHEDBS, returning 1 if neither element is higher or equal.3451define i32 @test_vfchedbs_none_bool(<2 x double> %a, <2 x double> %b) {3452; CHECK-LABEL: test_vfchedbs_none_bool:3453; CHECK: # %bb.0:3454; CHECK-NEXT: vfchedbs %v0, %v24, %v263455; CHECK-NEXT: lhi %r2, 03456; CHECK-NEXT: lochio %r2, 13457; CHECK-NEXT: br %r143458 %call = call {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double> %a,3459 <2 x double> %b)3460 %res = extractvalue {<2 x i64>, i32} %call, 13461 %cmp = icmp eq i32 %res, 33462 %ext = zext i1 %cmp to i323463 ret i32 %ext3464}3465 3466; VFCHEDBS, storing to %ptr if neither element is higher or equal.3467define <2 x i64> @test_vfchedbs_none_store(<2 x double> %a, <2 x double> %b,3468; CHECK-LABEL: test_vfchedbs_none_store:3469; CHECK: # %bb.0:3470; CHECK-NEXT: vfchedbs %v24, %v24, %v263471; CHECK-NEXT: bler %r143472; CHECK-NEXT: .LBB255_1: # %store3473; CHECK-NEXT: mvhi 0(%r2), 03474; CHECK-NEXT: br %r143475 ptr %ptr) {3476 %call = call {<2 x i64>, i32} @llvm.s390.vfchedbs(<2 x double> %a,3477 <2 x double> %b)3478 %res = extractvalue {<2 x i64>, i32} %call, 03479 %cc = extractvalue {<2 x i64>, i32} %call, 13480 %cmp = icmp uge i32 %cc, 33481 br i1 %cmp, label %store, label %exit3482 3483store:3484 store i32 0, ptr %ptr3485 br label %exit3486 3487exit:3488 ret <2 x i64> %res3489}3490 3491; VFTCIDB with the lowest useful class selector and no processing of the result.3492define i32 @test_vftcidb(<2 x double> %a) {3493; CHECK-LABEL: test_vftcidb:3494; CHECK: # %bb.0:3495; CHECK-NEXT: vftcidb %v0, %v24, 13496; CHECK-NEXT: ipm %r23497; CHECK-NEXT: srl %r2, 283498; CHECK-NEXT: br %r143499 %call = call {<2 x i64>, i32} @llvm.s390.vftcidb(<2 x double> %a, i32 1)3500 %res = extractvalue {<2 x i64>, i32} %call, 13501 ret i32 %res3502}3503 3504; VFTCIDB with the highest useful class selector, returning 1 if all elements3505; have the right class (CC == 0).3506define i32 @test_vftcidb_all_bool(<2 x double> %a) {3507; CHECK-LABEL: test_vftcidb_all_bool:3508; CHECK: # %bb.0:3509; CHECK-NEXT: vftcidb %v0, %v24, 40943510; CHECK-NEXT: lhi %r2, 03511; CHECK-NEXT: lochie %r2, 13512; CHECK-NEXT: br %r143513 %call = call {<2 x i64>, i32} @llvm.s390.vftcidb(<2 x double> %a, i32 4094)3514 %res = extractvalue {<2 x i64>, i32} %call, 13515 %cmp = icmp eq i32 %res, 03516 %ext = zext i1 %cmp to i323517 ret i32 %ext3518}3519 3520; VFIDB with a rounding mode not usable via standard intrinsics.3521define <2 x double> @test_vfidb_0_4(<2 x double> %a) {3522; CHECK-LABEL: test_vfidb_0_4:3523; CHECK: # %bb.0:3524; CHECK-NEXT: vfidb %v24, %v24, 0, 43525; CHECK-NEXT: br %r143526 %res = call <2 x double> @llvm.s390.vfidb(<2 x double> %a, i32 0, i32 4)3527 ret <2 x double> %res3528}3529 3530; VFIDB with IEEE-inexact exception suppressed.3531define <2 x double> @test_vfidb_4_0(<2 x double> %a) {3532; CHECK-LABEL: test_vfidb_4_0:3533; CHECK: # %bb.0:3534; CHECK-NEXT: vfidb %v24, %v24, 4, 03535; CHECK-NEXT: br %r143536 %res = call <2 x double> @llvm.s390.vfidb(<2 x double> %a, i32 4, i32 0)3537 ret <2 x double> %res3538}3539 3540