blob: 50f6f9a86ed73e51bf25b2beb0bf5d84b6de01d4 [file] [log] [blame]
Kit Barton0cfa7b72015-03-03 19:55:45 +00001; Test the vector rotate and shift doubleword instructions that were added in P8
Ehsan Amiria538b0f2016-08-03 18:17:35 +00002; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
3; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s
Kit Barton0cfa7b72015-03-03 19:55:45 +00004
5declare <2 x i64> @llvm.ppc.altivec.vrld(<2 x i64>, <2 x i64>) nounwind readnone
6declare <2 x i64> @llvm.ppc.altivec.vsld(<2 x i64>, <2 x i64>) nounwind readnone
7declare <2 x i64> @llvm.ppc.altivec.vsrd(<2 x i64>, <2 x i64>) nounwind readnone
8declare <2 x i64> @llvm.ppc.altivec.vsrad(<2 x i64>, <2 x i64>) nounwind readnone
9
10define <2 x i64> @test_vrld(<2 x i64> %x, <2 x i64> %y) nounwind readnone {
11 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vrld(<2 x i64> %x, <2 x i64> %y)
12 ret <2 x i64> %tmp
13; CHECK: vrld 2, 2, 3
14}
15
16define <2 x i64> @test_vsld(<2 x i64> %x, <2 x i64> %y) nounwind readnone {
Kit Bartone48b1e12015-03-05 16:24:38 +000017 %tmp = shl <2 x i64> %x, %y
Kit Barton0cfa7b72015-03-03 19:55:45 +000018 ret <2 x i64> %tmp
Kit Bartone48b1e12015-03-05 16:24:38 +000019; CHECK-LABEL: @test_vsld
Kit Barton0cfa7b72015-03-03 19:55:45 +000020; CHECK: vsld 2, 2, 3
21}
22
23define <2 x i64> @test_vsrd(<2 x i64> %x, <2 x i64> %y) nounwind readnone {
Kit Bartone48b1e12015-03-05 16:24:38 +000024 %tmp = lshr <2 x i64> %x, %y
25 ret <2 x i64> %tmp
26; CHECK-LABEL: @test_vsrd
Kit Barton0cfa7b72015-03-03 19:55:45 +000027; CHECK: vsrd 2, 2, 3
28}
29
30define <2 x i64> @test_vsrad(<2 x i64> %x, <2 x i64> %y) nounwind readnone {
Kit Bartone48b1e12015-03-05 16:24:38 +000031 %tmp = ashr <2 x i64> %x, %y
32 ret <2 x i64> %tmp
33; CHECK-LABER: @test_vsrad
Kit Barton0cfa7b72015-03-03 19:55:45 +000034; CHECK: vsrad 2, 2, 3
35}
36