File tree Expand file tree Collapse file tree 4 files changed +96
-0
lines changed
test/CodeGen/VE/VELIntrinsics Expand file tree Collapse file tree 4 files changed +96
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,24 @@ let TargetPrefix = "ve" in {
11
11
def int_ve_vl_pack_f32a : GCCBuiltin<"__builtin_ve_vl_pack_f32a">,
12
12
Intrinsic<[llvm_i64_ty], [llvm_ptr_ty],
13
13
[IntrReadMem]>;
14
+
15
+ def int_ve_vl_extract_vm512u :
16
+ GCCBuiltin<"__builtin_ve_vl_extract_vm512u">,
17
+ Intrinsic<[LLVMType<v256i1>], [LLVMType<v512i1>], [IntrNoMem]>;
18
+
19
+ def int_ve_vl_extract_vm512l :
20
+ GCCBuiltin<"__builtin_ve_vl_extract_vm512l">,
21
+ Intrinsic<[LLVMType<v256i1>], [LLVMType<v512i1>], [IntrNoMem]>;
22
+
23
+ def int_ve_vl_insert_vm512u :
24
+ GCCBuiltin<"__builtin_ve_vl_insert_vm512u">,
25
+ Intrinsic<[LLVMType<v512i1>], [LLVMType<v512i1>, LLVMType<v256i1>],
26
+ [IntrNoMem]>;
27
+
28
+ def int_ve_vl_insert_vm512l :
29
+ GCCBuiltin<"__builtin_ve_vl_insert_vm512l">,
30
+ Intrinsic<[LLVMType<v512i1>], [LLVMType<v512i1>, LLVMType<v256i1>],
31
+ [IntrNoMem]>;
14
32
}
15
33
16
34
// Define intrinsics automatically generated
Original file line number Diff line number Diff line change @@ -17,6 +17,19 @@ def : Pat<(i64 (int_ve_vl_pack_f32a ADDRrii:$addr)),
17
17
!add(32, 64)), 0,
18
18
(HI32 (i64 0x0000000100000001))))>;
19
19
20
+ // The extract/insert patterns.
21
+ def : Pat<(v256i1 (int_ve_vl_extract_vm512u v512i1:$vm)),
22
+ (EXTRACT_SUBREG v512i1:$vm, sub_vm_even)>;
23
+
24
+ def : Pat<(v256i1 (int_ve_vl_extract_vm512l v512i1:$vm)),
25
+ (EXTRACT_SUBREG v512i1:$vm, sub_vm_odd)>;
26
+
27
+ def : Pat<(v512i1 (int_ve_vl_insert_vm512u v512i1:$vmx, v256i1:$vmy)),
28
+ (INSERT_SUBREG v512i1:$vmx, v256i1:$vmy, sub_vm_even)>;
29
+
30
+ def : Pat<(v512i1 (int_ve_vl_insert_vm512l v512i1:$vmx, v256i1:$vmy)),
31
+ (INSERT_SUBREG v512i1:$vmx, v256i1:$vmy, sub_vm_odd)>;
32
+
20
33
// LSV patterns.
21
34
def : Pat<(int_ve_vl_lsv_vvss v256f64:$pt, i32:$sy, i64:$sz),
22
35
(LSVrr_v (i2l i32:$sy), i64:$sz, v256f64:$pt)>;
Original file line number Diff line number Diff line change
1
+ ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
2
+
3
+ ;;; Test extract intrinsic instructions
4
+ ;;;
5
+ ;;; Note:
6
+ ;;; We test extract_vm512u and extract_vm512l pseudo instructions.
7
+
8
+ ; Function Attrs: nounwind readnone
9
+ define fastcc <256 x i1 > @extract_vm512u (<512 x i1 > %0 ) {
10
+ ; CHECK-LABEL: extract_vm512u:
11
+ ; CHECK: # %bb.0:
12
+ ; CHECK-NEXT: andm %vm1, %vm0, %vm2
13
+ ; CHECK-NEXT: b.l.t (, %s10)
14
+ %2 = tail call <256 x i1 > @llvm.ve.vl.extract.vm512u (<512 x i1 > %0 )
15
+ ret <256 x i1 > %2
16
+ }
17
+
18
+ ; Function Attrs: nounwind readnone
19
+ declare <256 x i1 > @llvm.ve.vl.extract.vm512u (<512 x i1 >)
20
+
21
+ ; Function Attrs: nounwind readnone
22
+ define fastcc <256 x i1 > @extract_vm512l (<512 x i1 > %0 ) {
23
+ ; CHECK-LABEL: extract_vm512l:
24
+ ; CHECK: # %bb.0:
25
+ ; CHECK-NEXT: andm %vm0, %vm0, %vm2
26
+ ; CHECK-NEXT: andm %vm1, %vm0, %vm3
27
+ ; CHECK-NEXT: b.l.t (, %s10)
28
+ %2 = tail call <256 x i1 > @llvm.ve.vl.extract.vm512l (<512 x i1 > %0 )
29
+ ret <256 x i1 > %2
30
+ }
31
+
32
+ ; Function Attrs: nounwind readnone
33
+ declare <256 x i1 > @llvm.ve.vl.extract.vm512l (<512 x i1 >)
Original file line number Diff line number Diff line change
1
+ ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
2
+
3
+ ;;; Test insert intrinsic instructions
4
+ ;;;
5
+ ;;; Note:
6
+ ;;; We test insert_vm512u and insert_vm512l pseudo instructions.
7
+
8
+ ; Function Attrs: nounwind readnone
9
+ define fastcc <512 x i1 > @insert_vm512u (<512 x i1 > %0 , <256 x i1 > %1 ) {
10
+ ; CHECK-LABEL: insert_vm512u:
11
+ ; CHECK: # %bb.0:
12
+ ; CHECK-NEXT: andm %vm2, %vm0, %vm4
13
+ ; CHECK-NEXT: b.l.t (, %s10)
14
+ %3 = tail call <512 x i1 > @llvm.ve.vl.insert.vm512u (<512 x i1 > %0 , <256 x i1 > %1 )
15
+ ret <512 x i1 > %3
16
+ }
17
+
18
+ ; Function Attrs: nounwind readnone
19
+ declare <512 x i1 > @llvm.ve.vl.insert.vm512u (<512 x i1 >, <256 x i1 >)
20
+
21
+ ; Function Attrs: nounwind readnone
22
+ define fastcc <512 x i1 > @insert_vm512l (<512 x i1 > %0 , <256 x i1 > %1 ) {
23
+ ; CHECK-LABEL: insert_vm512l:
24
+ ; CHECK: # %bb.0:
25
+ ; CHECK-NEXT: andm %vm3, %vm0, %vm4
26
+ ; CHECK-NEXT: b.l.t (, %s10)
27
+ %3 = tail call <512 x i1 > @llvm.ve.vl.insert.vm512l (<512 x i1 > %0 , <256 x i1 > %1 )
28
+ ret <512 x i1 > %3
29
+ }
30
+
31
+ ; Function Attrs: nounwind readnone
32
+ declare <512 x i1 > @llvm.ve.vl.insert.vm512l (<512 x i1 >, <256 x i1 >)
You can’t perform that action at this time.
0 commit comments