public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Walter Lee <walt@tilera.com>
To: <gcc-patches@gcc.gnu.org>
Subject: [PATCH] New port for TILEPro and TILE-Gx: 6/7 libgomp port
Date: Sat, 15 Oct 2011 13:31:00 -0000	[thread overview]
Message-ID: <4E996585.6090805@tilera.com> (raw)
In-Reply-To: <4E996398.2000507@tilera.com>

[-- Attachment #1: Type: text/plain, Size: 113 bytes --]

Here is the libgomp port.

	* configure.tgt: Handle tilegx and tilepro.
	* config/linux/tile/futex.h: New file.


[-- Attachment #2: libgomp.diff --]
[-- Type: text/plain, Size: 3148 bytes --]

diff -r -u -p -N /home/packages/gcc-4.7.0-179959/libgomp/config/linux/tile/futex.h ./libgomp/config/linux/tile/futex.h
--- /home/packages/gcc-4.7.0-179959/libgomp/config/linux/tile/futex.h	1969-12-31 19:00:00.000000000 -0500
+++ ./libgomp/config/linux/tile/futex.h	2011-10-14 18:14:11.657740000 -0400
@@ -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
+   <http://www.gnu.org/licenses/>.  */
+
+/* Provide target-specific access to the futex system call.  */
+
+#include <sys/syscall.h>
+#include <linux/futex.h>
+
+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-179959/libgomp/configure.tgt ./libgomp/configure.tgt
--- /home/packages/gcc-4.7.0-179959/libgomp/configure.tgt	2011-10-14 00:46:46.000000000 -0400
+++ ./libgomp/configure.tgt	2011-10-14 18:14:11.167723000 -0400
@@ -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"

  parent reply	other threads:[~2011-10-15 10:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-15 10:49 New port for TILEPro and TILE-Gx Walter Lee
2011-10-15 10:51 ` [PATCH] New port for TILEPro and TILE-Gx 1/7: toplevel changes Walter Lee
2011-10-15 10:51 ` [PATCH] New port for TILEPro and TILE-Gx 2/7: changes in contrib Walter Lee
2011-10-20 17:11   ` Walter Lee
2011-10-15 11:09 ` [PATCH] New port for TILEPro and TILE-Gx 3/7: gcc port Walter Lee
2011-10-15 18:33   ` Joseph S. Myers
2011-10-20 16:40     ` Walter Lee
2011-10-20 20:55       ` Joseph S. Myers
2011-10-23 10:23         ` Walter Lee
2011-10-15 11:36 ` [PATCH] New port for TILEPro and TILE-Gx 4/7: libcpp port Walter Lee
2011-10-15 12:04 ` [PATCH] New port for TILEPro and TILE-Gx: 5/7 libgcc port Walter Lee
2011-10-15 19:00   ` Joseph S. Myers
2011-10-20 17:29     ` Walter Lee
2011-10-23 11:25       ` Walter Lee
2011-10-15 13:31 ` Walter Lee [this message]
2011-10-15 14:25 ` [PATCH] New port for TILEPro and TILE-Gx: 7/7 wwwdocs changes Walter Lee
2011-10-16 18:51   ` Gerald Pfeifer
2011-10-30 17:14 ` [PING] New port for TILEPro and TILE-Gx Walter Lee
2011-11-07 17:03   ` [PING2] " Walter Lee
2011-11-07 22:27     ` Richard Henderson
2011-11-07 23:56       ` Walter Lee
2011-11-08 19:47         ` [PING2] New port for TILEPro Richard Henderson
2011-11-08 21:30         ` [PING2] New port for ... TILE-Gx Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E996585.6090805@tilera.com \
    --to=walt@tilera.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).