===================================================================
@@ -0,0 +1,66 @@
+/* upc-crtstuff.c: UPC specific "C Runtime Support"
+ Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ Contributed by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>.
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "upc-crt-config.h"
+#include "upc-crt-begin-end.h"
+
+/* Only define section start/end if no link script is used. */
+
+#ifdef CRT_BEGIN
+
+/* Shared begin is always defined in order to allocate space
+ at the beginning of the section. */
+#ifdef UPC_SHARED_SECTION_BEGIN
+/* Establish a symbol at the beginning of the data section. */
+UPC_SHARED_SECTION_BEGIN
+#endif /* UPC_SHARED_SECTION_BEGIN */
+
+#ifndef HAVE_UPC_LINK_SCRIPT
+#ifdef UPC_PGM_INFO_SECTION_BEGIN
+/* Establish a symbol at the beginning of the program info data section. */
+UPC_PGM_INFO_SECTION_BEGIN
+#endif /* UPC_PGM_INFO_SECTION_BEGIN */
+#ifdef UPC_INIT_ARRAY_SECTION_BEGIN
+/* Establish a symbol at the beginning of the initialization array section. */
+UPC_INIT_ARRAY_SECTION_BEGIN
+#endif /* UPC_INIT_ARRAY_SECTION_BEGIN */
+#endif /* !HAVE_UPC_LINK_SCRIPT */
+
+#elif defined(CRT_END) /* ! CRT_BEGIN */
+
+#ifndef HAVE_UPC_LINK_SCRIPT
+#ifdef UPC_SHARED_SECTION_END
+/* Establish a symbol at the end of the shared data section. */
+UPC_SHARED_SECTION_END
+#endif /* UPC_SHARED_SECTION_END */
+#ifdef UPC_PGM_INFO_SECTION_END
+/* Establish a symbol at the end of the program info data section. */
+UPC_PGM_INFO_SECTION_END
+#endif /* UPC_PGM_INFO_SECTION_END */
+#ifdef UPC_INIT_ARRAY_SECTION_END
+/* Establish a symbol at the end of the initialization array section. */
+UPC_INIT_ARRAY_SECTION_END
+#endif /* UPC_INIT_ARRAY_SECTION_END */
+#endif /* !HAVE_UPC_LINK_SCRIPT */
+#else /* ! CRT_BEGIN && ! CRT_END */
+#error "One of CRT_BEGIN or CRT_END must be defined."
+#endif
===================================================================
@@ -0,0 +1,72 @@
+/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+
+#ifndef _GASP_H_
+#define _GASP_H_
+
+#include <stdarg.h>
+
+/* See GASP Specification (version 1.5)
+ http://gasp.hcs.ufl.edu/gasp-1.5-61606.pdf */
+
+#define GASP_VERSION 20060914
+
+typedef enum
+{
+ GASP_MODEL_UPC,
+ GASP_MODEL_TITANIUM,
+ GASP_MODEL_CAF,
+ GASP_MODEL_MPI,
+ GASP_MODEL_SHMEM
+} gasp_model_t;
+
+typedef enum
+{
+ GASP_START,
+ GASP_END,
+ GASP_ATOMIC,
+} gasp_evttype_t;
+
+struct _gasp_context_S;
+typedef struct _gasp_context_S *gasp_context_t;
+
+gasp_context_t gasp_init (gasp_model_t srcmodel, int *argc, char ***argv);
+
+void gasp_event_notify (gasp_context_t context, unsigned int evttag,
+ gasp_evttype_t evttype, const char *filename,
+ int linenum, int colnum, ...);
+
+void gasp_event_notifyVA (gasp_context_t context, unsigned int evttag,
+ gasp_evttype_t evttype, const char *filename,
+ int linenum, int colnum, va_list varargs);
+
+int gasp_control (gasp_context_t context, int on);
+
+unsigned int gasp_create_event (gasp_context_t context,
+ const char *name, const char *desc);
+
+#endif /* _GASP_H_ */
===================================================================
@@ -0,0 +1,224 @@
+/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+
+#ifndef _GASP_UPC_H_
+#define _GASP_UPC_H_
+
+/* See GASP Specification (version 1.5)
+ http://gasp.hcs.ufl.edu/gasp-1.5-61606.pdf. */
+
+#define GASP_UPC_VERSION 40302
+
+/* Opaque types. */
+typedef void gasp_upc_PTS_t;
+typedef void gasp_upc_lock_t;
+typedef void *gasp_upc_nb_handle_t;
+
+/* Indicate that a non-blocking get/put shouldn't be tracked. */
+#define GASP_NB_TRIVIAL ((gasp_upc_nb_handle_t) 0)
+
+/* Reduction operation data types. */
+typedef enum
+{
+ GASP_UPC_REDUCTION_C,
+ GASP_UPC_REDUCTION_UC,
+ GASP_UPC_REDUCTION_S,
+ GASP_UPC_REDUCTION_US,
+ GASP_UPC_REDUCTION_I,
+ GASP_UPC_REDUCTION_UI,
+ GASP_UPC_REDUCTION_L,
+ GASP_UPC_REDUCTION_UL,
+ GASP_UPC_REDUCTION_F,
+ GASP_UPC_REDUCTION_D,
+ GASP_UPC_REDUCTION_LD
+} gasp_upc_reduction_t;
+
+/*
+
+ GASP events defined in the specification document.
+
+ Symbolic name Event type vararg arguments
+ =================================================
+ GASP_C_FUNC Start,End const char *funcsig
+ GASP_C_MALLOC Start,End size_t nbytes
+ GASP_C_REALLOC Start,End void *ptr, size_t size
+ GASP_C_FREE Start,End void *ptr
+ GASP_UPC_COLLECTIVE_EXIT Start,End int status
+ GASP_UPC_NONCOLLECTIVE_EXIT Atomic int status
+ GASP_UPC_NOTIFY Start,End int named, int expr
+ GASP_UPC_WAIT Start,End int named, int expr
+ GASP_UPC_BARRIER Start,End int named, int expr
+ GASP_UPC_FENCE Start,End (none)
+ GASP_UPC_FORALL Start,End (none)
+ GASP_UPC_GLOBAL_ALLOC Start size_t nblocks, size_t nbytes
+ GASP_UPC_GLOBAL_ALLOC End size_t nblocks, size_t nbytes,
+ gasp_upc_PTS_t *newshrd_ptr
+ GASP_UPC_ALL_ALLOC Start size_t nblocks, size_t nbytes
+ GASP_UPC_ALL_ALLOC End size_t nblocks, size_t nbytes,
+ gasp_upc_PTS_t *newshrd_ptr
+ GASP_UPC_ALLOC Start size_t nbytes
+ GASP_UPC_ALLOC End size_t nbytes,
+ gasp_upc_PTS_t *newshrd_ptr
+ GASP_UPC_FREE Start,End gasp_upc_PTS_t *shrd_ptr
+ GASP_UPC_GLOBAL_LOCK_ALLOC Start (none)
+ GASP_UPC_GLOBAL_LOCK_ALLOC End gasp_upc_lock_t *lck
+ GASP_UPC_ALL_LOCK_ALLOC Start (none)
+ GASP_UPC_ALL_LOCK_ALLOC End gasp_upc_lock_t *lck
+ GASP_UPC_LOCK_FREE Start,End gasp_upc_lock_t *lck
+ GASP_UPC_LOCK Start,End gasp_upc_lock_t *lck
+ GASP_UPC_LOCK_ATTEMPT Start gasp_upc_lock_t *lck
+ GASP_UPC_LOCK_ATTEMPT End gasp_upc_lock_t *lck, int result
+ GASP_UPC_UNLOCK Start,End gasp_upc_lock_t *lck
+ GASP_UPC_MEMCPY Start,End gasp_upc_PTS_t *dst,
+ gasp_upc_PTS_t *src, size_t n
+ GASP_UPC_MEMGET Start,End void *dst, gasp_upc_PTS_t *src,
+ size_t n
+ GASP_UPC_MEMPUT Start,End gasp_upc_PTS_t *dst, void *src,
+ size_t n
+ GASP_UPC_MEMSET Start,End gasp_upc_PTS_t *dst, int c,
+ size_t n
+ GASP_UPC_GET Start,End int is_relaxed, void *dst,
+ gasp_upc_PTS_t *src, size_t n
+ GASP_UPC_PUT Start,End int is_relaxed,
+ gasp_upc_PTS_t *dst,
+ void *src, size_t n
+ GASP_UPC_NB_GET_INIT Start int is_relaxed, void *dst,
+ gasp_upc_PTS_t *src, size_t n
+ GASP_UPC_NB_GET_INIT End int is_relaxed, void *dst,
+ gasp_upc_PTS_t *src,
+ size_t n,
+ gasp_upc_nb_handle_t handle
+ GASP_UPC_NB_GET_DATA Start,End gasp_upc_nb_handle_t handle
+ GASP_UPC_NB_PUT_INIT Start int is_relaxed, gasp_upc_PTS_t *dst,
+ void *src, size_t n
+ GASP_UPC_NB_PUT_INIT End int is_relaxed, gasp_upc_PTS_t *dst,
+ void *src, size_t n,
+ gasp_upc_nb_handle_t handle
+ GASP_UPC_NB_PUT_DATA Start,End gasp_upc_nb_handle_t handle
+ GASP_UPC_NB_SYNC Start,End gasp_upc_nb_handle_t handle
+ GASP_UPC_CACHE_MISS Atomic size_t n, size_t n_lines
+ GASP_UPC_CACHE_HIT Atomic size_t n
+ GASP_UPC_CACHE_INVALIDATE Atomic size_t n_dirty
+ GASP_UPC_ALL_BROADCAST Start,End gasp_upc_PTS_t *dst,
+ gasp_upc_PTS_t *src,
+ size_t nbytes, int upc_flags
+ GASP_UPC_ALL_SCATTER Start,End gasp_upc_PTS_t *dst,
+ gasp_upc_PTS_t *src,
+ size_t nbytes, int upc_flags
+ GASP_UPC_ALL_GATHER Start,End gasp_upc_PTS_t *dst,
+ gasp_upc_PTS_t *src,
+ size_t nbytes, int upc_flags
+ GASP_UPC_ALL_GATHER_ALL Start,End gasp_upc_PTS_t *dst,
+ gasp_upc_PTS_t *src,
+ size_t nbytes, int upc_flags
+ GASP_UPC_ALL_EXCHANGE Start,End gasp_upc_PTS_t *dst,
+ gasp_upc_PTS_t *src,
+ size_t nbytes, int upc_flags
+ GASP_UPC_ALL_PERMUTE Start,End gasp_upc_PTS_t *dst,
+ gasp_upc_PTS_t *src,
+ gasp_upc_PTS_t *perm, size_t nbytes,
+ int upc_flags
+ GASP_UPC_ALL_REDUCE Start,End gasp_upc_PTS_t *dst,
+ gasp_upc_PTS_t *src,
+ int upc_op, size_t nelems,
+ size_t blk_size,
+ void *func, int upc_flags,
+ gasp_upc_reduction_t type
+ GASP_UPC_ALL_PREFIX_REDUCE Start,End gasp_upc_PTS_t *dst,
+ gasp_upc_PTS_t *src, int upc_op,
+ size_t nelems, size_t blk_size,
+ void *func, int upc_flags,
+ gasp_upc_reduction_t type
+ GASP_UPC_USEREVT_START First User-defined event
+ GASP_UPC_USEREVT_END Last User-defined event
+*/
+
+/* These might some day be set as configured items. */
+#undef GASP_C_MALLOC_SUPPORTED
+#undef GASP_UPC_FENCE_SUPPORTED
+#undef GASP_UPC_NB_SUPPORTED
+#undef GASP_UPC_CACHE_SUPPORTED
+#undef GASP_UPC_ALL_SUPPORTED
+
+#define GASP_UPC_EVT_NONE 0
+#define GASP_C_FUNC 1
+#ifdef GASP_C_MALLOC_SUPPORTED
+#define GASP_C_MALLOC 2
+#define GASP_C_REALLOC 3
+#define GASP_C_FREE 4
+#endif /* GASP_C_MALLOC_SUPPORTED */
+#define GASP_UPC_COLLECTIVE_EXIT 5
+#define GASP_UPC_NONCOLLECTIVE_EXIT 6
+#define GASP_UPC_NOTIFY 7
+#define GASP_UPC_WAIT 8
+#define GASP_UPC_BARRIER 9
+#ifdef GASP_UPC_FENCE_SUPPORTED
+#define GASP_UPC_FENCE 10
+#endif /* GASP_UPC_FENCE_SUPPORTED */
+#define GASP_UPC_FORALL 11
+#define GASP_UPC_GLOBAL_ALLOC 12
+#define GASP_UPC_ALL_ALLOC 13
+#define GASP_UPC_ALLOC 14
+#define GASP_UPC_FREE 15
+#define GASP_UPC_GLOBAL_LOCK_ALLOC 16
+#define GASP_UPC_ALL_LOCK_ALLOC 17
+#define GASP_UPC_LOCK_FREE 18
+#define GASP_UPC_LOCK 19
+#define GASP_UPC_LOCK_ATTEMPT 20
+#define GASP_UPC_UNLOCK 21
+#define GASP_UPC_MEMCPY 22
+#define GASP_UPC_MEMGET 23
+#define GASP_UPC_MEMPUT 24
+#define GASP_UPC_MEMSET 25
+#define GASP_UPC_GET 26
+#define GASP_UPC_PUT 27
+#ifdef GASP_UPC_NB_SUPPORTED
+#define GASP_UPC_NB_GET_INIT 28
+#define GASP_UPC_NB_GET_DATA 29
+#define GASP_UPC_NB_PUT_INIT 30
+#define GASP_UPC_NB_PUT_DATA 31
+#define GASP_UPC_NB_SYNC 32
+#endif /* GASP_UPC_NB_SUPPORTED */
+#if GASP_UPC_CACHE_SUPPORTED
+#define GASP_UPC_CACHE_MISS 33
+#define GASP_UPC_CACHE_HIT 34
+#define GASP_UPC_CACHE_INVALIDATE 35
+#endif /* GASP_UPC_CACHE_SUPPORTED */
+#ifdef GASP_UPC_ALL_SUPPORTED
+#define GASP_UPC_ALL_BROADCAST 36
+#define GASP_UPC_ALL_SCATTER 37
+#define GASP_UPC_ALL_GATHER 38
+#define GASP_UPC_ALL_GATHER_ALL 39
+#define GASP_UPC_ALL_EXCHANGE 40
+#define GASP_UPC_ALL_PERMUTE 41
+#define GASP_UPC_ALL_REDUCE 42
+#define GASP_UPC_ALL_PREFIX_REDUCE 43
+#endif /* GASP_UPC_ALL_SUPPORTED */
+#define GASP_UPC_USEREVT_START 1000
+#define GASP_UPC_USEREVT_END 1999
+
+#endif /* _GASP_UPC_H_ */
===================================================================
@@ -0,0 +1,54 @@
+/* Copyright (C) 2005-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+
+#ifndef _GCC_UPC_H_
+#define _GCC_UPC_H_
+
+#ifndef NO_GCC_UPC_LIB
+/* Include the runtime API. */
+#include <gcc-upc-lib.h>
+#endif
+
+#pragma upc upc_code
+
+/* upc_lock_t is an opaque shared type. */
+typedef shared struct upc_lock_struct upc_lock_t;
+
+#ifndef upc_poll
+/* For now upc_poll is a no-op. */
+#define upc_poll()
+#endif
+
+#ifdef __UPC_USES_PTHREADS__
+/* Pthreads implementation uses per thread random seed. */
+#define rand __upc_rand
+#define srand __upc_srand
+extern int __upc_rand (void);
+extern void __upc_srand (unsigned int seed);
+#endif
+
+#endif /* !_GCC_UPC_H_ */
===================================================================
@@ -0,0 +1,70 @@
+/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+
+#ifndef _PUPC_H_
+#define _PUPC_H_
+
+/* See GASP Specification (version 1.5)
+ http://gasp.hcs.ufl.edu/gasp-1.5-61606.pdf. */
+
+#if __UPC_PUPC__
+extern int pupc_control (int on);
+extern unsigned int pupc_create_event (const char *name, const char *desc);
+#else
+#define pupc_control(on) 0
+#define pupc_create_event(name, desc) 0
+#endif
+
+#if __UPC_PUPC__ && __UPC_PUPC_INST__
+extern void pupc_event_startg
+ (unsigned int evttag, const char *file, int line, ...);
+extern void pupc_event_endg
+ (unsigned int evttag, const char *file, int line, ...);
+extern void pupc_event_atomicg
+ (unsigned int evttag, const char *file, int line, ...);
+#define pupc_event_start(evttag, args...) \
+ pupc_event_startg (evttag, __FILE__, __LINE__, args)
+#define pupc_event_end(evttag, args...) \
+ pupc_event_endg (evttag, __FILE__, __LINE__, args)
+#define pupc_event_atomic(evttag, args...) \
+ pupc_event_atomicg (evttag, __FILE__, __LINE__, args)
+#else
+#define pupc_event_start(evttag, args...)
+#define pupc_event_end(evttag, args...)
+#define pupc_event_atomic(evttag, args...)
+#endif
+
+#ifndef pupc_event_start
+/* These prototypes won't be compiled, because the
+ macro definitions above will over-ride them.
+ The prototypes are here for documentation purposes only. */
+extern void pupc_event_start (unsigned int evttag, ...);
+extern void pupc_event_end (unsigned int evttag, ...);
+extern void pupc_event_atomic (unsigned int evttag, ...);
+#endif
+
+#endif /* _PUPC_H_ */
===================================================================
@@ -0,0 +1,131 @@
+/* Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime Library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+#ifndef _UPC_H_
+#define _UPC_H_
+
+/* Required, to define size_t. */
+#include <sys/types.h>
+
+extern size_t upc_threadof (shared void *);
+extern size_t upc_phaseof (shared void *);
+extern shared void *upc_resetphase (shared void *);
+extern size_t upc_addrfield (shared void *);
+extern size_t upc_affinitysize (size_t, size_t, size_t);
+
+#if IN_TARGET_LIBS || __UPC_PUPC_INST__
+/* Profiled memory allocation routines. */
+extern shared void *upc_global_allocg (size_t, size_t, const char *, int);
+extern shared void *upc_all_allocg (size_t, size_t, const char *, int);
+extern shared void *upc_allocg (size_t, const char *, int);
+extern void upc_freeg (shared void *, const char *, int);
+extern void upc_all_freeg (shared void *, const char *, int);
+#endif /* IN_TARGET_LIBS || __UPC_PUPC_INST__ */
+
+#ifdef __UPC_PUPC_INST__
+
+/* Profiled UPC library functions. */
+
+extern void upc_global_exitg (int, const char *, int);
+extern upc_lock_t *upc_global_lock_allocg (const char *, int);
+extern upc_lock_t *upc_all_lock_allocg (const char *, int);
+extern void upc_lockg (upc_lock_t *, const char *, int);
+extern int upc_lock_attemptg (upc_lock_t *, const char *, int);
+extern void upc_unlockg (upc_lock_t *, const char *, int);
+extern void upc_lock_freeg (upc_lock_t *, const char *, int);
+extern void upc_all_lock_freeg (upc_lock_t *, const char *, int);
+extern void upc_memcpyg (shared void *, shared const void *,
+ size_t, const char *, int);
+extern void upc_memgetg (void *, shared const void *,
+ size_t, const char *, int);
+extern void upc_memputg (shared void *, const void *,
+ size_t, const char *, int);
+extern void upc_memsetg (shared void *, int, size_t, const char *, int);
+
+/* The following functions are not profiled, but when -fupc-debug
+ is asserted will be called with the additional file and line
+ arguments. */
+extern size_t upc_threadofg (shared void *, const char *, int);
+extern size_t upc_phaseofg (shared void *, const char *, int);
+extern shared void *upc_resetphaseg (shared void *, const char *, int);
+extern size_t upc_addrfieldg (shared void *, const char *, int);
+extern size_t upc_affinitysizeg (size_t, size_t, size_t, const char *, int);
+
+#define upc_all_alloc(n, b) upc_all_allocg(n, b, __FILE__, __LINE__)
+#define upc_all_lock_alloc() upc_all_lock_allocg(__FILE__, __LINE__)
+#define upc_alloc(n) upc_allocg(n, __FILE__, __LINE__)
+#define upc_free(ptr) upc_freeg(ptr, __FILE__, __LINE__)
+#define upc_all_free(ptr) upc_all_freeg(ptr, __FILE__, __LINE__)
+#define upc_global_exit(n) upc_global_exitg(n, __FILE__, __LINE__)
+#define upc_global_alloc(n, b) upc_global_allocg(n, b, __FILE__, __LINE__)
+#define upc_global_lock_alloc() upc_global_lock_allocg(__FILE__, __LINE__)
+#define upc_lock_attempt(lck) upc_lock_attemptg(lck, __FILE__, __LINE__)
+#define upc_lock_free(lck) upc_lock_freeg(lck, __FILE__, __LINE__)
+#define upc_all_lock_free(lck) upc_all_lock_freeg(lck, __FILE__, __LINE__)
+#define upc_lock(lck) upc_lockg(lck, __FILE__, __LINE__)
+#define upc_memcpy(p1, p2, n) upc_memcpyg(p1, p2, n, __FILE__, __LINE__)
+#define upc_memget(p1, p2, n) upc_memgetg(p1, p2, n, __FILE__, __LINE__)
+#define upc_memput(p1, p2, n) upc_memputg(p1, p2, n, __FILE__, __LINE__)
+#define upc_memset(p1, c, n) upc_memsetg(p1, c, n, __FILE__, __LINE__)
+#define upc_unlock(lck) upc_unlockg(lck, __FILE__, __LINE__)
+#define upc_threadof(p) upc_threadofg(p, __FILE__, __LINE__)
+#define upc_phaseof(p) upc_phaseofg(p, __FILE__, __LINE__)
+#define upc_resetphase(p) upc_resetphaseg(p, __FILE__, __LINE__)
+#define upc_addrfield(p) upc_addrfieldg(p, __FILE__, __LINE__)
+#define upc_affinity(totalsize, nbytes, threadid) \
+ upc_affinitysizeg(totalsize, nbytes, threadid, __FILE__, __LINE__)
+
+#else
+
+/* Standard UPC library functions. */
+
+extern void upc_global_exit (int);
+extern shared void *upc_global_alloc (size_t, size_t);
+extern shared void *upc_all_alloc (size_t, size_t);
+extern shared void *upc_alloc (size_t);
+extern void upc_free (shared void *);
+extern void upc_all_free (shared void *);
+extern upc_lock_t *upc_global_lock_alloc (void);
+extern upc_lock_t *upc_all_lock_alloc (void);
+extern void upc_lock (upc_lock_t *);
+extern int upc_lock_attempt (upc_lock_t *);
+extern void upc_unlock (upc_lock_t *);
+extern void upc_lock_free (upc_lock_t *);
+extern void upc_all_lock_free (upc_lock_t *);
+extern void upc_memcpy (shared void *, shared const void *, size_t);
+extern void upc_memget (void *, shared const void *, size_t);
+extern void upc_memput (shared void *, const void *, size_t);
+extern void upc_memset (shared void *, int, size_t);
+
+#endif /* __UPC_PUPC_INST__ */
+
+#ifndef __BERKELEY_UPC_RUNTIME__
+/* upc_flag_t, required by version 1.2 of the UPC specification
+ (section 7.2.6). */
+typedef int upc_flag_t;
+#endif
+
+#endif /* !_UPC_H_ */
===================================================================
@@ -0,0 +1,84 @@
+/* Copyright (C) 2013-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime Library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+/* UPC Atomic Memory Operations */
+
+#ifndef _UPC_ATOMIC_H_
+#define _UPC_ATOMIC_H_
+
+#include "upc_types.h"
+
+/* Atomic operations not defined in <upc_types.h>. */
+#define UPC_GET (1UL<<9)
+#define UPC_SET (1UL<<10)
+#define UPC_CSWAP (1UL<<11)
+#define UPC_SUB (1UL<<12)
+#define UPC_INC (1UL<<13)
+#define UPC_DEC (1UL<<14)
+
+#define UPC_GET_OP 9
+#define UPC_SET_OP 10
+#define UPC_CSWAP_OP 11
+#define UPC_SUB_OP 12
+#define UPC_INC_OP 13
+#define UPC_DEC_OP 14
+
+/* Preferred mode of optimization of a domain. */
+typedef int upc_atomichint_t;
+/* Preferred mode of optimization values. */
+#define UPC_ATOMIC_HINT_DEFAULT 0
+#define UPC_ATOMIC_HINT_LATENCY 1
+#define UPC_ATOMIC_HINT_THROUGHPUT 2
+
+/* Atomics domain allocator (collective function). */
+upc_atomicdomain_t *upc_all_atomicdomain_alloc (upc_type_t type,
+ upc_op_t ops,
+ upc_atomichint_t hints);
+
+/* Atomics domain release (collective function). */
+void upc_all_atomicdomain_free (upc_atomicdomain_t * ptr);
+
+/* Atomics strict operation. */
+void upc_atomic_strict (upc_atomicdomain_t * domain,
+ void *restrict fetch_ptr, upc_op_t op,
+ shared void *restrict target,
+ const void *restrict operand1,
+ const void *restrict operand2);
+
+/* Atomics relaxed operation. */
+void upc_atomic_relaxed (upc_atomicdomain_t * domain,
+ void *restrict fetch_ptr, upc_op_t op,
+ shared void *restrict target,
+ const void *restrict operand1,
+ const void *restrict operand2);
+
+/* Atomics query function for expected performance. */
+int upc_atomic_isfast (upc_type_t type, upc_op_t ops, shared void *addr);
+/* Expected performance return value. */
+#define UPC_ATOMIC_PERFORMANCE_NOT_FAST 0
+#define UPC_ATOMIC_PERFORMANCE_FAST 1
+
+#endif /* !_UPC_ATOMIC_H_ */
===================================================================
@@ -0,0 +1,60 @@
+/* Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime Library.
+ Derived from public domain reference implementation
+ written by Dan Bonachea <danbonachea@gmail.com>.
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+
+#ifndef _UPC_CASTABLE_H_
+#define _UPC_CASTABLE_H_
+
+#if __UPC_CASTABLE__ != 1
+#error Bad feature macro predefinition
+#endif
+
+#include <stddef.h> /* size_t */
+
+#define UPC_CASTABLE_ALL_ALLOC (1<<0)
+#define UPC_CASTABLE_GLOBAL_ALLOC (1<<1)
+#define UPC_CASTABLE_ALLOC (1<<2)
+#define UPC_CASTABLE_STATIC (1<<3)
+
+#define UPC_CASTABLE_ALL ( \
+ UPC_CASTABLE_ALL_ALLOC | \
+ UPC_CASTABLE_GLOBAL_ALLOC | \
+ UPC_CASTABLE_ALLOC | \
+ UPC_CASTABLE_STATIC \
+ )
+
+typedef struct _S_upc_thread_info
+{
+ int guaranteedCastable;
+ int probablyCastable;
+} upc_thread_info_t;
+
+
+void *upc_cast (const shared void *);
+
+upc_thread_info_t upc_thread_info (size_t);
+
+#endif /* _UPC_CASTABLE_H_ */
===================================================================
@@ -0,0 +1,222 @@
+/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+
+#ifndef _UPC_COLLECTIVE_H_
+#define _UPC_COLLECTIVE_H_
+
+#include <upc_types.h>
+
+/* Per the UPC collectives library specification, the following
+ operations are defined in addition to those defined in upc_types.h.
+ Values below 2^16 are reserved. */
+#define UPC_FUNC (1UL<<16)
+#define UPC_NONCOMM_FUNC (1UL<<17)
+#define UPC_MAX_COLL_OP UPC_NONCOMM_FUNC
+
+/* Function codes for error checking */
+
+#define UPC_BRDCST 0
+#define UPC_SCAT 1
+#define UPC_GATH 2
+#define UPC_GATH_ALL 3
+#define UPC_EXCH 4
+#define UPC_PERM 5
+#define UPC_RED 6
+#define UPC_PRED 7
+#define UPC_SORT 8
+
+extern void upc_all_broadcast (shared void *dst,
+ shared const void *src,
+ size_t nbytes, upc_flag_t sync_mode);
+
+extern void upc_coll_err (shared void *dst, shared const void *src,
+ shared const int *perm,
+ size_t nbytes,
+ upc_flag_t sync_mode,
+ size_t blk_size,
+ size_t nelems, upc_op_t op, upc_flag_t upc_coll_op);
+
+extern void upc_all_exchange (shared void *dst, shared const void *src,
+ size_t nbytes, upc_flag_t sync_mode);
+
+extern void upc_all_gather_all (shared void *dst,
+ shared const void *src,
+ size_t nbytes, upc_flag_t sync_mode);
+
+extern void upc_all_gather (shared void *dst, shared const void *src,
+ size_t nbytes, upc_flag_t sync_mode);
+
+extern void upc_coll_init (void);
+
+extern void upc_all_permute (shared void *dst, shared const void *src,
+ shared const int *perm, size_t nbytes,
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceC (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems,
+ size_t blk_size,
+ signed char (*func) (signed char,
+ signed char),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceUC (shared void *dst,
+ shared const void *src, upc_op_t op,
+ size_t nelems, size_t blk_size,
+ unsigned char (*func) (unsigned char,
+ unsigned char),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceS (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems,
+ size_t blk_size,
+ signed short (*func) (signed short,
+ signed short),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceUS (shared void *dst,
+ shared const void *src, upc_op_t op,
+ size_t nelems, size_t blk_size,
+ unsigned short (*func) (unsigned short,
+ unsigned short),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceI (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems,
+ size_t blk_size,
+ signed int (*func) (signed int,
+ signed int),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceUI (shared void *dst,
+ shared const void *src, upc_op_t op,
+ size_t nelems, size_t blk_size,
+ unsigned int (*func) (unsigned int,
+ unsigned int),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceL (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems,
+ size_t blk_size,
+ signed long (*func) (signed long,
+ signed long),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceUL (shared void *dst,
+ shared const void *src, upc_op_t op,
+ size_t nelems, size_t blk_size,
+ unsigned long (*func) (unsigned long,
+ unsigned long),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceF (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems,
+ size_t blk_size, float (*func) (float,
+ float),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceD (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems,
+ size_t blk_size, double (*func) (double,
+ double),
+ upc_flag_t sync_mode);
+
+extern void upc_all_prefix_reduceLD (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems,
+ size_t blk_size,
+ long double (*func) (long double,
+ long double),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceC (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ signed char (*func) (signed char, signed char),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceUC (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ unsigned char (*func) (unsigned char,
+ unsigned char),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceS (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ signed short (*func) (signed short,
+ signed short),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceUS (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ unsigned short (*func) (unsigned short,
+ unsigned short),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceI (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ signed int (*func) (signed int, signed int),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceUI (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ unsigned int (*func) (unsigned int,
+ unsigned int),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceL (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ signed long (*func) (signed long, signed long),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceUL (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ unsigned long (*func) (unsigned long,
+ unsigned long),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceF (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ float (*func) (float, float),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceD (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ double (*func) (double, double),
+ upc_flag_t sync_mode);
+
+extern void upc_all_reduceLD (shared void *dst, shared const void *src,
+ upc_op_t op, size_t nelems, size_t blk_size,
+ long double (*func) (long double, long double),
+ upc_flag_t sync_mode);
+
+extern void upc_all_scatter (shared void *dst, shared const void *src,
+ size_t nbytes, upc_flag_t sync_mode);
+
+extern void upc_all_sort (shared void *A, size_t elem_size,
+ size_t nelems, size_t blk_size,
+ int (*func) (shared void *, shared void *),
+ upc_flag_t sync_mode);
+
+#endif /* !_UPC_COLLECTIVE_H_ */
===================================================================
@@ -0,0 +1,65 @@
+/* Copyright (C) 2013-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime Library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+/* UPC Non-Blocking Transfer Operations */
+
+#ifndef _UPC_NB_H_
+#define _UPC_NB_H_
+
+/* Sync attempt return values. */
+#define UPC_NB_NOT_COMPLETED 0
+#define UPC_NB_COMPLETED 1
+
+/* UPC non-blocking handle. */
+typedef unsigned long upc_handle_t;
+#define UPC_COMPLETE_HANDLE (unsigned long) 0
+
+/* Non-blocking memory transfers with explicit handle. */
+extern upc_handle_t upc_memcpy_nb (
+ shared void *restrict dst, shared const void *restrict src, size_t n);
+extern upc_handle_t upc_memget_nb (
+ void *restrict dst, shared const void *restrict src, size_t n);
+extern upc_handle_t upc_memput_nb (
+ shared void *restrict dst, const void *restrict src, size_t n);
+extern upc_handle_t upc_memset_nb (shared void *dst, int c, size_t n);
+extern int upc_sync_attempt (upc_handle_t handle);
+extern void upc_sync (upc_handle_t handle);
+
+/* Non-blocking memory transfers with implicit handle. */
+extern void
+upc_memcpy_nbi (shared void *restrict dst,
+ shared const void *restrict src, size_t n);
+extern void
+upc_memget_nbi (void *restrict dst,
+ shared const void *restrict src, size_t n);
+extern void
+upc_memput_nbi (shared void *restrict dst,
+ const void *restrict src, size_t n);
+extern void upc_memset_nbi (shared void *dst, int c, size_t n);
+extern int upc_synci_attempt (void);
+extern void upc_synci (void);
+
+#endif /* !_UPC_NB_H_ */
===================================================================
@@ -0,0 +1,31 @@
+/* Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime Library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+#ifndef _UPC_RELAXED_H_
+#define _UPC_RELAXED_H_
+#pragma upc relaxed
+#include <upc.h>
+#endif /* not _UPC_RELAXED_H_ */
===================================================================
@@ -0,0 +1,31 @@
+/* Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime Library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+#ifndef _UPC_STRICT_H_
+#define _UPC_STRICT_H_
+#pragma upc strict
+#include <upc.h>
+#endif /* not _UPC_STRICT_H_ */
===================================================================
@@ -0,0 +1,41 @@
+/* Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime Library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+#ifndef _UPC_TICK_H_
+#define _UPC_TICK_H_ 1
+
+/* Required, for uint64_t. */
+#include <stdint.h>
+
+typedef uint64_t upc_tick_t;
+
+#define UPC_TICK_MIN 0ULL
+#define UPC_TICK_MAX 0xffffffffffffffffULL
+
+extern upc_tick_t upc_ticks_now (void);
+extern uint64_t upc_ticks_to_ns (upc_tick_t ticks);
+
+#endif /* _UPC_TICK_H_ */
===================================================================
@@ -0,0 +1,97 @@
+/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ This file is part of the UPC runtime Library.
+ Written by Gary Funck <gary@intrepid.com>
+ and Nenad Vukicevic <nenad@intrepid.com>
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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/>. */
+
+#ifndef _UPC_TYPES_H_
+#define _UPC_TYPES_H_
+
+
+typedef int upc_type_t;
+
+#define UPC_CHAR 1
+#define UPC_UCHAR 2
+#define UPC_SHORT 3
+#define UPC_USHORT 4
+#define UPC_INT 5
+#define UPC_UINT 6
+#define UPC_LONG 7
+#define UPC_ULONG 8
+#define UPC_LLONG 9
+#define UPC_ULLONG 10
+#define UPC_INT8 11
+#define UPC_UINT8 12
+#define UPC_INT16 13
+#define UPC_UINT16 14
+#define UPC_INT32 15
+#define UPC_UINT32 16
+#define UPC_INT64 17
+#define UPC_UINT64 18
+#define UPC_FLOAT 19
+#define UPC_DOUBLE 20
+#define UPC_LDOUBLE 21
+#define UPC_PTS 22
+
+/* Flag type for synchronization semantics
+ (and potentially other uses). */
+
+typedef int upc_flag_t;
+
+/* Synchronization flags. */
+
+#define UPC_IN_ALLSYNC (1<<0)
+#define UPC_IN_MYSYNC (1<<1)
+#define UPC_IN_NOSYNC (1<<2)
+#define UPC_OUT_ALLSYNC (1<<3)
+#define UPC_OUT_MYSYNC (1<<4)
+#define UPC_OUT_NOSYNC (1<<5)
+
+/* Operation type for upc_all_reduceT() and upc_all_prefix_reduceT(). */
+
+typedef unsigned long upc_op_t;
+
+#define UPC_ADD (1UL<<0)
+#define UPC_MULT (1UL<<1)
+#define UPC_AND (1UL<<2)
+#define UPC_OR (1UL<<3)
+#define UPC_XOR (1UL<<4)
+#define UPC_LOGAND (1UL<<5)
+#define UPC_LOGOR (1UL<<6)
+#define UPC_MIN (1UL<<7)
+#define UPC_MAX (1UL<<8)
+
+#define UPC_ADD_OP 0
+#define UPC_MULT_OP 1
+#define UPC_AND_OP 2
+#define UPC_OR_OP 3
+#define UPC_XOR_OP 4
+#define UPC_LOGAND_OP 5
+#define UPC_LOGOR_OP 6
+#define UPC_MIN_OP 7
+#define UPC_MAX_OP 8
+
+#define UPC_FIRST_OP UPC_ADD_OP
+#define UPC_LAST_OP UPC_MAX_OP
+
+#endif /* _UPC_TYPES_H_ */