From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14445 invoked by alias); 10 Aug 2014 12:05:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14413 invoked by uid 48); 10 Aug 2014 12:05:18 -0000 From: "beschindler at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/62080] Suboptimal code generation with eigen library Date: Sun, 10 Aug 2014 12:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: beschindler at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-08/txt/msg00605.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62080 --- Comment #3 from Benjamin Schindler --- I just looked at what gcc-4.9.1 does and it does vary: movdqu (%rsi), %xmm1 movdqu (%rdi), %xmm0 <-- pminsd %xmm1, %xmm0 <-- pxor %xmm1, %xmm1 pmaxsd %xmm1, %xmm0 movaps %xmm0, (%rsi) So, the first version still has a needless movdqu (for which I don't know how much it hurts). Second version movdqa (%rsi), %xmm0 pminsd (%rdi), %xmm0 <-- good pxor %xmm1, %xmm1 movdqu %xmm0, %xmm0 <-- bad? pmaxsd %xmm1, %xmm0 movaps %xmm0, (%rsi) So, gcc-4.9 fares better such that it does not go to memory, but it emits an odd mov instruction. May be this is a separate issue?