285 lines · plain
1; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \2; RUN: -mcpu=pwr8 < %s | FileCheck %s3; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \4; RUN: -mcpu=pwr8 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LE5; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \6; RUN: -mcpu=pwr7 -mattr=+crypto < %s | FileCheck %s7; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \8; RUN: -mcpu=pwr9 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LE9; FIXME: llc -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s10; FIXME: The original intent was to add a check-next for the blr after every check.11; However, this currently fails since we don't eliminate stores of the unused12; locals. These stores are sometimes scheduled after the crypto instruction13 14; Function Attrs: nounwind15define <16 x i8> @test_vpmsumb() #0 {16entry:17 %a = alloca <16 x i8>, align 1618 %b = alloca <16 x i8>, align 1619 store <16 x i8> <i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16>, ptr %a, align 1620 store <16 x i8> <i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127, i8 112>, ptr %b, align 1621 %0 = load <16 x i8>, ptr %a, align 1622 %1 = load <16 x i8>, ptr %b, align 1623 %2 = call <16 x i8> @llvm.ppc.altivec.crypto.vpmsumb(<16 x i8> %0, <16 x i8> %1)24 ret <16 x i8> %225; CHECK: vpmsumb 2,26}27 28; Function Attrs: nounwind readnone29declare <16 x i8> @llvm.ppc.altivec.crypto.vpmsumb(<16 x i8>, <16 x i8>) #130 31; Function Attrs: nounwind32define <8 x i16> @test_vpmsumh() #0 {33entry:34 %a = alloca <8 x i16>, align 1635 %b = alloca <8 x i16>, align 1636 store <8 x i16> <i16 258, i16 772, i16 1286, i16 1800, i16 2314, i16 2828, i16 3342, i16 3856>, ptr %a, align 1637 store <8 x i16> <i16 29042, i16 29556, i16 30070, i16 30584, i16 31098, i16 31612, i16 32126, i16 32624>, ptr %b, align 1638 %0 = load <8 x i16>, ptr %a, align 1639 %1 = load <8 x i16>, ptr %b, align 1640 %2 = call <8 x i16> @llvm.ppc.altivec.crypto.vpmsumh(<8 x i16> %0, <8 x i16> %1)41 ret <8 x i16> %242; CHECK: vpmsumh 2,43}44 45; Function Attrs: nounwind readnone46declare <8 x i16> @llvm.ppc.altivec.crypto.vpmsumh(<8 x i16>, <8 x i16>) #147 48; Function Attrs: nounwind49define <4 x i32> @test_vpmsumw() #0 {50entry:51 %a = alloca <4 x i32>, align 1652 %b = alloca <4 x i32>, align 1653 store <4 x i32> <i32 16909060, i32 84281096, i32 151653132, i32 219025168>, ptr %a, align 1654 store <4 x i32> <i32 1903326068, i32 1970698104, i32 2038070140, i32 2105442160>, ptr %b, align 1655 %0 = load <4 x i32>, ptr %a, align 1656 %1 = load <4 x i32>, ptr %b, align 1657 %2 = call <4 x i32> @llvm.ppc.altivec.crypto.vpmsumw(<4 x i32> %0, <4 x i32> %1)58 ret <4 x i32> %259; CHECK: vpmsumw 2,60}61 62; Function Attrs: nounwind readnone63declare <4 x i32> @llvm.ppc.altivec.crypto.vpmsumw(<4 x i32>, <4 x i32>) #164 65; Function Attrs: nounwind66define <2 x i64> @test_vpmsumd() #0 {67entry:68 %a = alloca <2 x i64>, align 1669 %b = alloca <2 x i64>, align 1670 store <2 x i64> <i64 72623859790382856, i64 651345242494996240>, ptr %a, align 1671 store <2 x i64> <i64 8174723217654970232, i64 8753444600359583600>, ptr %b, align 1672 %0 = load <2 x i64>, ptr %a, align 1673 %1 = load <2 x i64>, ptr %b, align 1674 %2 = call <2 x i64> @llvm.ppc.altivec.crypto.vpmsumd(<2 x i64> %0, <2 x i64> %1)75 ret <2 x i64> %276; CHECK: vpmsumd 2,77}78 79; Function Attrs: nounwind readnone80declare <2 x i64> @llvm.ppc.altivec.crypto.vpmsumd(<2 x i64>, <2 x i64>) #181 82; Function Attrs: nounwind83define <2 x i64> @test_vsbox() #0 {84entry:85 %a = alloca <2 x i64>, align 1686 store <2 x i64> <i64 72623859790382856, i64 651345242494996240>, ptr %a, align 1687 %0 = load <2 x i64>, ptr %a, align 1688 %1 = call <2 x i64> @llvm.ppc.altivec.crypto.vsbox(<2 x i64> %0)89 ret <2 x i64> %190; CHECK: vsbox 2,91}92 93; Function Attrs: nounwind readnone94declare <2 x i64> @llvm.ppc.altivec.crypto.vsbox(<2 x i64>) #195 96; Function Attrs: nounwind97define <16 x i8> @test_vpermxorb() #0 {98entry:99 %a = alloca <16 x i8>, align 16100 %b = alloca <16 x i8>, align 16101 %c = alloca <16 x i8>, align 16102 store <16 x i8> <i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16>, ptr %a, align 16103 store <16 x i8> <i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127, i8 112>, ptr %b, align 16104 store <16 x i8> <i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127, i8 112>, ptr %c, align 16105 %0 = load <16 x i8>, ptr %a, align 16106 %1 = load <16 x i8>, ptr %b, align 16107 %2 = load <16 x i8>, ptr %c, align 16108 %3 = call <16 x i8> @llvm.ppc.altivec.crypto.vpermxor(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2)109 ret <16 x i8> %3110; CHECK-LE: xxlnor111; CHECK: vpermxor 2,112}113 114; Function Attrs: nounwind readnone115declare <16 x i8> @llvm.ppc.altivec.crypto.vpermxor(<16 x i8>, <16 x i8>, <16 x i8>) #1116 117; Function Attrs: nounwind118define <8 x i16> @test_vpermxorh() #0 {119entry:120 %a = alloca <8 x i16>, align 16121 %b = alloca <8 x i16>, align 16122 %c = alloca <8 x i16>, align 16123 store <8 x i16> <i16 258, i16 772, i16 1286, i16 1800, i16 2314, i16 2828, i16 3342, i16 3856>, ptr %a, align 16124 store <8 x i16> <i16 29042, i16 29556, i16 30070, i16 30584, i16 31098, i16 31612, i16 32126, i16 32624>, ptr %b, align 16125 store <8 x i16> <i16 29042, i16 29556, i16 30070, i16 30584, i16 31098, i16 31612, i16 32126, i16 32624>, ptr %c, align 16126 %0 = load <8 x i16>, ptr %a, align 16127 %1 = bitcast <8 x i16> %0 to <16 x i8>128 %2 = load <8 x i16>, ptr %b, align 16129 %3 = bitcast <8 x i16> %2 to <16 x i8>130 %4 = load <8 x i16>, ptr %c, align 16131 %5 = bitcast <8 x i16> %4 to <16 x i8>132 %6 = call <16 x i8> @llvm.ppc.altivec.crypto.vpermxor(<16 x i8> %1, <16 x i8> %3, <16 x i8> %5)133 %7 = bitcast <16 x i8> %6 to <8 x i16>134 ret <8 x i16> %7135; CHECK-LE: xxlnor136; CHECK: vpermxor 2,137}138 139; Function Attrs: nounwind140define <4 x i32> @test_vpermxorw() #0 {141entry:142 %a = alloca <4 x i32>, align 16143 %b = alloca <4 x i32>, align 16144 %c = alloca <4 x i32>, align 16145 store <4 x i32> <i32 16909060, i32 84281096, i32 151653132, i32 219025168>, ptr %a, align 16146 store <4 x i32> <i32 1903326068, i32 1970698104, i32 2038070140, i32 2105442160>, ptr %b, align 16147 store <4 x i32> <i32 1903326068, i32 1970698104, i32 2038070140, i32 2105442160>, ptr %c, align 16148 %0 = load <4 x i32>, ptr %a, align 16149 %1 = bitcast <4 x i32> %0 to <16 x i8>150 %2 = load <4 x i32>, ptr %b, align 16151 %3 = bitcast <4 x i32> %2 to <16 x i8>152 %4 = load <4 x i32>, ptr %c, align 16153 %5 = bitcast <4 x i32> %4 to <16 x i8>154 %6 = call <16 x i8> @llvm.ppc.altivec.crypto.vpermxor(<16 x i8> %1, <16 x i8> %3, <16 x i8> %5)155 %7 = bitcast <16 x i8> %6 to <4 x i32>156 ret <4 x i32> %7157; CHECK-LE: xxlnor158; CHECK: vpermxor 2,159}160 161; Function Attrs: nounwind162define <2 x i64> @test_vpermxord() #0 {163entry:164 %a = alloca <2 x i64>, align 16165 %b = alloca <2 x i64>, align 16166 %c = alloca <2 x i64>, align 16167 store <2 x i64> <i64 72623859790382856, i64 651345242494996240>, ptr %a, align 16168 store <2 x i64> <i64 8174723217654970232, i64 8753444600359583600>, ptr %b, align 16169 store <2 x i64> <i64 8174723217654970232, i64 8753444600359583600>, ptr %c, align 16170 %0 = load <2 x i64>, ptr %a, align 16171 %1 = bitcast <2 x i64> %0 to <16 x i8>172 %2 = load <2 x i64>, ptr %b, align 16173 %3 = bitcast <2 x i64> %2 to <16 x i8>174 %4 = load <2 x i64>, ptr %c, align 16175 %5 = bitcast <2 x i64> %4 to <16 x i8>176 %6 = call <16 x i8> @llvm.ppc.altivec.crypto.vpermxor(<16 x i8> %1, <16 x i8> %3, <16 x i8> %5)177 %7 = bitcast <16 x i8> %6 to <2 x i64>178 ret <2 x i64> %7179; CHECK-LE: xxlnor180; CHECK: vpermxor 2,181}182 183; Function Attrs: nounwind184define <2 x i64> @test_vcipher() #0 {185entry:186 %a = alloca <2 x i64>, align 16187 %b = alloca <2 x i64>, align 16188 store <2 x i64> <i64 72623859790382856, i64 651345242494996240>, ptr %a, align 16189 store <2 x i64> <i64 8174723217654970232, i64 8753444600359583600>, ptr %b, align 16190 %0 = load <2 x i64>, ptr %a, align 16191 %1 = load <2 x i64>, ptr %b, align 16192 %2 = call <2 x i64> @llvm.ppc.altivec.crypto.vcipher(<2 x i64> %0, <2 x i64> %1)193 ret <2 x i64> %2194; CHECK: vcipher 2,195}196 197; Function Attrs: nounwind readnone198declare <2 x i64> @llvm.ppc.altivec.crypto.vcipher(<2 x i64>, <2 x i64>) #1199 200; Function Attrs: nounwind201define <2 x i64> @test_vcipherlast() #0 {202entry:203 %a = alloca <2 x i64>, align 16204 %b = alloca <2 x i64>, align 16205 store <2 x i64> <i64 72623859790382856, i64 651345242494996240>, ptr %a, align 16206 store <2 x i64> <i64 8174723217654970232, i64 8753444600359583600>, ptr %b, align 16207 %0 = load <2 x i64>, ptr %a, align 16208 %1 = load <2 x i64>, ptr %b, align 16209 %2 = call <2 x i64> @llvm.ppc.altivec.crypto.vcipherlast(<2 x i64> %0, <2 x i64> %1)210 ret <2 x i64> %2211; CHECK: vcipherlast 2,212}213 214; Function Attrs: nounwind readnone215declare <2 x i64> @llvm.ppc.altivec.crypto.vcipherlast(<2 x i64>, <2 x i64>) #1216 217; Function Attrs: nounwind218define <2 x i64> @test_vncipher() #0 {219entry:220 %a = alloca <2 x i64>, align 16221 %b = alloca <2 x i64>, align 16222 store <2 x i64> <i64 72623859790382856, i64 651345242494996240>, ptr %a, align 16223 store <2 x i64> <i64 8174723217654970232, i64 8753444600359583600>, ptr %b, align 16224 %0 = load <2 x i64>, ptr %a, align 16225 %1 = load <2 x i64>, ptr %b, align 16226 %2 = call <2 x i64> @llvm.ppc.altivec.crypto.vncipher(<2 x i64> %0, <2 x i64> %1)227 ret <2 x i64> %2228; CHECK: vncipher 2,229}230 231; Function Attrs: nounwind readnone232declare <2 x i64> @llvm.ppc.altivec.crypto.vncipher(<2 x i64>, <2 x i64>) #1233 234; Function Attrs: nounwind235define <2 x i64> @test_vncipherlast() #0 {236entry:237 %a = alloca <2 x i64>, align 16238 %b = alloca <2 x i64>, align 16239 store <2 x i64> <i64 72623859790382856, i64 651345242494996240>, ptr %a, align 16240 store <2 x i64> <i64 8174723217654970232, i64 8753444600359583600>, ptr %b, align 16241 %0 = load <2 x i64>, ptr %a, align 16242 %1 = load <2 x i64>, ptr %b, align 16243 %2 = call <2 x i64> @llvm.ppc.altivec.crypto.vncipherlast(<2 x i64> %0, <2 x i64> %1)244 ret <2 x i64> %2245; CHECK: vncipherlast 2,246}247 248; Function Attrs: nounwind readnone249declare <2 x i64> @llvm.ppc.altivec.crypto.vncipherlast(<2 x i64>, <2 x i64>) #1250 251; Function Attrs: nounwind252define <4 x i32> @test_vshasigmaw() #0 {253entry:254 %a = alloca <4 x i32>, align 16255 store <4 x i32> <i32 16909060, i32 84281096, i32 151653132, i32 219025168>, ptr %a, align 16256 %0 = load <4 x i32>, ptr %a, align 16257 %1 = call <4 x i32> @llvm.ppc.altivec.crypto.vshasigmaw(<4 x i32> %0, i32 1, i32 15)258 ret <4 x i32> %1259; CHECK: vshasigmaw 2,260}261 262; Function Attrs: nounwind readnone263declare <4 x i32> @llvm.ppc.altivec.crypto.vshasigmaw(<4 x i32>, i32, i32) #1264 265; Function Attrs: nounwind266define <2 x i64> @test_vshasigmad() #0 {267entry:268 %a = alloca <2 x i64>, align 16269 store <2 x i64> <i64 8174723217654970232, i64 8753444600359583600>, ptr %a, align 16270 %0 = load <2 x i64>, ptr %a, align 16271 %1 = call <2 x i64> @llvm.ppc.altivec.crypto.vshasigmad(<2 x i64> %0, i32 1, i32 15)272 ret <2 x i64> %1273; CHECK: vshasigmad 2,274}275 276; Function Attrs: nounwind readnone277declare <2 x i64> @llvm.ppc.altivec.crypto.vshasigmad(<2 x i64>, i32, i32) #1278 279attributes #0 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "use-soft-float"="false" }280attributes #1 = { nounwind readnone }281 282!llvm.ident = !{!0}283 284!0 = !{!"clang version 3.7.0 (trunk 230949) (llvm/trunk 230946)"}285