From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D94AB385E02C; Fri, 21 Jul 2023 21:44:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D94AB385E02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689975868; bh=vffeQq6Ol/P7JcUclDyAFgzz9A6moTd+ucpzOIQHWHM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hfKafhr+IknN8aytuaxCzBO1ljZulpaoUf7YZMrmKrr17Bz8Qo1YQDIkHdrOSRsFL fhPvVReTRoYf7Vxsefhxtt7CM8CP+z5xoBQf1WOHFVXlBJIOHmMgst2k4wRnqDpfwo v4jnPj8DZBbbPKDUHIYH31G8h51WWrMxt0ENflrM= From: "vineetg at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110748] RISC-V: optimize store of DF 0.0 Date: Fri, 21 Jul 2023 21:44:28 +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: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: vineetg at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: vineetg at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D110748 --- Comment #12 from Vineet Gupta --- > void znd(double *d) { *d =3D -0.0; } > void znf(float *f) { *f =3D -0.0; } The rough approach I'm thinking of is to=20 (1) Introduce a constraint for -0.0 and perhaps a predicate as well for "*movdf_hardfloat_rv64". That way df expander can elide the const pool. (2) Add a combiner pattern to recog a set of -0.0 to bit set, which would be automatically optim to BSETI if zbs is passed.=