1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefix=THROUGHPUT
4 ; Verify the cost of (vector) multiply instructions.
6 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
8 define <2 x i8> @t1(<2 x i8> %a, <2 x i8> %b) {
9 ; THROUGHPUT-LABEL: 't1'
10 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i8> %a, %b
11 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %1
13 %1 = mul <2 x i8> %a, %b
17 define <4 x i8> @t2(<4 x i8> %a, <4 x i8> %b) {
18 ; THROUGHPUT-LABEL: 't2'
19 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i8> %a, %b
20 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %1
22 %1 = mul <4 x i8> %a, %b
26 define <8 x i8> @t3(<8 x i8> %a, <8 x i8> %b) {
27 ; THROUGHPUT-LABEL: 't3'
28 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i8> %a, %b
29 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %1
31 %1 = mul <8 x i8> %a, %b
35 define <16 x i8> @t4(<16 x i8> %a, <16 x i8> %b) {
36 ; THROUGHPUT-LABEL: 't4'
37 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <16 x i8> %a, %b
38 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %1
40 %1 = mul <16 x i8> %a, %b
44 define <32 x i8> @t5(<32 x i8> %a, <32 x i8> %b) {
45 ; THROUGHPUT-LABEL: 't5'
46 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <32 x i8> %a, %b
47 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %1
49 %1 = mul <32 x i8> %a, %b
53 define <2 x i16> @t6(<2 x i16> %a, <2 x i16> %b) {
54 ; THROUGHPUT-LABEL: 't6'
55 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i16> %a, %b
56 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %1
58 %1 = mul <2 x i16> %a, %b
62 define <4 x i16> @t7(<4 x i16> %a, <4 x i16> %b) {
63 ; THROUGHPUT-LABEL: 't7'
64 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i16> %a, %b
65 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %1
67 %1 = mul <4 x i16> %a, %b
71 define <8 x i16> @t8(<8 x i16> %a, <8 x i16> %b) {
72 ; THROUGHPUT-LABEL: 't8'
73 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i16> %a, %b
74 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %1
76 %1 = mul <8 x i16> %a, %b
80 define <16 x i16> @t9(<16 x i16> %a, <16 x i16> %b) {
81 ; THROUGHPUT-LABEL: 't9'
82 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <16 x i16> %a, %b
83 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %1
85 %1 = mul <16 x i16> %a, %b
89 define <2 x i32> @t10(<2 x i32> %a, <2 x i32> %b) {
90 ; THROUGHPUT-LABEL: 't10'
91 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i32> %a, %b
92 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %1
94 %1 = mul <2 x i32> %a, %b
98 define <4 x i32> @t11(<4 x i32> %a, <4 x i32> %b) {
99 ; THROUGHPUT-LABEL: 't11'
100 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i32> %a, %b
101 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %1
103 %1 = mul <4 x i32> %a, %b
107 define <8 x i32> @t12(<8 x i32> %a, <8 x i32> %b) {
108 ; THROUGHPUT-LABEL: 't12'
109 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <8 x i32> %a, %b
110 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %1
112 %1 = mul <8 x i32> %a, %b
116 define <2 x i64> @t13(<2 x i64> %a, <2 x i64> %b) {
117 ; THROUGHPUT-LABEL: 't13'
118 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %1 = mul nsw <2 x i64> %a, %b
119 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %1
121 %1 = mul nsw <2 x i64> %a, %b
125 define <4 x i64> @t14(<4 x i64> %a, <4 x i64> %b) {
126 ; THROUGHPUT-LABEL: 't14'
127 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %1 = mul nsw <4 x i64> %a, %b
128 ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %1
130 %1 = mul nsw <4 x i64> %a, %b