From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1F6A03989CB3; Wed, 14 Apr 2021 18:19:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F6A03989CB3 From: "munroesj at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/100085] New: Bad code for union transfer from __float128 to vector types Date: Wed, 14 Apr 2021 18:19:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: munroesj at gcc dot gnu.org 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 attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2021 18:19:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100085 Bug ID: 100085 Summary: Bad code for union transfer from __float128 to vector types Product: gcc Version: 10.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: munroesj at gcc dot gnu.org Target Milestone: --- Created attachment 50595 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50595&action=3Dedit Reduced example of union and __float128 to vector transfer. GCC 10/9/8/7 will generate poor (-mcpu=3Dpower8) code when using a union to transfer a __float128 scalar to any vector type. __float128 is a scalar type and not typecast compatible with any vector type. Despite both being in Vec= tor registers.=20 But for runtime codes implementing __float128 operations for -mcpu=3Dpower8= it is useful (and faster) to perform some (data_class, conversions, etc) operatio= ns directly in vector registers. The only solution for this is to use union to transfer values between __float128/vector types. This should be a simple ve= ctor register transfer and optimized as such. But when for GCC and PowerPCle and -mcpu=3Dpower8, we are consistently seei= ng store/reload sequences. For Power8 this can cause load-hit-store and pipe-l= ine rejects (33 cycles). We don't see this when targeting -mcpu=3Dpower9, but power9 supports hardwa= re Float128 instruction. Also we don't see this when targeting BE.=