xref: /llvm-project/llvm/test/Analysis/CostModel/AArch64/mul.ll (revision 75f1b328f8fb2468e8bef618b022ad8ce928097d)
1a3b1fcbcSSjoerd Meijer; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
24178e334SSimon Pilgrim; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefix=THROUGHPUT
3a3b1fcbcSSjoerd Meijer
4a3b1fcbcSSjoerd Meijer; Verify the cost of (vector) multiply instructions.
5a3b1fcbcSSjoerd Meijer
6*75f1b328SMingming Liutarget datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
7*75f1b328SMingming Liu
8a3b1fcbcSSjoerd Meijerdefine <2 x i8> @t1(<2 x i8> %a, <2 x i8> %b)  {
9a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't1'
10a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i8> %a, %b
11a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %1
12a3b1fcbcSSjoerd Meijer;
13a3b1fcbcSSjoerd Meijer  %1 = mul <2 x i8> %a, %b
14a3b1fcbcSSjoerd Meijer  ret <2 x i8> %1
15a3b1fcbcSSjoerd Meijer}
16a3b1fcbcSSjoerd Meijer
17a3b1fcbcSSjoerd Meijerdefine <4 x i8> @t2(<4 x i8> %a, <4 x i8> %b)  {
18a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't2'
19a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i8> %a, %b
20a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %1
21a3b1fcbcSSjoerd Meijer;
22a3b1fcbcSSjoerd Meijer  %1 = mul <4 x i8> %a, %b
23a3b1fcbcSSjoerd Meijer  ret <4 x i8> %1
24a3b1fcbcSSjoerd Meijer}
25a3b1fcbcSSjoerd Meijer
26a3b1fcbcSSjoerd Meijerdefine <8 x i8> @t3(<8 x i8> %a, <8 x i8> %b)  {
27a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't3'
28a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i8> %a, %b
29a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %1
30a3b1fcbcSSjoerd Meijer;
31a3b1fcbcSSjoerd Meijer  %1 = mul <8 x i8> %a, %b
32a3b1fcbcSSjoerd Meijer  ret <8 x i8> %1
33a3b1fcbcSSjoerd Meijer}
34a3b1fcbcSSjoerd Meijer
35a3b1fcbcSSjoerd Meijerdefine <16 x i8> @t4(<16 x i8> %a, <16 x i8> %b)  {
36a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't4'
37a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <16 x i8> %a, %b
38a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %1
39a3b1fcbcSSjoerd Meijer;
40a3b1fcbcSSjoerd Meijer  %1 = mul <16 x i8> %a, %b
41a3b1fcbcSSjoerd Meijer  ret <16 x i8> %1
42a3b1fcbcSSjoerd Meijer}
43a3b1fcbcSSjoerd Meijer
44a3b1fcbcSSjoerd Meijerdefine <32 x i8> @t5(<32 x i8> %a, <32 x i8> %b)  {
45a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't5'
46a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <32 x i8> %a, %b
47a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %1
48a3b1fcbcSSjoerd Meijer;
49a3b1fcbcSSjoerd Meijer  %1 = mul <32 x i8> %a, %b
50a3b1fcbcSSjoerd Meijer  ret <32 x i8> %1
51a3b1fcbcSSjoerd Meijer}
52a3b1fcbcSSjoerd Meijer
53a3b1fcbcSSjoerd Meijerdefine <2 x i16> @t6(<2 x i16> %a, <2 x i16> %b)  {
54a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't6'
55a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i16> %a, %b
56a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %1
57a3b1fcbcSSjoerd Meijer;
58a3b1fcbcSSjoerd Meijer  %1 = mul <2 x i16> %a, %b
59a3b1fcbcSSjoerd Meijer  ret <2 x i16> %1
60a3b1fcbcSSjoerd Meijer}
61a3b1fcbcSSjoerd Meijer
62a3b1fcbcSSjoerd Meijerdefine <4 x i16> @t7(<4 x i16> %a, <4 x i16> %b)  {
63a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't7'
64a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i16> %a, %b
65a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %1
66a3b1fcbcSSjoerd Meijer;
67a3b1fcbcSSjoerd Meijer  %1 = mul <4 x i16> %a, %b
68a3b1fcbcSSjoerd Meijer  ret <4 x i16> %1
69a3b1fcbcSSjoerd Meijer}
70a3b1fcbcSSjoerd Meijer
71a3b1fcbcSSjoerd Meijerdefine <8 x i16> @t8(<8 x i16> %a, <8 x i16> %b)  {
72a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't8'
73a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i16> %a, %b
74a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %1
75a3b1fcbcSSjoerd Meijer;
76a3b1fcbcSSjoerd Meijer  %1 = mul <8 x i16> %a, %b
77a3b1fcbcSSjoerd Meijer  ret <8 x i16> %1
78a3b1fcbcSSjoerd Meijer}
79a3b1fcbcSSjoerd Meijer
80a3b1fcbcSSjoerd Meijerdefine <16 x i16> @t9(<16 x i16> %a, <16 x i16> %b)  {
81a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't9'
82a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <16 x i16> %a, %b
83a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %1
84a3b1fcbcSSjoerd Meijer;
85a3b1fcbcSSjoerd Meijer  %1 = mul <16 x i16> %a, %b
86a3b1fcbcSSjoerd Meijer  ret <16 x i16> %1
87a3b1fcbcSSjoerd Meijer}
88a3b1fcbcSSjoerd Meijer
89a3b1fcbcSSjoerd Meijerdefine <2 x i32> @t10(<2 x i32> %a, <2 x i32> %b)  {
90a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't10'
91a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i32> %a, %b
92a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %1
93a3b1fcbcSSjoerd Meijer;
94a3b1fcbcSSjoerd Meijer  %1 = mul <2 x i32> %a, %b
95a3b1fcbcSSjoerd Meijer  ret <2 x i32> %1
96a3b1fcbcSSjoerd Meijer}
97a3b1fcbcSSjoerd Meijer
98a3b1fcbcSSjoerd Meijerdefine <4 x i32> @t11(<4 x i32> %a, <4 x i32> %b)  {
99a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't11'
100a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i32> %a, %b
101a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %1
102a3b1fcbcSSjoerd Meijer;
103a3b1fcbcSSjoerd Meijer  %1 = mul <4 x i32> %a, %b
104a3b1fcbcSSjoerd Meijer  ret <4 x i32> %1
105a3b1fcbcSSjoerd Meijer}
106a3b1fcbcSSjoerd Meijer
107a3b1fcbcSSjoerd Meijerdefine <8 x i32> @t12(<8 x i32> %a, <8 x i32> %b)  {
108a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't12'
109a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <8 x i32> %a, %b
110a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %1
111a3b1fcbcSSjoerd Meijer;
112a3b1fcbcSSjoerd Meijer  %1 = mul <8 x i32> %a, %b
113a3b1fcbcSSjoerd Meijer  ret <8 x i32> %1
114a3b1fcbcSSjoerd Meijer}
115a3b1fcbcSSjoerd Meijer
116a3b1fcbcSSjoerd Meijerdefine <2 x i64> @t13(<2 x i64> %a, <2 x i64> %b)  {
117a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't13'
118750bf358SDavid Green; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %1 = mul nsw <2 x i64> %a, %b
119a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %1
120a3b1fcbcSSjoerd Meijer;
121a3b1fcbcSSjoerd Meijer  %1 = mul nsw <2 x i64> %a, %b
122a3b1fcbcSSjoerd Meijer  ret <2 x i64> %1
123a3b1fcbcSSjoerd Meijer}
124a3b1fcbcSSjoerd Meijer
125a3b1fcbcSSjoerd Meijerdefine <4 x i64> @t14(<4 x i64> %a, <4 x i64> %b)  {
126a3b1fcbcSSjoerd Meijer; THROUGHPUT-LABEL: 't14'
127750bf358SDavid Green; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %1 = mul nsw <4 x i64> %a, %b
128a3b1fcbcSSjoerd Meijer; THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %1
129a3b1fcbcSSjoerd Meijer;
130a3b1fcbcSSjoerd Meijer  %1 = mul nsw <4 x i64> %a, %b
131a3b1fcbcSSjoerd Meijer  ret <4 x i64> %1
132a3b1fcbcSSjoerd Meijer}
133