Skip to content

Commit 4336415

Browse files
Himadhithhimadhith
andauthored
[NFC][PowerPC] Patch to add the remaining types v2i64, v8i16 and v16i8 into exisiting testfile (#163201)
The previous [NFC patch](llvm/llvm-project#160476 (comment)) addressed only the vector type `v4i32`, this is a continuation for the previous patch which adds the remaining 3 vector types which were left out. This should include the following operands: - `v2i64`: `A + vector {1, 1,}` - `v8i16`: `A + vector {1, 1, 1, 1, 1, 1, 1, 1}` - `v16i8`: `A + vector {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}` --------- Co-authored-by: himadhith <[email protected]>
1 parent 4374ca3 commit 4336415

File tree

2 files changed

+60
-23
lines changed

2 files changed

+60
-23
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
2+
; RUN: llc -verify-machineinstrs -O3 -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu \
3+
; RUN: -ppc-asm-full-reg-names --ppc-vsr-nums-as-vr < %s | FileCheck %s
4+
5+
; RUN: llc -verify-machineinstrs -O3 -mcpu=pwr9 -mtriple=powerpc64-ibm-aix \
6+
; RUN: -ppc-asm-full-reg-names --ppc-vsr-nums-as-vr < %s | FileCheck %s
7+
8+
; RUN: llc -verify-machineinstrs -O3 -mcpu=pwr9 -mtriple=powerpc-ibm-aix \
9+
; RUN: -ppc-asm-full-reg-names --ppc-vsr-nums-as-vr < %s | FileCheck %s
10+
11+
; The addition of vector `A` with vector of 1s currently uses `vspltisw` to generate vector of 1s followed by add operation.
12+
13+
; Function for the vector type v2i64 `a + {1, 1}`
14+
define <2 x i64> @test_v2i64(<2 x i64> %a) {
15+
; CHECK-LABEL: test_v2i64:
16+
; CHECK: # %bb.0: # %entry
17+
; CHECK-NEXT: vspltisw v3, 1
18+
; CHECK-NEXT: vupklsw v3, v3
19+
; CHECK-NEXT: vaddudm v2, v2, v3
20+
; CHECK-NEXT: blr
21+
entry:
22+
%add = add <2 x i64> %a, splat (i64 1)
23+
ret <2 x i64> %add
24+
}
25+
26+
; Function for the vector type v4i32 `a + {1, 1, 1, 1}`
27+
define <4 x i32> @test_v4i32(<4 x i32> %a) {
28+
; CHECK-LABEL: test_v4i32:
29+
; CHECK: # %bb.0: # %entry
30+
; CHECK-NEXT: vspltisw v3, 1
31+
; CHECK-NEXT: vadduwm v2, v2, v3
32+
; CHECK-NEXT: blr
33+
entry:
34+
%add = add <4 x i32> %a, splat (i32 1)
35+
ret <4 x i32> %add
36+
}
37+
38+
; Function for the vector type v8i16 `a + {1, 1, 1, 1, 1, 1, 1, 1}`
39+
define <8 x i16> @test_v8i16(<8 x i16> %a) {
40+
; CHECK-LABEL: test_v8i16:
41+
; CHECK: # %bb.0: # %entry
42+
; CHECK-NEXT: vspltish v3, 1
43+
; CHECK-NEXT: vadduhm v2, v2, v3
44+
; CHECK-NEXT: blr
45+
entry:
46+
%add = add <8 x i16> %a, splat (i16 1)
47+
ret <8 x i16> %add
48+
}
49+
50+
; Function for the vector type v16i8 `a + {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}`
51+
define <16 x i8> @test_16i8(<16 x i8> %a) {
52+
; CHECK-LABEL: test_16i8:
53+
; CHECK: # %bb.0: # %entry
54+
; CHECK-NEXT: xxspltib v3, 1
55+
; CHECK-NEXT: vaddubm v2, v2, v3
56+
; CHECK-NEXT: blr
57+
entry:
58+
%add = add <16 x i8> %a, splat (i8 1)
59+
ret <16 x i8> %add
60+
}

llvm/test/CodeGen/PowerPC/vector-all-ones.ll

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)