From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13579 invoked by alias); 28 Oct 2011 04:08:23 -0000 Received: (qmail 13391 invoked by uid 22791); 28 Oct 2011 04:08:20 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Oct 2011 04:07:55 +0000 Received: by gyc15 with SMTP id 15so3770451gyc.20 for ; Thu, 27 Oct 2011 21:07:54 -0700 (PDT) Received: by 10.236.136.129 with SMTP id w1mr787054yhi.118.1319774874551; Thu, 27 Oct 2011 21:07:54 -0700 (PDT) Received: from localhost.localdomain (c-98-203-235-125.hsd1.wa.comcast.net. [98.203.235.125]) by mx.google.com with ESMTPS id j25sm10849016yhm.12.2011.10.27.21.07.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Oct 2011 21:07:54 -0700 (PDT) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: amacleod@redhat.com Subject: [PATCH 6/9] Update cppbuiltins for atomic-compare-and-swap. Date: Fri, 28 Oct 2011 05:11:00 -0000 Message-Id: <1319774858-9181-7-git-send-email-rth@redhat.com> In-Reply-To: <1319774858-9181-1-git-send-email-rth@redhat.com> References: <1319774858-9181-1-git-send-email-rth@redhat.com> X-IsSubscribed: yes 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: 2011-10/txt/msg02608.txt.bz2 --- gcc/c-family/c-cppbuiltin.c | 50 ++++++++++++++++++++++++++++++------------- 1 files changed, 35 insertions(+), 15 deletions(-) diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index bb9893a..bf83c26 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -758,30 +758,50 @@ c_cpp_builtins (cpp_reader *pfile) /* Tell source code if the compiler makes sync_compare_and_swap builtins available. */ -#ifdef HAVE_sync_compare_and_swapqi - if (HAVE_sync_compare_and_swapqi) - cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"); +#ifndef HAVE_sync_compare_and_swapqi +#define HAVE_sync_compare_and_swapqi 0 +#endif +#ifndef HAVE_atomic_compare_and_swapqi +#define HAVE_atomic_compare_and_swapqi 0 #endif + if (HAVE_sync_compare_and_swapqi || HAVE_atomic_compare_and_swapqi) + cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"); -#ifdef HAVE_sync_compare_and_swaphi - if (HAVE_sync_compare_and_swaphi) - cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"); +#ifndef HAVE_sync_compare_and_swaphi +#define HAVE_sync_compare_and_swaphi 0 #endif +#ifndef HAVE_atomic_compare_and_swaphi +#define HAVE_atomic_compare_and_swaphi 0 +#endif + if (HAVE_sync_compare_and_swaphi || HAVE_atomic_compare_and_swaphi) + cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"); -#ifdef HAVE_sync_compare_and_swapsi - if (HAVE_sync_compare_and_swapsi) - cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"); +#ifndef HAVE_sync_compare_and_swapsi +#define HAVE_sync_compare_and_swapsi 0 +#endif +#ifndef HAVE_atomic_compare_and_swapsi +#define HAVE_atomic_compare_and_swapsi 0 #endif + if (HAVE_sync_compare_and_swapsi || HAVE_atomic_compare_and_swapsi) + cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"); -#ifdef HAVE_sync_compare_and_swapdi - if (HAVE_sync_compare_and_swapdi) - cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); +#ifndef HAVE_sync_compare_and_swapdi +#define HAVE_sync_compare_and_swapdi 0 #endif +#ifndef HAVE_atomic_compare_and_swapdi +#define HAVE_atomic_compare_and_swapdi 0 +#endif + if (HAVE_sync_compare_and_swapdi || HAVE_atomic_compare_and_swapdi) + cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); -#ifdef HAVE_sync_compare_and_swapti - if (HAVE_sync_compare_and_swapti) - cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16"); +#ifndef HAVE_sync_compare_and_swapti +#define HAVE_sync_compare_and_swapti 0 +#endif +#ifndef HAVE_atomic_compare_and_swapti +#define HAVE_atomic_compare_and_swapti 0 #endif + if (HAVE_sync_compare_and_swapti || HAVE_atomic_compare_and_swapti) + cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16"); #ifdef DWARF2_UNWIND_INFO if (dwarf2out_do_cfi_asm ()) -- 1.7.6.4