diff options
author | liuhongt <hongtao.liu@intel.com> | 2023-02-22 17:54:46 +0800 |
---|---|---|
committer | liuhongt <hongtao.liu@intel.com> | 2023-05-31 07:17:43 +0800 |
commit | 3279b6223066d36d2e6880a137f80a46d3c82c8f (patch) | |
tree | 3c61ab079a190acf2f0b42ef2037194900444714 /gcc/tree-vect-patterns.cc | |
parent | e4c8f7024f02d8e223c6df7bd117e7615a553918 (diff) | |
download | gcc-3279b6223066d36d2e6880a137f80a46d3c82c8f.zip gcc-3279b6223066d36d2e6880a137f80a46d3c82c8f.tar.gz gcc-3279b6223066d36d2e6880a137f80a46d3c82c8f.tar.bz2 |
Enhance NARROW FLOAT_EXPR vectorization by truncating integer to lower precision.
Similar like WIDEN FLOAT_EXPR, when direct_optab is not existed, try
intermediate integer type whenever gimple ranger can tell it's safe.
.i.e.
When there's no direct optab for vector long long -> vector float, but
the value range of integer can be represented as int, try vector int
-> vector float if availble.
gcc/ChangeLog:
PR tree-optimization/108804
* tree-vect-patterns.cc (vect_get_range_info): Remove static.
* tree-vect-stmts.cc (vect_create_vectorized_demotion_stmts):
Add new parameter narrow_src_p.
(vectorizable_conversion): Enhance NARROW FLOAT_EXPR
vectorization by truncating to lower precision.
* tree-vectorizer.h (vect_get_range_info): New declare.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr108804.c: New test.
Diffstat (limited to 'gcc/tree-vect-patterns.cc')
-rw-r--r-- | gcc/tree-vect-patterns.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc index 33a8b2b..917f7bc 100644 --- a/gcc/tree-vect-patterns.cc +++ b/gcc/tree-vect-patterns.cc @@ -61,7 +61,7 @@ along with GCC; see the file COPYING3. If not see /* Return true if we have a useful VR_RANGE range for VAR, storing it in *MIN_VALUE and *MAX_VALUE if so. Note the range in the dump files. */ -static bool +bool vect_get_range_info (tree var, wide_int *min_value, wide_int *max_value) { value_range vr; |