From patchwork Sat Sep 8 01:45:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Drepper X-Patchwork-Id: 182495 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]) by ozlabs.org (Postfix) with SMTP id 7610D2C0098 for ; Sat, 8 Sep 2012 11:46:15 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1347673576; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:From:Date:Message-ID:Subject:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=eaGIHVl JgZTua4nDlZcAx6kaKH8=; b=lEXwNeuDI64OgsKJrX4EwjK///V8Fki6iUD7sdj yxuWG5DvPHL9d7J0yBEezLPqUEJcFD37hBkkKrS3RYg69FOoeldEj9z+2rB1avA3 Qvz1coVIYd68EGDP4IffIrWSUpqV0CLS0u97N9swAxMaHXVF0YGthDAlae2ZvoLY KI4I= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:MIME-Version:Received:From:Date:Message-ID:Subject:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=VZhaMqm+RfHf0MuV1D+VFF4YDTLXPyQgszdPh+vvKjXevGFM4N+HUdmlMVqd5r 53qZuZSkYtATmunFRQ0Mr17MyEsJ6S7Mrb8lv8LD66ND2jcZL3nlbsZcXc3Wdl+e l0Yd2UXX5gr3zB/hX6Ny/UxpdY7Y21mlb7Yk2+hI0RtIY=; Received: (qmail 17560 invoked by alias); 8 Sep 2012 01:46:08 -0000 Received: (qmail 17547 invoked by uid 22791); 8 Sep 2012 01:46:07 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ee0-f47.google.com (HELO mail-ee0-f47.google.com) (74.125.83.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 08 Sep 2012 01:45:54 +0000 Received: by eekb57 with SMTP id b57so87515eek.20 for ; Fri, 07 Sep 2012 18:45:52 -0700 (PDT) Received: by 10.204.152.211 with SMTP id h19mr3158363bkw.45.1347068752687; Fri, 07 Sep 2012 18:45:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.127.24 with HTTP; Fri, 7 Sep 2012 18:45:32 -0700 (PDT) From: Ulrich Drepper Date: Fri, 7 Sep 2012 21:45:32 -0400 Message-ID: Subject: symbolic names for processor IDs To: gcc-patches@gcc.gnu.org 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 The x86 cpuid instruction returns a processor ID and the __get_cpuid_max function even explicitly makes the %ebx value directly available. But users of that function have to use a cryptic constant. How about adding a few macros to make this more transparent? Index: gcc/config/i386/cpuid.h =================================================================== --- gcc/config/i386/cpuid.h (revision 191084) +++ gcc/config/i386/cpuid.h (working copy) @@ -75,6 +75,16 @@ #define bit_RDSEED (1 << 18) #define bit_ADX (1 << 19) +/* Signatures for different CPU implementations as returned in uses + of cpuid with level 0. */ +#define signature_INTEL_ebx 0x756e6547 +#define signature_INTEL_ecx 0x6c65746e +#define signature_INTEL_edx 0x49656e69 + +#define signature_AMD_ebx 0x68747541 +#define signature_AMD_ecx 0x444d4163 +#define signature_AMD_edx 0x69746e65 + #if defined(__i386__) && defined(__PIC__) /* %ebx may be the PIC register. */ #if __GNUC__ >= 3