This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/88013] New: can't vectorize rgb to grayscale conversion code
- From: "hoganmeier at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Nov 2018 05:23:49 +0000
- Subject: [Bug target/88013] New: can't vectorize rgb to grayscale conversion code
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88013
Bug ID: 88013
Summary: can't vectorize rgb to grayscale conversion code
Product: gcc
Version: 7.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hoganmeier at gmail dot com
Target Milestone: ---
#include <stdint.h>
void reference_convert(uint8_t * __restrict dest, uint8_t * __restrict src, int
n)
{
for (int i=0; i<n; i++)
{
int r = *src++;
int g = *src++;
int b = *src++;
int y = (r*77)+(g*151)+(b*28);
*dest++ = y/256;
}
}
$ arm-gcc -march=armv7-a -O3 -ffast-math -fopt-info-vec-omp-optimized-missed
gives the following notes on the loop line:
unsupported data-type int
can't determine vectorization factor.
vector alignment may not be reachable
Aligned load, but unsupported type.
not vectorized: relevant stmt not supported: _1 = *src_31;
bad operation or unsupported loop bound.
vector alignment may not be reachable
no array mode for DI[3]
extract even/odd not supported by target
bad operation or unsupported loop bound.
Vectorization works for x64.
https://godbolt.org/z/FPG3k_