blob: 59df16e079092803cba4484e6b362c739e1c6a98 [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+sse2 | FileCheck %s --check-prefixes=SSE2
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+ssse3 | FileCheck %s --check-prefixes=SSSE3
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+sse4.2 | FileCheck %s --check-prefixes=SSE42
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx | FileCheck %s --check-prefixes=AVX1
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx2 | FileCheck %s --check-prefixes=AVX2
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f | FileCheck %s --check-prefixes=AVX512
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=AVX512
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=AVX512
;
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=slm | FileCheck %s --check-prefixes=SLM
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=goldmont | FileCheck %s --check-prefixes=GLM
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=btver2 | FileCheck %s --check-prefixes=AVX1
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=knl | FileCheck %s --check-prefixes=AVX512
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.8.0"
;
; mul vXi8 -> mXi32
;
define void @mul_sext_vXi8(<4 x i8> %a4, <4 x i8> %b4, <8 x i8> %a8, <8 x i8> %b8, <16 x i8> %a16, <16 x i8> %b16, <32 x i8> %a32, <32 x i8> %b32, <64 x i8> %a64, <64 x i8> %b64) {
; SSE2-LABEL: 'mul_sext_vXi8'
; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb4 = sext <4 x i8> %b4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb8 = sext <8 x i8> %b8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xb16 = sext <16 x i8> %b16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %xb32 = sext <32 x i8> %b32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %xb64 = sext <64 x i8> %b64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSSE3-LABEL: 'mul_sext_vXi8'
; SSSE3-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb4 = sext <4 x i8> %b4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb8 = sext <8 x i8> %b8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xb16 = sext <16 x i8> %b16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %xb32 = sext <32 x i8> %b32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %xb64 = sext <64 x i8> %b64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSSE3-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSE42-LABEL: 'mul_sext_vXi8'
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i8> %b4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = sext <8 x i8> %b8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = sext <16 x i8> %b16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = sext <32 x i8> %b32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = sext <64 x i8> %b64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE42-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX1-LABEL: 'mul_sext_vXi8'
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i8> %b4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb8 = sext <8 x i8> %b8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb16 = sext <16 x i8> %b16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %xb32 = sext <32 x i8> %b32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %xb64 = sext <64 x i8> %b64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX1-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX2-LABEL: 'mul_sext_vXi8'
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i8> %b4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = sext <8 x i8> %b8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = sext <16 x i8> %b16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %xb32 = sext <32 x i8> %b32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %xb64 = sext <64 x i8> %b64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX512-LABEL: 'mul_sext_vXi8'
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i8> %b4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb8 = sext <8 x i8> %b8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb16 = sext <16 x i8> %b16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb32 = sext <32 x i8> %b32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xb64 = sext <64 x i8> %b64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SLM-LABEL: 'mul_sext_vXi8'
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i8> %b4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = sext <8 x i8> %b8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = sext <16 x i8> %b16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = sext <32 x i8> %b32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = sext <64 x i8> %b64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SLM-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SLM-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SLM-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SLM-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; GLM-LABEL: 'mul_sext_vXi8'
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i8> %b4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = sext <8 x i8> %b8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = sext <16 x i8> %b16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = sext <32 x i8> %b32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = sext <64 x i8> %b64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; GLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%xa4 = sext <4 x i8> %a4 to <4 x i32>
%xb4 = sext <4 x i8> %b4 to <4 x i32>
%xa8 = sext <8 x i8> %a8 to <8 x i32>
%xb8 = sext <8 x i8> %b8 to <8 x i32>
%xa16 = sext <16 x i8> %a16 to <16 x i32>
%xb16 = sext <16 x i8> %b16 to <16 x i32>
%xa32 = sext <32 x i8> %a32 to <32 x i32>
%xb32 = sext <32 x i8> %b32 to <32 x i32>
%xa64 = sext <64 x i8> %a64 to <64 x i32>
%xb64 = sext <64 x i8> %b64 to <64 x i32>
%res4 = mul <4 x i32> %xa4, %xb4
%res8 = mul <8 x i32> %xa8, %xb8
%res16 = mul <16 x i32> %xa16, %xb16
%res32 = mul <32 x i32> %xa32, %xb32
%res64 = mul <64 x i32> %xa64, %xb64
ret void
}
define void @mul_zext_vXi8(<4 x i8> %a4, <4 x i8> %b4, <8 x i8> %a8, <8 x i8> %b8, <16 x i8> %a16, <16 x i8> %b16, <32 x i8> %a32, <32 x i8> %b32, <64 x i8> %a64, <64 x i8> %b64) {
; SSE2-LABEL: 'mul_zext_vXi8'
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa4 = zext <4 x i8> %a4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa8 = zext <8 x i8> %a8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa16 = zext <16 x i8> %a16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa32 = zext <32 x i8> %a32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xa64 = zext <64 x i8> %a64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSSE3-LABEL: 'mul_zext_vXi8'
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa4 = zext <4 x i8> %a4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa8 = zext <8 x i8> %a8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa16 = zext <16 x i8> %a16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa32 = zext <32 x i8> %a32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xa64 = zext <64 x i8> %a64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSSE3-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSE42-LABEL: 'mul_zext_vXi8'
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i8> %a4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i8> %a8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = zext <16 x i8> %a16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = zext <32 x i8> %a32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = zext <64 x i8> %a64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX1-LABEL: 'mul_zext_vXi8'
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i8> %a4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa8 = zext <8 x i8> %a8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa16 = zext <16 x i8> %a16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %xa32 = zext <32 x i8> %a32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %xa64 = zext <64 x i8> %a64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX1-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX1-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX2-LABEL: 'mul_zext_vXi8'
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i8> %a4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i8> %a8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = zext <16 x i8> %a16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %xa32 = zext <32 x i8> %a32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %xa64 = zext <64 x i8> %a64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX512-LABEL: 'mul_zext_vXi8'
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i8> %a4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa8 = zext <8 x i8> %a8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa16 = zext <16 x i8> %a16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa32 = zext <32 x i8> %a32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xa64 = zext <64 x i8> %a64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SLM-LABEL: 'mul_zext_vXi8'
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i8> %a4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i8> %a8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = zext <16 x i8> %a16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = zext <32 x i8> %a32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = zext <64 x i8> %a64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; GLM-LABEL: 'mul_zext_vXi8'
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i8> %a4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i8> %a8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = zext <16 x i8> %a16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = zext <32 x i8> %a32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = zext <64 x i8> %a64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%xa4 = zext <4 x i8> %a4 to <4 x i32>
%xb4 = zext <4 x i8> %b4 to <4 x i32>
%xa8 = zext <8 x i8> %a8 to <8 x i32>
%xb8 = zext <8 x i8> %b8 to <8 x i32>
%xa16 = zext <16 x i8> %a16 to <16 x i32>
%xb16 = zext <16 x i8> %b16 to <16 x i32>
%xa32 = zext <32 x i8> %a32 to <32 x i32>
%xb32 = zext <32 x i8> %b32 to <32 x i32>
%xa64 = zext <64 x i8> %a64 to <64 x i32>
%xb64 = zext <64 x i8> %b64 to <64 x i32>
%res4 = mul <4 x i32> %xa4, %xb4
%res8 = mul <8 x i32> %xa8, %xb8
%res16 = mul <16 x i32> %xa16, %xb16
%res32 = mul <32 x i32> %xa32, %xb32
%res64 = mul <64 x i32> %xa64, %xb64
ret void
}
define void @mul_sext_zext_vXi8(<4 x i8> %a4, <4 x i8> %b4, <8 x i8> %a8, <8 x i8> %b8, <16 x i8> %a16, <16 x i8> %b16, <32 x i8> %a32, <32 x i8> %b32, <64 x i8> %a64, <64 x i8> %b64) {
; SSE2-LABEL: 'mul_sext_zext_vXi8'
; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSSE3-LABEL: 'mul_sext_zext_vXi8'
; SSSE3-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSSE3-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSE42-LABEL: 'mul_sext_zext_vXi8'
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX1-LABEL: 'mul_sext_zext_vXi8'
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX1-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX1-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX2-LABEL: 'mul_sext_zext_vXi8'
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX512-LABEL: 'mul_sext_zext_vXi8'
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SLM-LABEL: 'mul_sext_zext_vXi8'
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; GLM-LABEL: 'mul_sext_zext_vXi8'
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i8> %a4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i8> %b4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i8> %a8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i8> %b8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i8> %a16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i8> %b16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i8> %a32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i8> %b32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i8> %a64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i8> %b64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%xa4 = sext <4 x i8> %a4 to <4 x i32>
%xb4 = zext <4 x i8> %b4 to <4 x i32>
%xa8 = sext <8 x i8> %a8 to <8 x i32>
%xb8 = zext <8 x i8> %b8 to <8 x i32>
%xa16 = sext <16 x i8> %a16 to <16 x i32>
%xb16 = zext <16 x i8> %b16 to <16 x i32>
%xa32 = sext <32 x i8> %a32 to <32 x i32>
%xb32 = zext <32 x i8> %b32 to <32 x i32>
%xa64 = sext <64 x i8> %a64 to <64 x i32>
%xb64 = zext <64 x i8> %b64 to <64 x i32>
%res4 = mul <4 x i32> %xa4, %xb4
%res8 = mul <8 x i32> %xa8, %xb8
%res16 = mul <16 x i32> %xa16, %xb16
%res32 = mul <32 x i32> %xa32, %xb32
%res64 = mul <64 x i32> %xa64, %xb64
ret void
}
;
; mul vXi16 -> mXi32
;
define void @mul_sext_vXi16(<4 x i16> %a4, <4 x i16> %b4, <8 x i16> %a8, <8 x i16> %b8, <16 x i16> %a16, <16 x i16> %b16, <32 x i16> %a32, <32 x i16> %b32, <64 x i16> %a64, <64 x i16> %b64) {
; SSE2-LABEL: 'mul_sext_vXi16'
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb4 = sext <4 x i16> %b4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb8 = sext <8 x i16> %b8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb16 = sext <16 x i16> %b16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb32 = sext <32 x i16> %b32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xb64 = sext <64 x i16> %b64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSSE3-LABEL: 'mul_sext_vXi16'
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb4 = sext <4 x i16> %b4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb8 = sext <8 x i16> %b8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb16 = sext <16 x i16> %b16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb32 = sext <32 x i16> %b32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xb64 = sext <64 x i16> %b64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSSE3-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSE42-LABEL: 'mul_sext_vXi16'
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i16> %b4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = sext <8 x i16> %b8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = sext <16 x i16> %b16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = sext <32 x i16> %b32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = sext <64 x i16> %b64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX1-LABEL: 'mul_sext_vXi16'
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i16> %b4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb8 = sext <8 x i16> %b8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xb16 = sext <16 x i16> %b16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %xb32 = sext <32 x i16> %b32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %xb64 = sext <64 x i16> %b64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX1-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX1-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX2-LABEL: 'mul_sext_vXi16'
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i16> %b4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = sext <8 x i16> %b8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb16 = sext <16 x i16> %b16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb32 = sext <32 x i16> %b32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xb64 = sext <64 x i16> %b64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX512-LABEL: 'mul_sext_vXi16'
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i16> %b4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb8 = sext <8 x i16> %b8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb16 = sext <16 x i16> %b16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb32 = sext <32 x i16> %b32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb64 = sext <64 x i16> %b64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SLM-LABEL: 'mul_sext_vXi16'
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i16> %b4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = sext <8 x i16> %b8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = sext <16 x i16> %b16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = sext <32 x i16> %b32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = sext <64 x i16> %b64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; GLM-LABEL: 'mul_sext_vXi16'
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = sext <4 x i16> %b4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = sext <8 x i16> %b8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = sext <16 x i16> %b16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = sext <32 x i16> %b32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = sext <64 x i16> %b64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%xa4 = sext <4 x i16> %a4 to <4 x i32>
%xb4 = sext <4 x i16> %b4 to <4 x i32>
%xa8 = sext <8 x i16> %a8 to <8 x i32>
%xb8 = sext <8 x i16> %b8 to <8 x i32>
%xa16 = sext <16 x i16> %a16 to <16 x i32>
%xb16 = sext <16 x i16> %b16 to <16 x i32>
%xa32 = sext <32 x i16> %a32 to <32 x i32>
%xb32 = sext <32 x i16> %b32 to <32 x i32>
%xa64 = sext <64 x i16> %a64 to <64 x i32>
%xb64 = sext <64 x i16> %b64 to <64 x i32>
%res4 = mul <4 x i32> %xa4, %xb4
%res8 = mul <8 x i32> %xa8, %xb8
%res16 = mul <16 x i32> %xa16, %xb16
%res32 = mul <32 x i32> %xa32, %xb32
%res64 = mul <64 x i32> %xa64, %xb64
ret void
}
define void @mul_zext_vXi16(<4 x i16> %a4, <4 x i16> %b4, <8 x i16> %a8, <8 x i16> %b8, <16 x i16> %a16, <16 x i16> %b16, <32 x i16> %a32, <32 x i16> %b32, <64 x i16> %a64, <64 x i16> %b64) {
; SSE2-LABEL: 'mul_zext_vXi16'
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i16> %a4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i16> %a8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = zext <16 x i16> %a16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = zext <32 x i16> %a32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = zext <64 x i16> %a64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE2-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSSE3-LABEL: 'mul_zext_vXi16'
; SSSE3-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i16> %a4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i16> %a8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = zext <16 x i16> %a16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = zext <32 x i16> %a32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = zext <64 x i16> %a64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSSE3-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSSE3-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSSE3-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSSE3-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSSE3-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSE42-LABEL: 'mul_zext_vXi16'
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i16> %a4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i16> %a8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = zext <16 x i16> %a16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = zext <32 x i16> %a32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = zext <64 x i16> %a64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE42-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX1-LABEL: 'mul_zext_vXi16'
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i16> %a4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa8 = zext <8 x i16> %a8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xa16 = zext <16 x i16> %a16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %xa32 = zext <32 x i16> %a32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %xa64 = zext <64 x i16> %a64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX1-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX2-LABEL: 'mul_zext_vXi16'
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i16> %a4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i16> %a8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa16 = zext <16 x i16> %a16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa32 = zext <32 x i16> %a32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xa64 = zext <64 x i16> %a64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX512-LABEL: 'mul_zext_vXi16'
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i16> %a4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa8 = zext <8 x i16> %a8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa16 = zext <16 x i16> %a16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa32 = zext <32 x i16> %a32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa64 = zext <64 x i16> %a64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SLM-LABEL: 'mul_zext_vXi16'
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i16> %a4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i16> %a8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = zext <16 x i16> %a16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = zext <32 x i16> %a32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = zext <64 x i16> %a64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SLM-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SLM-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SLM-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SLM-NEXT: Cost Model: Found an estimated cost of 80 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; GLM-LABEL: 'mul_zext_vXi16'
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = zext <4 x i16> %a4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = zext <8 x i16> %a8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = zext <16 x i16> %a16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = zext <32 x i16> %a32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = zext <64 x i16> %a64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; GLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%xa4 = zext <4 x i16> %a4 to <4 x i32>
%xb4 = zext <4 x i16> %b4 to <4 x i32>
%xa8 = zext <8 x i16> %a8 to <8 x i32>
%xb8 = zext <8 x i16> %b8 to <8 x i32>
%xa16 = zext <16 x i16> %a16 to <16 x i32>
%xb16 = zext <16 x i16> %b16 to <16 x i32>
%xa32 = zext <32 x i16> %a32 to <32 x i32>
%xb32 = zext <32 x i16> %b32 to <32 x i32>
%xa64 = zext <64 x i16> %a64 to <64 x i32>
%xb64 = zext <64 x i16> %b64 to <64 x i32>
%res4 = mul <4 x i32> %xa4, %xb4
%res8 = mul <8 x i32> %xa8, %xb8
%res16 = mul <16 x i32> %xa16, %xb16
%res32 = mul <32 x i32> %xa32, %xb32
%res64 = mul <64 x i32> %xa64, %xb64
ret void
}
define void @mul_sext_zext_vXi16(<4 x i16> %a4, <4 x i16> %b4, <8 x i16> %a8, <8 x i16> %b8, <16 x i16> %a16, <16 x i16> %b16, <32 x i16> %a32, <32 x i16> %b32, <64 x i16> %a64, <64 x i16> %b64) {
; SSE2-LABEL: 'mul_sext_zext_vXi16'
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE2-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSSE3-LABEL: 'mul_sext_zext_vXi16'
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; SSSE3-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSSE3-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSSE3-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSSE3-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSSE3-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSSE3-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SSE42-LABEL: 'mul_sext_zext_vXi16'
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; SSE42-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SSE42-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SSE42-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SSE42-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX1-LABEL: 'mul_sext_zext_vXi16'
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX1-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX1-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX2-LABEL: 'mul_sext_zext_vXi16'
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX512-LABEL: 'mul_sext_zext_vXi16'
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; SLM-LABEL: 'mul_sext_zext_vXi16'
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; SLM-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; SLM-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; SLM-NEXT: Cost Model: Found an estimated cost of 88 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; SLM-NEXT: Cost Model: Found an estimated cost of 176 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; GLM-LABEL: 'mul_sext_zext_vXi16'
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xa4 = sext <4 x i16> %a4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %xb4 = zext <4 x i16> %b4 to <4 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xa8 = sext <8 x i16> %a8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xb8 = zext <8 x i16> %b8 to <8 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xa16 = sext <16 x i16> %a16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %xb16 = zext <16 x i16> %b16 to <16 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xa32 = sext <32 x i16> %a32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %xb32 = zext <32 x i16> %b32 to <32 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xa64 = sext <64 x i16> %a64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %xb64 = zext <64 x i16> %b64 to <64 x i32>
; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res4 = mul <4 x i32> %xa4, %xb4
; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res8 = mul <8 x i32> %xa8, %xb8
; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res16 = mul <16 x i32> %xa16, %xb16
; GLM-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %res32 = mul <32 x i32> %xa32, %xb32
; GLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res64 = mul <64 x i32> %xa64, %xb64
; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%xa4 = sext <4 x i16> %a4 to <4 x i32>
%xb4 = zext <4 x i16> %b4 to <4 x i32>
%xa8 = sext <8 x i16> %a8 to <8 x i32>
%xb8 = zext <8 x i16> %b8 to <8 x i32>
%xa16 = sext <16 x i16> %a16 to <16 x i32>
%xb16 = zext <16 x i16> %b16 to <16 x i32>
%xa32 = sext <32 x i16> %a32 to <32 x i32>
%xb32 = zext <32 x i16> %b32 to <32 x i32>
%xa64 = sext <64 x i16> %a64 to <64 x i32>
%xb64 = zext <64 x i16> %b64 to <64 x i32>
%res4 = mul <4 x i32> %xa4, %xb4
%res8 = mul <8 x i32> %xa8, %xb8
%res16 = mul <16 x i32> %xa16, %xb16
%res32 = mul <32 x i32> %xa32, %xb32
%res64 = mul <64 x i32> %xa64, %xb64
ret void
}