From patchwork Fri May 17 20:13:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 244699 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id E9C1D2C0079 for ; Sat, 18 May 2013 06:13:58 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=ez6nZWdQZYzxlqxnms0JDzoMHNmBCXHA4rVG64pgQSGMxl 8fNxLmlI7MO8XRyi5ePhFiGacKkVeqzzkgXCf9fbsPbRkA5h+tULXiC79kj/gv9R R0g3MYAzFmENdTOTuf1ueMtbtPH4JVqNpn9qsZYwUcef4tQ1HeK4y10t8RXpQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=D5HL8Sjd+Me71ColhPzzLcj4/cU=; b=YeAdTo4UBVL3oeID4gzn fjooxqvPq8p7TjBslOBGgd2IERdzNwC5EvMv21oHjVy88n+UX/O9S4PXYFQLsetT 0LyF9mC7GEzYK2vgtBdtcAAvSMdigPpPNSxFUuNc0VpWRzyQP6e0gYQwpNJN+wfo wjvHMBqCx5/Xpm9UMLzRfCA= Received: (qmail 20605 invoked by alias); 17 May 2013 20:13:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20594 invoked by uid 89); 17 May 2013 20:13:52 -0000 X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS, TW_CL, TW_OV, TW_PX, TW_ZJ autolearn=ham version=3.3.1 Received: from mail-pa0-f49.google.com (HELO mail-pa0-f49.google.com) (209.85.220.49) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 17 May 2013 20:13:51 +0000 Received: by mail-pa0-f49.google.com with SMTP id bi5so3869424pad.22 for ; Fri, 17 May 2013 13:13:50 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.68.212.72 with SMTP id ni8mr26306336pbc.114.1368821630167; Fri, 17 May 2013 13:13:50 -0700 (PDT) Received: by 10.70.10.34 with HTTP; Fri, 17 May 2013 13:13:50 -0700 (PDT) Date: Fri, 17 May 2013 22:13:50 +0200 Message-ID: Subject: [PATCH, i386]: Also pass mmx, 3dnow and sseX options with -march=native From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" X-Virus-Found: No Hello! For some reason we didn't pass mmx, 3dnow and sseX options to cc1 with -march=native. Passing these options will help older processors that doesn't get detected through architecture recognition functionality to get all their ISAs enabled. 2013-05-17 Uros Bizjak * config/i386/driver-i386.c (host_detect_local_cpu): Pass mmx, 3dnow, sse, sse2, sse3, ssse3 and sse4a flags to options. Tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline. Uros. Index: config/i386/driver-i386.c =================================================================== --- config/i386/driver-i386.c (revision 198989) +++ config/i386/driver-i386.c (working copy) @@ -786,10 +786,17 @@ const char *host_detect_local_cpu (int argc, const if (arch) { + const char *mmx = has_mmx ? " -mmmx" : " -mno-mmx"; + const char *mmx3dnow = has_3dnow ? " -m3dnow" : " -mno-3dnow"; + const char *sse = has_sse ? " -msse" : " -mno-sse"; + const char *sse2 = has_sse2 ? " -msse2" : " -mno-sse2"; + const char *sse3 = has_sse3 ? " -msse3" : " -mno-sse3"; + const char *ssse3 = has_ssse3 ? " -mssse3" : " -mno-ssse3"; + const char *sse4a = has_sse4a ? " -msse4a" : " -mno-sse4a"; const char *cx16 = has_cmpxchg16b ? " -mcx16" : " -mno-cx16"; const char *sahf = has_lahf_lm ? " -msahf" : " -mno-sahf"; const char *movbe = has_movbe ? " -mmovbe" : " -mno-movbe"; - const char *ase = has_aes ? " -maes" : " -mno-aes"; + const char *aes = has_aes ? " -maes" : " -mno-aes"; const char *pclmul = has_pclmul ? " -mpclmul" : " -mno-pclmul"; const char *popcnt = has_popcnt ? " -mpopcnt" : " -mno-popcnt"; const char *abm = has_abm ? " -mabm" : " -mno-abm"; @@ -817,7 +824,8 @@ const char *host_detect_local_cpu (int argc, const const char *xsave = has_xsave ? " -mxsave" : " -mno-xsave"; const char *xsaveopt = has_xsaveopt ? " -mxsaveopt" : " -mno-xsaveopt"; - options = concat (options, cx16, sahf, movbe, ase, pclmul, + options = concat (options, mmx, mmx3dnow, sse, sse2, sse3, ssse3, + sse4a, cx16, sahf, movbe, aes, pclmul, popcnt, abm, lwp, fma, fma4, xop, bmi, bmi2, tbm, avx, avx2, sse4_2, sse4_1, lzcnt, rtm, hle, rdrnd, f16c, fsgsbase, rdseed, prfchw, adx,