From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26699 invoked by alias); 27 Jul 2007 19:32:26 -0000 Received: (qmail 26690 invoked by uid 22791); 27 Jul 2007 19:32:25 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 27 Jul 2007 19:32:24 +0000 Received: (qmail 21387 invoked from network); 27 Jul 2007 19:32:22 -0000 Received: from unknown (HELO gateway) (10.0.0.100) by mail.codesourcery.com with SMTP; 27 Jul 2007 19:32:22 -0000 Received: by gateway (Postfix, from userid 1010) id 3188E6C091; Fri, 27 Jul 2007 12:32:22 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard@codesourcery.com Subject: [committed] Define __mips_dsp_rev Date: Fri, 27 Jul 2007 19:42:00 -0000 Message-ID: <87odhxlk1m.fsf@firetop.home> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg02008.txt.bz2 At Thiemo's request, I've added a __mips_dsp_rev macro that specifies the revision number of the ASE. -mdspr2 has been in mainline for a few months now, so I think we should keep the original __mips_dspr2 macro too. Tested on mipsisa64-elf. Applied to trunk. Richard gcc/ * doc/invoke.texi (mdsp, mdspr2): Document the __mips_dsp, __mips_dspr2 and __mips_dsp_rev macros. * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Define __mips_dsp_rev. Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 126993) +++ gcc/doc/invoke.texi (working copy) @@ -11658,14 +11658,19 @@ operations. This is the default. @itemx -mno-dsp @opindex mdsp @opindex mno-dsp -Use (do not use) the MIPS DSP ASE. @xref{MIPS DSP Built-in Functions}. +Use (do not use) revision 1 of the MIPS DSP ASE. +@xref{MIPS DSP Built-in Functions}. This option defines the +preprocessor macro @samp{__mips_dsp}. It also defines +@samp{__mips_dsp_rev} to 1. @item -mdspr2 @itemx -mno-dspr2 @opindex mdspr2 @opindex mno-dspr2 -Use (do not use) the MIPS DSP ASE REV 2. @xref{MIPS DSP Built-in Functions}. -The option @option{-mdspr2} implies @option{-mdsp}. +Use (do not use) revision 2 of the MIPS DSP ASE. +@xref{MIPS DSP Built-in Functions}. This option defines the +preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}. +It also defines @samp{__mips_dsp_rev} to 2. @item -msmartmips @itemx -mno-smartmips Index: gcc/config/mips/mips.h =================================================================== --- gcc/config/mips/mips.h (revision 126993) +++ gcc/config/mips/mips.h (working copy) @@ -378,10 +378,16 @@ #define TARGET_CPU_CPP_BUILTINS() \ builtin_define ("__mips_smartmips"); \ \ if (TARGET_DSP) \ - builtin_define ("__mips_dsp"); \ - \ - if (TARGET_DSPR2) \ - builtin_define ("__mips_dspr2"); \ + { \ + builtin_define ("__mips_dsp"); \ + if (TARGET_DSPR2) \ + { \ + builtin_define ("__mips_dspr2"); \ + builtin_define ("__mips_dsp_rev=2"); \ + } \ + else \ + builtin_define ("__mips_dsp_rev=1"); \ + } \ \ MIPS_CPP_SET_PROCESSOR ("_MIPS_ARCH", mips_arch_info); \ MIPS_CPP_SET_PROCESSOR ("_MIPS_TUNE", mips_tune_info); \