* Makefile.in (LIB2_DIVMOD_FUNCS): Add _divmoddi4.
* libgcc2.c (__divmoddi4): New function.
* libgcc2.h (__divmoddi4): Declare.
* libgcc-std.ver.in (GCC_7.0.0): New. Add __PFX_divmoddi4
and __PFX_divmodti4.
From-SVN: r241804
+2016-11-02 Uros Bizjak <ubizjak@gmail.com>
+
+ * Makefile.in (LIB2_DIVMOD_FUNCS): Add _divmoddi4.
+ * libgcc2.c (__divmoddi4): New function.
+ * libgcc2.h (__divmoddi4): Declare.
+ * libgcc-std.ver.in (GCC_7.0.0): New. Add __PFX_divmoddi4
+ and __PFX_divmodti4.
+
2016-10-24 Florian Weimer <fweimer@redhat.com>
PR libgcc/78064
2016-10-19 John David Anglin <danglin@gcc.gnu.org>
- * config/pa/pa64-hpux-lib.h: New file.
+ * config/pa/pa64-hpux-lib.h: New file.
(EH_FRAME_SECTION_NAME): Rename to __LIBGCC_EH_FRAME_SECTION_NAME__.
(DTORS_SECTION_ASM_OP): Rename to __LIBGCC_DTORS_SECTION_ASM_OP__.
* config.host (tm_file): Add pa/pa64-hpux-lib.h to tm_file on
2016-06-23 Jakub Sejdak <jakub.sejdak@phoesys.com>
- * config.host: Add suport for arm*-*-phoenix* targets.
+ * config.host: Add suport for arm*-*-phoenix* targets.
2016-06-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
# List of functions not to build from libgcc2.c.
LIB2FUNCS_EXCLUDE =
-# These might cause a divide overflow trap and so are compiled with
-# unwinder info.
-LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
-
# List of extra C and assembler files to add to static and shared libgcc2.
# Assembler files should have names ending in `.S'.
LIB2ADD =
# These might cause a divide overflow trap and so are compiled with
# unwinder info.
-LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
+LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _divmoddi4 \
+ _udivdi3 _umoddi3 _udivmoddi4 _udiv_w_sdiv
# Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
# defined as optimized assembly code in LIB1ASMFUNCS or as C code
%inherit GCC_4.8.0 GCC_4.7.0
GCC_4.8.0 {
}
+
+%inherit GCC_7.0.0 GCC_4.8.0
+GCC_7.0.0 {
+ __PFX__divmoddi4
+ __PFX__divmodti4
+}
#endif
\f
#if (defined (L_udivdi3) || defined (L_divdi3) || \
- defined (L_umoddi3) || defined (L_moddi3))
+ defined (L_umoddi3) || defined (L_moddi3) || \
+ defined (L_divmoddi4))
#define L_udivmoddi4
#endif
#ifdef TARGET_HAS_NO_HW_DIVIDE
#if (defined (L_udivdi3) || defined (L_divdi3) || \
- defined (L_umoddi3) || defined (L_moddi3))
+ defined (L_umoddi3) || defined (L_moddi3) || \
+ defined (L_divmoddi4))
static inline __attribute__ ((__always_inline__))
#endif
UDWtype
#else
#if (defined (L_udivdi3) || defined (L_divdi3) || \
- defined (L_umoddi3) || defined (L_moddi3))
+ defined (L_umoddi3) || defined (L_moddi3) || \
+ defined (L_divmoddi4))
static inline __attribute__ ((__always_inline__))
#endif
UDWtype
}
#endif
+#ifdef L_divmoddi4
+DWtype
+__divmoddi4 (DWtype u, DWtype v, DWtype *rp)
+{
+ Wtype c1 = 0, c2 = 0;
+ DWunion uu = {.ll = u};
+ DWunion vv = {.ll = v};
+ DWtype w;
+ DWtype r;
+
+ if (uu.s.high < 0)
+ c1 = ~c1, c2 = ~c2,
+ uu.ll = -uu.ll;
+ if (vv.s.high < 0)
+ c1 = ~c1,
+ vv.ll = -vv.ll;
+
+ w = __udivmoddi4 (uu.ll, vv.ll, (UDWtype*)&r);
+ if (c1)
+ w = -w;
+ if (c2)
+ r = -r;
+
+ *rp = r;
+ return w;
+}
+#endif
+
#ifdef L_umoddi3
UDWtype
__umoddi3 (UDWtype u, UDWtype v)
#define __ashrdi3 __NDW(ashr,3)
#define __cmpdi2 __NDW(cmp,2)
#define __ucmpdi2 __NDW(ucmp,2)
+#define __divmoddi4 __NDW(divmod,4)
#define __udivmoddi4 __NDW(udivmod,4)
#define __fixunstfDI __NDW(fixunstf,)
#define __fixtfdi __NDW(fixtf,)
extern UDWtype __udivdi3 (UDWtype, UDWtype);
extern UDWtype __umoddi3 (UDWtype, UDWtype);
extern DWtype __moddi3 (DWtype, DWtype);
+extern DWtype __divmoddi4 (DWtype, DWtype, DWtype *);
/* __udivmoddi4 is static inline when building other libgcc2 portions. */
#if (!defined (L_udivdi3) && !defined (L_divdi3) && \
- !defined (L_umoddi3) && !defined (L_moddi3))
+ !defined (L_umoddi3) && !defined (L_moddi3) && \
+ !defined (L_divmoddi4))
extern UDWtype __udivmoddi4 (UDWtype, UDWtype, UDWtype *);
#endif