gcc -march=core2 -O3 -ftree-vectorizer-verbose=6
for this code:
#define SIZE 10000
signed short a[SIZE];
signed short b[SIZE];
signed short c[SIZE];
void add()
{
int i;
for (i = 0; i < SIZE; ++i)
a[i] = b[i] + c[i];
}
cannot vectorize the loop:
add_sshort.c:9: note: vect_model_load_cost: aligned.
add_sshort.c:9: note: vect_model_load_cost: inside_cost = 1, outside_cost = 0 .
add_sshort.c:9: note: not vectorized: relevant stmt not supported: D.1580_6 =
(short unsigned int) D.1579_5
add_sshort.c:7: note: vectorized 0 loops in function.
The same happens if the type for a,b and c is "signed char".
But if the type is "unsigned short" or "unsigned char" the loop is vectorized.
--
Summary: signed short plus and signed char plus not vectorized
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dann at godzilla dot ics dot uci dot edu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39068