unsigned int fadda_f16_cost,
unsigned int fadda_f32_cost,
unsigned int fadda_f64_cost,
+ unsigned int gather_load_x32_cost,
+ unsigned int gather_load_x64_cost,
unsigned int scatter_store_elt_cost)
: simd_vec_cost (base),
clast_cost (clast_cost),
fadda_f16_cost (fadda_f16_cost),
fadda_f32_cost (fadda_f32_cost),
fadda_f64_cost (fadda_f64_cost),
+ gather_load_x32_cost (gather_load_x32_cost),
+ gather_load_x64_cost (gather_load_x64_cost),
scatter_store_elt_cost (scatter_store_elt_cost)
{}
const int fadda_f32_cost;
const int fadda_f64_cost;
+ /* The cost of a gather load instruction. The x32 value is for loads
+ of 32-bit elements and the x64 value is for loads of 64-bit elements. */
+ const int gather_load_x32_cost;
+ const int gather_load_x64_cost;
+
/* The per-element cost of a scatter store. */
const int scatter_store_elt_cost;
};
2, /* fadda_f16_cost */
2, /* fadda_f32_cost */
2, /* fadda_f64_cost */
+ 4, /* gather_load_x32_cost */
+ 2, /* gather_load_x64_cost */
1 /* scatter_store_elt_cost */
};
13, /* fadda_f16_cost */
13, /* fadda_f32_cost */
13, /* fadda_f64_cost */
+ 64, /* gather_load_x32_cost */
+ 32, /* gather_load_x64_cost */
1 /* scatter_store_elt_cost */
};
19, /* fadda_f16_cost */
11, /* fadda_f32_cost */
8, /* fadda_f64_cost */
+ 32, /* gather_load_x32_cost */
+ 16, /* gather_load_x64_cost */
3 /* scatter_store_elt_cost */
};
&& DR_IS_WRITE (STMT_VINFO_DATA_REF (stmt_info)))
return simd_costs->store_elt_extra_cost;
+ /* Detect SVE gather loads, which are costed as a single scalar_load
+ for each element. We therefore need to divide the full-instruction
+ cost by the number of elements in the vector. */
+ if (kind == scalar_load
+ && sve_costs
+ && STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info) == VMAT_GATHER_SCATTER)
+ {
+ unsigned int nunits = vect_nunits_for_cost (vectype);
+ if (GET_MODE_UNIT_BITSIZE (TYPE_MODE (vectype)) == 64)
+ return { sve_costs->gather_load_x64_cost, nunits };
+ return { sve_costs->gather_load_x32_cost, nunits };
+ }
+
/* Detect cases in which a scalar_store is really storing one element
in a scatter operation. */
if (kind == scalar_store