1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -cost-model -cost-kind=throughput -analyze | FileCheck %s --check-prefix=THROUGHPUT
4 ; Verify the cost of (vector) multiply instructions.
6 define <2 x i8> @t1(<2 x i8> %a, <2 x i8> %b) {
7 ; THROUGHPUT-LABEL: 't1'
8 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i8> %a, %b
9 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %1
11 %1 = mul <2 x i8> %a, %b
15 define <4 x i8> @t2(<4 x i8> %a, <4 x i8> %b) {
16 ; THROUGHPUT-LABEL: 't2'
17 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i8> %a, %b
18 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %1
20 %1 = mul <4 x i8> %a, %b
24 define <8 x i8> @t3(<8 x i8> %a, <8 x i8> %b) {
25 ; THROUGHPUT-LABEL: 't3'
26 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i8> %a, %b
27 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %1
29 %1 = mul <8 x i8> %a, %b
33 define <16 x i8> @t4(<16 x i8> %a, <16 x i8> %b) {
34 ; THROUGHPUT-LABEL: 't4'
35 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <16 x i8> %a, %b
36 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %1
38 %1 = mul <16 x i8> %a, %b
42 define <32 x i8> @t5(<32 x i8> %a, <32 x i8> %b) {
43 ; THROUGHPUT-LABEL: 't5'
44 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <32 x i8> %a, %b
45 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %1
47 %1 = mul <32 x i8> %a, %b
51 define <2 x i16> @t6(<2 x i16> %a, <2 x i16> %b) {
52 ; THROUGHPUT-LABEL: 't6'
53 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i16> %a, %b
54 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %1
56 %1 = mul <2 x i16> %a, %b
60 define <4 x i16> @t7(<4 x i16> %a, <4 x i16> %b) {
61 ; THROUGHPUT-LABEL: 't7'
62 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i16> %a, %b
63 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %1
65 %1 = mul <4 x i16> %a, %b
69 define <8 x i16> @t8(<8 x i16> %a, <8 x i16> %b) {
70 ; THROUGHPUT-LABEL: 't8'
71 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i16> %a, %b
72 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %1
74 %1 = mul <8 x i16> %a, %b
78 define <16 x i16> @t9(<16 x i16> %a, <16 x i16> %b) {
79 ; THROUGHPUT-LABEL: 't9'
80 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <16 x i16> %a, %b
81 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %1
83 %1 = mul <16 x i16> %a, %b
87 define <2 x i32> @t10(<2 x i32> %a, <2 x i32> %b) {
88 ; THROUGHPUT-LABEL: 't10'
89 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i32> %a, %b
90 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %1
92 %1 = mul <2 x i32> %a, %b
96 define <4 x i32> @t11(<4 x i32> %a, <4 x i32> %b) {
97 ; THROUGHPUT-LABEL: 't11'
98 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i32> %a, %b
99 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %1
101 %1 = mul <4 x i32> %a, %b
105 define <8 x i32> @t12(<8 x i32> %a, <8 x i32> %b) {
106 ; THROUGHPUT-LABEL: 't12'
107 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <8 x i32> %a, %b
108 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %1
110 %1 = mul <8 x i32> %a, %b
114 define <2 x i64> @t13(<2 x i64> %a, <2 x i64> %b) {
115 ; THROUGHPUT-LABEL: 't13'
116 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %1 = mul nsw <2 x i64> %a, %b
117 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %1
119 %1 = mul nsw <2 x i64> %a, %b
123 define <4 x i64> @t14(<4 x i64> %a, <4 x i64> %b) {
124 ; THROUGHPUT-LABEL: 't14'
125 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %1 = mul nsw <4 x i64> %a, %b
126 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %1
128 %1 = mul nsw <4 x i64> %a, %b