From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13242 invoked by alias); 5 Sep 2011 23:08:45 -0000 Received: (qmail 13234 invoked by uid 22791); 5 Sep 2011 23:08:45 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_VC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Sep 2011 23:08:29 +0000 From: "andi-gcc at firstfloor dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/50302] New: inefficient float->double conversion in AVX with -mtune=generic Date: Mon, 05 Sep 2011 23:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andi-gcc at firstfloor dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2011-09/txt/msg00359.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50302 Bug #: 50302 Summary: inefficient float->double conversion in AVX with -mtune=generic Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: andi-gcc@firstfloor.org I noticed that with AVX and -mtune=generic and converting a single float to a double gcc still generates vunpcklps reg,reg vcvtps2pd reg,reg instead of the more straight forward and likely more power efficient vcvtss2sd reg,reg AFAIK the first sequence was only needed on some older AMD CPUs with SSE to avoid a conversion penalty, does it really still make sense for AVX? Perhaps that should be fixed for tune=generic ? Test case: #include float a = 1, b = 2; float c; int main(void) { c = a + b; printf("%f\n", c); return 0; }