-
Notifications
You must be signed in to change notification settings - Fork 3
/
vectorcost.patch
35 lines (33 loc) · 1.56 KB
/
vectorcost.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- gcc-11.1.0/gcc/config/i386/i386.c~ 2021-04-27 10:00:13.000000000 +0000
+++ gcc-11.1.0/gcc/config/i386/i386.c 2021-07-14 13:57:34.109517535 +0000
@@ -21857,6 +21857,9 @@
{
/* N element inserts into SSE vectors. */
- int cost = TYPE_VECTOR_SUBPARTS (vectype) * ix86_cost->sse_op;
+ int cost = TYPE_VECTOR_SUBPARTS (vectype) * (ix86_cost->sse_op + 1);
+ if (TYPE_VECTOR_SUBPARTS (vectype) == 2)
+ cost += 6;
+
/* One vinserti128 for combining two SSE vectors for AVX256. */
if (GET_MODE_BITSIZE (mode) == 256)
cost += ix86_vec_cost (mode, ix86_cost->addss);
--- gcc-11.1.0/gcc/config/i386/i386.c~ 2021-07-14 13:57:34.000000000 +0000
+++ gcc-11.1.0/gcc/config/i386/i386.c 2021-07-14 15:14:52.180452960 +0000
@@ -21862,7 +21862,7 @@
/* One vinserti128 for combining two SSE vectors for AVX256. */
if (GET_MODE_BITSIZE (mode) == 256)
- cost += ix86_vec_cost (mode, ix86_cost->addss);
+ cost += ix86_vec_cost (mode, ix86_cost->addss) + 6;
/* One vinserti64x4 and two vinserti128 for combining SSE
and AVX256 vectors to AVX512. */
else if (GET_MODE_BITSIZE (mode) == 512)
--- gcc-11.1.0/gcc/config/i386/i386.c~ 2021-07-14 15:14:52.000000000 +0000
+++ gcc-11.1.0/gcc/config/i386/i386.c 2021-07-14 22:11:20.227105056 +0000
@@ -21866,7 +21866,7 @@
/* One vinserti64x4 and two vinserti128 for combining SSE
and AVX256 vectors to AVX512. */
else if (GET_MODE_BITSIZE (mode) == 512)
- cost += 3 * ix86_vec_cost (mode, ix86_cost->addss);
+ cost += 3 * ix86_vec_cost (mode, ix86_cost->addss) + 6;
return cost;
}