From patchwork Sat Dec 31 00:44:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walter Lee X-Patchwork-Id: 133709 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 7E536B6FA2 for ; Sat, 31 Dec 2011 11:44:50 +1100 (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=1325897091; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=nGIBzSY9gSOwISctCrNMSHYAK7s=; b=s84gZL44WVpVqhV TwMjtUVmZNa1ShgG5woI/iY2hRqrNPde/ITk+w0T2Q9ltvpQD2eep2RXjbvuXSuf UyRce7DyYr7Dzh7RLj8rXvXFQS2sKIdiVIeEWMXI9/+7wK0gQ3HKTGG3DonoOAn9 NhYxg1neuFOROxbLH4YdLyAp3G6M= 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:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=vZHQ/pDNpQGVM2cS2hyTA4MpyKCoQxeLS6k84gNUl+WryxB7objayxvm/UTHbe P9vguWPOGHstkhSVKntOEtTqE4HgV8cGshzIVW9CTj+mb2gP3bAIgcoa/aJTYDqz Xk1Cm/z0uqgGycxbQliqDD2MwUamhv17sHRy1Bpt3K99o=; Received: (qmail 26517 invoked by alias); 31 Dec 2011 00:44:47 -0000 Received: (qmail 26509 invoked by uid 22791); 31 Dec 2011 00:44:47 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_EG X-Spam-Check-By: sourceware.org Received: from usmamail.tilera.com (HELO USMAMAIL.TILERA.COM) (206.83.70.75) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 31 Dec 2011 00:44:33 +0000 Received: from [192.168.1.48] (98.229.97.107) by USMAExch2.tad.internal.tilera.com (10.3.0.33) with Microsoft SMTP Server id 14.0.694.0; Fri, 30 Dec 2011 19:44:32 -0500 Message-ID: <4EFE5AF4.7080309@tilera.com> Date: Fri, 30 Dec 2011 19:44:36 -0500 From: Walter Lee User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Subject: [PATCH] New port resubmission for TILEPro and TILE-Gx 6/6: libgomp port References: <4EFE57A3.3070003@tilera.com> In-Reply-To: <4EFE57A3.3070003@tilera.com> 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 Here is the libgomp port. 2011-12-30 Walter Lee * configure.tgt: Handle tilegx and tilepro. * config/linux/tile/futex.h: New file. diff -r -u -p -N /home/packages/gcc-4.7.0-182680/libgomp/config/linux/tile/futex.h ./libgomp/config/linux/tile/futex.h --- /home/packages/gcc-4.7.0-182680/libgomp/config/linux/tile/futex.h 1969-12-31 19:00:00.000000000 -0500 +++ ./libgomp/config/linux/tile/futex.h 2011-12-29 22:06:53.524965000 -0500 @@ -0,0 +1,73 @@ +/* Copyright (C) 2011 + Free Software Foundation, Inc. + Contributed by Walter Lee (walt@tilera.com) + + This file is part of the GNU OpenMP Library (libgomp). + + Libgomp is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +/* Provide target-specific access to the futex system call. */ + +#include +#include + +static inline void +sys_futex0 (int *addr, int op, int val) +{ + long _sys_result; + long _clobber_r2, _clobber_r3, _clobber_r4, _clobber_r5, _clobber_r10; + int err; + + __asm__ __volatile__ ( + "swint1" + : "=R00" (_sys_result), "=R01" (err), "=R02" (_clobber_r2), + "=R03" (_clobber_r3), "=R04" (_clobber_r4), "=R05" (_clobber_r5), + "=R10" (_clobber_r10) + : "R10" (SYS_futex), "R00" (addr), "R01" (op), "R02" (val), + "R03" (0) + : "r6", "r7", + "r8", "r9", "r11", "r12", "r13", "r14", "r15", + "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", + "r24", "r25", "r26", "r27", "r28", "r29", "memory"); +} + +static inline void +futex_wait (int *addr, int val) +{ + sys_futex0 (addr, FUTEX_WAIT, val); +} + +static inline void +futex_wake (int *addr, int count) +{ + sys_futex0 (addr, FUTEX_WAKE, count); +} + +static inline void +cpu_relax (void) +{ + __asm volatile ("" : : : "memory"); +} + +static inline void +atomic_write_barrier (void) +{ + __sync_synchronize (); +} diff -r -u -p -N /home/packages/gcc-4.7.0-182680/libgomp/configure.tgt ./libgomp/configure.tgt --- /home/packages/gcc-4.7.0-182680/libgomp/configure.tgt 2011-10-14 00:46:46.000000000 -0400 +++ ./libgomp/configure.tgt 2011-12-29 22:06:48.781929000 -0500 @@ -51,6 +51,10 @@ if test $enable_linux_futex = yes; then config_path="linux/s390 linux posix" ;; + tile*-*-linux*) + config_path="linux/tile linux posix" + ;; + # Note that bare i386 is not included here. We need cmpxchg. i[456]86-*-linux*) config_path="linux/x86 linux posix"