1 ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
3 ;;; Test prefetch vector intrinsic instructions
6 ;;; We test LSVrr_v and LVSvr instructions.
8 ; Function Attrs: nounwind
9 define void @lsv_vvss(ptr %0, i64 %1, i32 signext %2) {
10 ; CHECK-LABEL: lsv_vvss:
12 ; CHECK-NEXT: lea %s3, 256
14 ; CHECK-NEXT: vld %v0, 8, %s0
15 ; CHECK-NEXT: and %s2, %s2, (32)0
16 ; CHECK-NEXT: lsv %v0(%s2), %s1
17 ; CHECK-NEXT: vst %v0, 8, %s0
18 ; CHECK-NEXT: b.l.t (, %s10)
19 %4 = tail call fast <256 x double> @llvm.ve.vl.vld.vssl(i64 8, ptr %0, i32 256)
20 %5 = tail call fast <256 x double> @llvm.ve.vl.lsv.vvss(<256 x double> %4, i32 %2, i64 %1)
21 tail call void @llvm.ve.vl.vst.vssl(<256 x double> %5, i64 8, ptr %0, i32 256)
25 ; Function Attrs: nounwind readonly
26 declare <256 x double> @llvm.ve.vl.vld.vssl(i64, ptr, i32)
28 ; Function Attrs: nounwind readnone
29 declare <256 x double> @llvm.ve.vl.lsv.vvss(<256 x double>, i32, i64)
31 ; Function Attrs: nounwind writeonly
32 declare void @llvm.ve.vl.vst.vssl(<256 x double>, i64, ptr, i32)
34 ; Function Attrs: nounwind readonly
35 define i64 @lvsl_vssl_imm(ptr readonly %0, i32 signext %1) {
36 ; CHECK-LABEL: lvsl_vssl_imm:
38 ; CHECK-NEXT: lea %s2, 256
40 ; CHECK-NEXT: vld %v0, 8, %s0
41 ; CHECK-NEXT: and %s0, %s1, (32)0
42 ; CHECK-NEXT: lvs %s0, %v0(%s0)
43 ; CHECK-NEXT: b.l.t (, %s10)
44 %3 = tail call fast <256 x double> @llvm.ve.vl.vld.vssl(i64 8, ptr %0, i32 256)
45 %4 = tail call i64 @llvm.ve.vl.lvsl.svs(<256 x double> %3, i32 %1)
49 ; Function Attrs: nounwind readnone
50 declare i64 @llvm.ve.vl.lvsl.svs(<256 x double>, i32)
52 ; Function Attrs: nounwind readonly
53 define double @lvsd_vssl_imm(ptr readonly %0, i32 signext %1) {
54 ; CHECK-LABEL: lvsd_vssl_imm:
56 ; CHECK-NEXT: lea %s2, 256
58 ; CHECK-NEXT: vld %v0, 8, %s0
59 ; CHECK-NEXT: and %s0, %s1, (32)0
60 ; CHECK-NEXT: lvs %s0, %v0(%s0)
61 ; CHECK-NEXT: b.l.t (, %s10)
62 %3 = tail call fast <256 x double> @llvm.ve.vl.vld.vssl(i64 8, ptr %0, i32 256)
63 %4 = tail call fast double @llvm.ve.vl.lvsd.svs(<256 x double> %3, i32 %1)
67 ; Function Attrs: nounwind readnone
68 declare double @llvm.ve.vl.lvsd.svs(<256 x double>, i32)
70 ; Function Attrs: nounwind readonly
71 define float @lvss_vssl_imm(ptr readonly %0, i32 signext %1) {
72 ; CHECK-LABEL: lvss_vssl_imm:
74 ; CHECK-NEXT: lea %s2, 256
76 ; CHECK-NEXT: vld %v0, 8, %s0
77 ; CHECK-NEXT: and %s0, %s1, (32)0
78 ; CHECK-NEXT: lvs %s0, %v0(%s0)
79 ; CHECK-NEXT: b.l.t (, %s10)
80 %3 = tail call fast <256 x double> @llvm.ve.vl.vld.vssl(i64 8, ptr %0, i32 256)
81 %4 = tail call fast float @llvm.ve.vl.lvss.svs(<256 x double> %3, i32 %1)
85 ; Function Attrs: nounwind readnone
86 declare float @llvm.ve.vl.lvss.svs(<256 x double>, i32)