From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D53053858404; Thu, 2 Feb 2023 08:50:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D53053858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675327804; bh=T7fhYknNyoL+5g8jlJHaSk0+xsK+yYPDaVsyVw+wbp4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e9Q98OVwCshCOCGeHMvl2vxpWxxtS5uKlmZ+z7onKualF/EfXhksdslwIAl1sFCoK QiEXsmB45R/1wf8eqcXC5zG3LhVhWuBYPyDHMnM1DznMWM1ddjvBMJzucYBCpW113u mKdujNjBgZv41b2w7OrQx9xYZ84LX8TQkKkuLwzM= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108583] [13 Regression] wrong code with vector division by uint16 at -O2 Date: Thu, 02 Feb 2023 08:50:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D108583 --- Comment #22 from rguenther at suse dot de --- On Thu, 2 Feb 2023, tnfchris at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108583 >=20 > --- Comment #21 from Tamar Christina --- > >=20 > > OK, so that's an ADD_HIGHPART_EXPR then? Though the highpart of an > > add is only a single bit, isn't it? For scalar you'd use the > > carry bit here and instructions like adc to consume it. Is addhn > > to do such thing on vectors? > >=20 >=20 > So I think this is the only new IFN we'd need. basically we only need one > representing (a + b) >> n, for certain values of n we have a single instr= uction > for others we reject it. But the ISA only implements n =3D=3D width(a), so a true "highpart add". So I'd add OPTAB_D (sadd_highpart_optab, "sadd$a3_highpart") OPTAB_D (uadd_highpart_optab, "uadd$a3_highpart") only? That is it's QImode + QImode -> QImode with the carry bit in the result (sign or zero-extended)?=