mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
[CostModel][X86] Fix AVX512BW vector shift costs for vXi16 types
We already have patterns in place to support 128/256-bit shifts without AVX512VL llvm-svn: 292077
This commit is contained in:
parent
1634b52e50
commit
8a670cd3d1
@ -323,6 +323,14 @@ int X86TTIImpl::getArithmeticInstrCost(
|
|||||||
return LT.first * Entry->Cost;
|
return LT.first * Entry->Cost;
|
||||||
|
|
||||||
static const CostTblEntry AVX512BWCostTable[] = {
|
static const CostTblEntry AVX512BWCostTable[] = {
|
||||||
|
{ ISD::SHL, MVT::v8i16, 1 }, // vpsllvw
|
||||||
|
{ ISD::SRL, MVT::v8i16, 1 }, // vpsrlvw
|
||||||
|
{ ISD::SRA, MVT::v8i16, 1 }, // vpsravw
|
||||||
|
|
||||||
|
{ ISD::SHL, MVT::v16i16, 1 }, // vpsllvw
|
||||||
|
{ ISD::SRL, MVT::v16i16, 1 }, // vpsrlvw
|
||||||
|
{ ISD::SRA, MVT::v16i16, 1 }, // vpsravw
|
||||||
|
|
||||||
{ ISD::SHL, MVT::v32i16, 1 }, // vpsllvw
|
{ ISD::SHL, MVT::v32i16, 1 }, // vpsllvw
|
||||||
{ ISD::SRL, MVT::v32i16, 1 }, // vpsrlvw
|
{ ISD::SRL, MVT::v32i16, 1 }, // vpsrlvw
|
||||||
{ ISD::SRA, MVT::v32i16, 1 }, // vpsravw
|
{ ISD::SRA, MVT::v32i16, 1 }, // vpsravw
|
||||||
|
@ -98,7 +98,8 @@ define <8 x i16> @var_shift_v8i16(<8 x i16> %a, <8 x i16> %b) {
|
|||||||
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 14 for instruction: %shift
|
; AVX: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 14 for instruction: %shift
|
; AVX512F: Found an estimated cost of 14 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 2 for instruction: %shift
|
; XOP: Found an estimated cost of 2 for instruction: %shift
|
||||||
%shift = ashr <8 x i16> %a, %b
|
%shift = ashr <8 x i16> %a, %b
|
||||||
ret <8 x i16> %shift
|
ret <8 x i16> %shift
|
||||||
@ -110,7 +111,8 @@ define <16 x i16> @var_shift_v16i16(<16 x i16> %a, <16 x i16> %b) {
|
|||||||
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 28 for instruction: %shift
|
; AVX: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 10 for instruction: %shift
|
; AVX512F: Found an estimated cost of 10 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 4 for instruction: %shift
|
; XOP: Found an estimated cost of 4 for instruction: %shift
|
||||||
%shift = ashr <16 x i16> %a, %b
|
%shift = ashr <16 x i16> %a, %b
|
||||||
ret <16 x i16> %shift
|
ret <16 x i16> %shift
|
||||||
@ -432,7 +434,8 @@ define <8 x i16> @constant_shift_v8i16(<8 x i16> %a) {
|
|||||||
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 14 for instruction: %shift
|
; AVX: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 14 for instruction: %shift
|
; AVX512F: Found an estimated cost of 14 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 2 for instruction: %shift
|
; XOP: Found an estimated cost of 2 for instruction: %shift
|
||||||
%shift = ashr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
|
%shift = ashr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
|
||||||
ret <8 x i16> %shift
|
ret <8 x i16> %shift
|
||||||
@ -444,7 +447,8 @@ define <16 x i16> @constant_shift_v16i16(<16 x i16> %a) {
|
|||||||
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 28 for instruction: %shift
|
; AVX: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 10 for instruction: %shift
|
; AVX512F: Found an estimated cost of 10 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 4 for instruction: %shift
|
; XOP: Found an estimated cost of 4 for instruction: %shift
|
||||||
%shift = ashr <16 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
|
%shift = ashr <16 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
|
||||||
ret <16 x i16> %shift
|
ret <16 x i16> %shift
|
||||||
|
@ -101,7 +101,8 @@ define <8 x i16> @var_shift_v8i16(<8 x i16> %a, <8 x i16> %b) {
|
|||||||
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 14 for instruction: %shift
|
; AVX: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 14 for instruction: %shift
|
; AVX512F: Found an estimated cost of 14 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 2 for instruction: %shift
|
; XOP: Found an estimated cost of 2 for instruction: %shift
|
||||||
%shift = lshr <8 x i16> %a, %b
|
%shift = lshr <8 x i16> %a, %b
|
||||||
ret <8 x i16> %shift
|
ret <8 x i16> %shift
|
||||||
@ -113,7 +114,8 @@ define <16 x i16> @var_shift_v16i16(<16 x i16> %a, <16 x i16> %b) {
|
|||||||
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 28 for instruction: %shift
|
; AVX: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 10 for instruction: %shift
|
; AVX512F: Found an estimated cost of 10 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 4 for instruction: %shift
|
; XOP: Found an estimated cost of 4 for instruction: %shift
|
||||||
%shift = lshr <16 x i16> %a, %b
|
%shift = lshr <16 x i16> %a, %b
|
||||||
ret <16 x i16> %shift
|
ret <16 x i16> %shift
|
||||||
@ -437,7 +439,8 @@ define <8 x i16> @constant_shift_v8i16(<8 x i16> %a) {
|
|||||||
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 14 for instruction: %shift
|
; AVX: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 14 for instruction: %shift
|
; AVX512F: Found an estimated cost of 14 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 2 for instruction: %shift
|
; XOP: Found an estimated cost of 2 for instruction: %shift
|
||||||
%shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
|
%shift = lshr <8 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
|
||||||
ret <8 x i16> %shift
|
ret <8 x i16> %shift
|
||||||
@ -449,7 +452,8 @@ define <16 x i16> @constant_shift_v16i16(<16 x i16> %a) {
|
|||||||
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 28 for instruction: %shift
|
; AVX: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 10 for instruction: %shift
|
; AVX512F: Found an estimated cost of 10 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 4 for instruction: %shift
|
; XOP: Found an estimated cost of 4 for instruction: %shift
|
||||||
%shift = lshr <16 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
|
%shift = lshr <16 x i16> %a, <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>
|
||||||
ret <16 x i16> %shift
|
ret <16 x i16> %shift
|
||||||
|
@ -102,7 +102,8 @@ define <8 x i16> @var_shift_v8i16(<8 x i16> %a, <8 x i16> %b) {
|
|||||||
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
; SSE41: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 14 for instruction: %shift
|
; AVX: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
; AVX2: Found an estimated cost of 14 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 14 for instruction: %shift
|
; AVX512F: Found an estimated cost of 14 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 1 for instruction: %shift
|
; XOP: Found an estimated cost of 1 for instruction: %shift
|
||||||
%shift = shl <8 x i16> %a, %b
|
%shift = shl <8 x i16> %a, %b
|
||||||
ret <8 x i16> %shift
|
ret <8 x i16> %shift
|
||||||
@ -114,7 +115,8 @@ define <16 x i16> @var_shift_v16i16(<16 x i16> %a, <16 x i16> %b) {
|
|||||||
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
; SSE41: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX: Found an estimated cost of 28 for instruction: %shift
|
; AVX: Found an estimated cost of 28 for instruction: %shift
|
||||||
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
; AVX2: Found an estimated cost of 10 for instruction: %shift
|
||||||
; AVX512: Found an estimated cost of 10 for instruction: %shift
|
; AVX512F: Found an estimated cost of 10 for instruction: %shift
|
||||||
|
; AVX512BW: Found an estimated cost of 1 for instruction: %shift
|
||||||
; XOP: Found an estimated cost of 2 for instruction: %shift
|
; XOP: Found an estimated cost of 2 for instruction: %shift
|
||||||
%shift = shl <16 x i16> %a, %b
|
%shift = shl <16 x i16> %a, %b
|
||||||
ret <16 x i16> %shift
|
ret <16 x i16> %shift
|
||||||
|
Loading…
Reference in New Issue
Block a user