From patchwork Thu Jul 28 19:32:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 107298 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 30308B6F69 for ; Fri, 29 Jul 2011 05:32:36 +1000 (EST) Received: (qmail 23203 invoked by alias); 28 Jul 2011 19:32:32 -0000 Received: (qmail 23031 invoked by uid 22791); 28 Jul 2011 19:32:30 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, RP_MATCHES_RCVD, TW_FN X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Jul 2011 19:32:15 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 28 Jul 2011 12:32:15 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by azsmga001.ch.intel.com with ESMTP; 28 Jul 2011 12:32:14 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 58F69C2600; Thu, 28 Jul 2011 12:32:26 -0700 (PDT) Date: Thu, 28 Jul 2011 12:32:26 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: jakub@redhat.com Subject: PATCH: Add x32 support to libgomp Message-ID: <20110728193226.GA7809@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi, This patch fixes 2 issues in libgomp for x32: 1. x32 should use the same futex functions as x86-64. 2. IA32 tests should check ia32 instead of ilp32. OK for trunk? Thanks. H.J. --- 2011-07-28 H.J. Lu * config/linux/x86/futex.h: Check __x86_64__ instead of __LP64__. * testsuite/lib/libgomp.exp (libgomp_init): Add -march=i486 for ia32 instead of ilp32. * testsuite/libgomp.c/atomic-1.c: Require ia32 instead of ilp32. * testsuite/libgomp.c/atomic-6.c: Likewise. diff --git a/libgomp/config/linux/x86/futex.h b/libgomp/config/linux/x86/futex.h index cb7461d..419f4d9 100644 --- a/libgomp/config/linux/x86/futex.h +++ b/libgomp/config/linux/x86/futex.h @@ -24,7 +24,7 @@ /* Provide target-specific access to the futex system call. */ -#ifdef __LP64__ +#ifdef __x86_64__ # ifndef SYS_futex # define SYS_futex 202 # endif @@ -138,7 +138,7 @@ futex_wake (int *addr, int count) } } -#endif /* __LP64__ */ +#endif /* __x86_64__ */ static inline void cpu_relax (void) diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 976543d..a75e22f 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -140,7 +140,7 @@ proc libgomp_init { args } { # We use atomic operations in the testcases to validate results. if { ([istarget i?86-*-*] || [istarget x86_64-*-*]) - && [check_effective_target_ilp32] } { + && [check_effective_target_ia32] } { lappend ALWAYS_CFLAGS "additional_flags=-march=i486" } diff --git a/libgomp/testsuite/libgomp.c/atomic-1.c b/libgomp/testsuite/libgomp.c/atomic-1.c index b2be8f0..4725b7d 100644 --- a/libgomp/testsuite/libgomp.c/atomic-1.c +++ b/libgomp/testsuite/libgomp.c/atomic-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O2 -march=pentium" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ +/* { dg-options "-O2 -march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ #ifdef __i386__ #include "cpuid.h" diff --git a/libgomp/testsuite/libgomp.c/atomic-6.c b/libgomp/testsuite/libgomp.c/atomic-6.c index 59baf7d..f8ab75e 100644 --- a/libgomp/testsuite/libgomp.c/atomic-6.c +++ b/libgomp/testsuite/libgomp.c/atomic-6.c @@ -1,7 +1,7 @@ /* PR middle-end/36106 */ /* { dg-options "-O2" } */ /* { dg-options "-O2 -mieee" { target alpha*-*-* } } */ -/* { dg-options "-O2 -march=i586" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ +/* { dg-options "-O2 -march=i586" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ #ifdef __i386__ # include "cpuid.h"