aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2015-10-29 16:07:55 +0000
committerMartin Jambor <mjambor@suse.cz>2015-10-29 16:07:55 +0000
commit1064a1270eb021de09fa57baa766fb03212adc86 (patch)
treea7963ea26ac33420d520715612b56adb8393c409 /include
parent599ff395e4417e4429ffb296c6d082b0be2ae7e1 (diff)
Merged trunk revision 229518 into the hsa branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/hsa@229536 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog13
-rw-r--r--include/environ.h33
-rw-r--r--include/longlong.h28
3 files changed, 74 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index bfec2588e53..544309aa71c 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,16 @@
+2015-10-27 Daniel Jacobowitz <dan@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
+ Mark Shinwell <shinwell@codesourcery.com>
+ Andrew Stubbs <ams@codesourcery.com>
+ Rich Felker <dalias@libc.org>
+
+ * longlong.h (udiv_qrnnd): Add FDPIC compatible version for SH.
+
+2015-10-18 Roland McGrath <roland@gnu.org>
+
+ PR other/63758
+ * environ.h: New file.
+
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Ilya Verbin <ilya.verbin@intel.com>
diff --git a/include/environ.h b/include/environ.h
new file mode 100644
index 00000000000..c18902ba5b4
--- /dev/null
+++ b/include/environ.h
@@ -0,0 +1,33 @@
+/* Declare the environ system variable.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libiberty; see the file COPYING.LIB. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* On OSX, the environ variable can be used directly in the code of an
+ executable, but cannot be used in the code of a shared library (such as
+ GCC's liblto_plugin, which links in libiberty code). Instead, the
+ function _NSGetEnviron can be called to get the address of environ. */
+
+#ifndef HAVE_ENVIRON_DECL
+# ifdef __APPLE__
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron ())
+# else
+extern char **environ;
+# endif
+# define HAVE_ENVIRON_DECL
+#endif
diff --git a/include/longlong.h b/include/longlong.h
index a0b2ce1f7f2..d7ef671226c 100644
--- a/include/longlong.h
+++ b/include/longlong.h
@@ -1102,6 +1102,33 @@ extern UDItype __umulsidi3 (USItype, USItype);
/* This is the same algorithm as __udiv_qrnnd_c. */
#define UDIV_NEEDS_NORMALIZATION 1
+#ifdef __FDPIC__
+/* FDPIC needs a special version of the asm fragment to extract the
+ code address from the function descriptor. __udiv_qrnnd_16 is
+ assumed to be local and not to use the GOT, so loading r12 is
+ not needed. */
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ extern UWtype __udiv_qrnnd_16 (UWtype, UWtype) \
+ __attribute__ ((visibility ("hidden"))); \
+ /* r0: rn r1: qn */ /* r0: n1 r4: n0 r5: d r6: d1 */ /* r2: __m */ \
+ __asm__ ( \
+ "mov%M4 %4,r5\n" \
+" swap.w %3,r4\n" \
+" swap.w r5,r6\n" \
+" mov.l @%5,r2\n" \
+" jsr @r2\n" \
+" shll16 r6\n" \
+" swap.w r4,r4\n" \
+" mov.l @%5,r2\n" \
+" jsr @r2\n" \
+" swap.w r1,%0\n" \
+" or r1,%0" \
+ : "=r" (q), "=&z" (r) \
+ : "1" (n1), "r" (n0), "rm" (d), "r" (&__udiv_qrnnd_16) \
+ : "r1", "r2", "r4", "r5", "r6", "pr", "t"); \
+ } while (0)
+#else
#define udiv_qrnnd(q, r, n1, n0, d) \
do { \
extern UWtype __udiv_qrnnd_16 (UWtype, UWtype) \
@@ -1121,6 +1148,7 @@ extern UDItype __umulsidi3 (USItype, USItype);
: "1" (n1), "r" (n0), "rm" (d), "r" (&__udiv_qrnnd_16) \
: "r1", "r2", "r4", "r5", "r6", "pr", "t"); \
} while (0)
+#endif /* __FDPIC__ */
#define UDIV_TIME 80