https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110018

            Bug ID: 110018
           Summary: Missing vectorizable_conversion(unsigned char ->
                    double) for BB vectorizer
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---

When Looking at PR109812, I noticed there's missing vectorizable_conversion for
BB vectorizer when target doesn't support direct optab for unsigned char to
double. But actually it can be vectorized via unsigned char -> short/int/long
long -> double when vectorizable_conversion is ok for any of the immediate
type.

Currently, when modifier is NONE, vectorizable_conversion doesn't try any
immediate type, it can be extended similar like WIDEN.

 5158    case NONE:
 5159      if (code != FIX_TRUNC_EXPR
 5160          && code != FLOAT_EXPR
 5161          && !CONVERT_EXPR_CODE_P (code))
 5162        return false;
 5163      if (supportable_convert_operation (code, vectype_out, vectype_in,
&code1))
 5164        break;
 5165      /* FALLTHRU */

void
foo (double* __restrict a, unsigned char* b)
{
    a[0] = b[0];
    a[1] = b[1];
    a[2] = b[2];
    a[3] = b[3];
    a[4] = b[4];
    a[5] = b[5];
    a[6] = b[6];
    a[7] = b[7];
}

missed:   conversion not supported by target.

Reply via email to