From patchwork Wed Aug 12 14:51:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 506676 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B510A14018C for ; Thu, 13 Aug 2015 00:51:39 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=vpsaJPG2; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=VXO8VXnyWpWCYjGAHqSKm3OV/e1VI 8e1r7lxi5GASWE9t5Do6m2jSWI8h/pAytLwoqI/qCCp6u5YDFYvCBBSFVKhtTjGB yD4tvDkW2qTQ4GpbyqN6N6Of5GpX/SLdsr5GDfziNoBBeLO8QL/8nth4mHZ9N3x5 kQdavp85D1yMmw= 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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=aRoWdeEptiOveGNXfv16Y6pjMzE=; b=vps aJPG2P0rchwnt403uC23DD2+9b6r7LU0MK4mtt4q+xp2N2n7SkZcOX+BXYfiMCON 68FEYivnznnfLkZAJlSrfcy1t4GQB2JQTGhMYIAicZ2yiyi1wn/ZIDTPV3X3TeP7 4m6piuyAGY1m9ywKzug45uvA+0RhDk4K35TXVYo4= Received: (qmail 45451 invoked by alias); 12 Aug 2015 14:51:32 -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 45442 invoked by uid 89); 12 Aug 2015 14:51:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Aug 2015 14:51:30 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 12 Aug 2015 07:51:30 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([172.25.70.52]) by orsmga001.jf.intel.com with ESMTP; 12 Aug 2015 07:51:29 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 1000) id 42A11C3C4F; Wed, 12 Aug 2015 07:51:29 -0700 (PDT) Date: Wed, 12 Aug 2015 07:51:29 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Uros Bizjak Subject: [committed, PATCH] Add Knights Landing support to __builtin_cpu_is Message-ID: <20150812145129.GA29524@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) This patch adds Knights Landing support to __builtin_cpu_is. gcc/testsuite/ * gcc.target/i386/builtin_target.c (check_intel_cpu_model): Check Knights Landing support. libgcc/ * config/i386/cpuinfo.c (processor_types): Add INTEL_KNL. (get_intel_cpu): Add Knights Landing support. --- gcc/testsuite/gcc.target/i386/builtin_target.c | 4 ++++ libgcc/config/i386/cpuinfo.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c b/gcc/testsuite/gcc.target/i386/builtin_target.c index 4adea27..068db23 100644 --- a/gcc/testsuite/gcc.target/i386/builtin_target.c +++ b/gcc/testsuite/gcc.target/i386/builtin_target.c @@ -38,6 +38,10 @@ check_intel_cpu_model (unsigned int family, unsigned int model, /* Silvermont. */ assert (__builtin_cpu_is ("silvermont")); break; + case 0x57: + /* Knights Landing. */ + assert (__builtin_cpu_is ("knl")); + break; case 0x1a: case 0x1e: case 0x1f: diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index 25d85e4..b7b11de 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -56,6 +56,7 @@ enum processor_types AMDFAM10H, AMDFAM15H, INTEL_SILVERMONT, + INTEL_KNL, AMD_BTVER1, AMD_BTVER2, CPU_TYPE_MAX @@ -197,6 +198,10 @@ get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id) /* Silvermont. */ __cpu_model.__cpu_type = INTEL_SILVERMONT; break; + case 0x57: + /* Knights Landing. */ + __cpu_model.__cpu_type = INTEL_KNL; + break; case 0x1a: case 0x1e: case 0x1f: