From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AD1F93858D35; Mon, 29 May 2023 02:35:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD1F93858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685327732; bh=4oDphjjPaqMhTXubn8XDc7xORO0WgyVX6Ptukc7MuRk=; h=From:To:Subject:Date:From; b=AKFiviCMCGtpRPWbT4whZy9qZbRiB5K6F9n+dngjKzCaI7Q6Q9E1tYktNnc41wlxJ gNHF37KRRPXmzVORP3rY6Hxzt4zwuhq6oSqWUXM/LrC6WFsMe6L17X3b5VxXCStrgW g4chPHDPtirgjOXw7K2GkDqETuJN6ZajENBhN9Ls= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110018] New: Missing vectorizable_conversion(unsigned char -> double) for BB vectorizer Date: Mon, 29 May 2023 02:35:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110018 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/lo= ng 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 !=3D FIX_TRUNC_EXPR 5160 && code !=3D 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] =3D b[0]; a[1] =3D b[1]; a[2] =3D b[2]; a[3] =3D b[3]; a[4] =3D b[4]; a[5] =3D b[5]; a[6] =3D b[6]; a[7] =3D b[7]; } missed: conversion not supported by target.=