Re: [Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
On 09/28/2017 11:00 AM, niXman wrote: > Liu Hao 2017-09-27 15:32: >> Jon would you please cherry-pick it to v5.x? Thanks. > > Jon, ping please. > > It is already in, unless something funny is going on the sf git repos. signature.asc Description: OpenPGP digital signature -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
Liu Hao 2017-09-27 15:32: Jon would you please cherry-pick it to v5.x? Thanks. Jon, ping please. -- Regards, niXman ___ Dual-target(32 & 64-bit) MinGW-W64 compilers for 32 and 64-bit Windows: https://sf.net/p/mingw-w64/ -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
On 09/28/2017 11:35 AM, Liu Hao wrote: > On 2017/9/27 20:32, Liu Hao wrote: >> On 2017/9/27 20:21, Christer Solskogen wrote: >>> On 08-May-17 12:32, Kai Tietz wrote: ok, please apply. >>> >>> Was this ever applied? It seem still to happen with latest 5.x branch. >>> >> Jon would you please cherry-pick it to v5.x? Thanks. >> > Eventually, SF is back... > It's pushed to v5.x already. signature.asc Description: OpenPGP digital signature -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
On 2017/9/27 20:32, Liu Hao wrote: On 2017/9/27 20:21, Christer Solskogen wrote: On 08-May-17 12:32, Kai Tietz wrote: ok, please apply. Was this ever applied? It seem still to happen with latest 5.x branch. Jon would you please cherry-pick it to v5.x? Thanks. Eventually, SF is back... -- Best regards, LH_Mouse -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
On 2017/9/27 20:21, Christer Solskogen wrote: On 08-May-17 12:32, Kai Tietz wrote: ok, please apply. Was this ever applied? It seem still to happen with latest 5.x branch. Jon would you please cherry-pick it to v5.x? Thanks. -- Best regards, LH_Mouse -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
On 08-May-17 12:32, Kai Tietz wrote: ok, please apply. Was this ever applied? It seem still to happen with latest 5.x branch. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
ok, please apply. Thanks, Kai 2017-05-08 12:19 GMT+02:00 Liu Hao: > On 2017/5/3 15:35, Christer Solskogen wrote: >> >> I'm having a hard time (cross) compiling winpthreads (from 5.x branch) >> with gcc 7.1. >> (... abridgement ...) >> src/.libs/libwinpthread_la-clock.o:clock.c:(.text+0x270): undefined >> reference to `__divmoddi4' > > Here is the 'real' fix for it. Please review. > > (I really hate this C-ish code but this way it looks like how `__udivdi3` > was implemented.) > > -- > Best regards, > LH_Mouse > > > > > From 04f0579cb7e2f294e1e3ad2be18b8d059546208f Mon Sep 17 00:00:00 2001 > From: Liu Hao > Date: Wed, 3 May 2017 15:52:32 +0800 > Subject: [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for > GCC > 7. > > GCC targeting i686 _may_ generate an external call to the function in > question when divding a 64-bit (DIMode) integer with another one. > Since we are linking against a fake libgcc, this function is not available. > > Signed-off-by: Liu Hao > --- > .../winpthreads/src/libgcc/dll_math.c | 27 > ++ > 1 file changed, 27 insertions(+) > > diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c > b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c > index e09b481b..aeec0680 100644 > --- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c > +++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c > @@ -120,6 +120,7 @@ u_quad_t__qdivrem(u_quad_t u, u_quad_t v, u_quad_t > *rem); > u_quad_t __udivdi3(u_quad_t a, u_quad_t b); > u_quad_t __umoddi3(u_quad_t a, u_quad_t b); > int__ucmpdi2(u_quad_t a, u_quad_t b); > +quad_t __divmoddi4(quad_t a, quad_t b, quad_t *rem); > > #endif /* !_LIBKERN_QUAD_H_ */ > > @@ -546,6 +547,32 @@ __umoddi3(a, b) > (void)__qdivrem(a, b, ); > return (r); > } > + > +/* > + * Divide two signed quads. > + * This function is new in GCC 7. > + */ > +quad_t > +__divmoddi4(a, b, rem) > + quad_t a, b, *rem; > +{ > + u_quad_t ua, ub, uq, ur; > + int negq, negr; > + > + if (a < 0) > + ua = -(u_quad_t)a, negq = 1, negr = 1; > + else > + ua = a, negq = 0, negr = 0; > + if (b < 0) > + ub = -(u_quad_t)b, negq ^= 1; > + else > + ub = b; > + uq = __qdivrem(ua, ub, ); > + if (rem) > + *rem = (negr ? -ur : ur); > + return (negq ? -uq : uq); > +} > + > #else > static int __attribute__((unused)) dummy; > #endif /*deined (_X86_) && !defined (__x86_64__)*/ > -- > 2.12.1 > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Mingw-w64-public mailing list > Mingw-w64-public@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
On 2017/5/3 15:35, Christer Solskogen wrote: I'm having a hard time (cross) compiling winpthreads (from 5.x branch) with gcc 7.1. (... abridgement ...) src/.libs/libwinpthread_la-clock.o:clock.c:(.text+0x270): undefined reference to `__divmoddi4' Here is the 'real' fix for it. Please review. (I really hate this C-ish code but this way it looks like how `__udivdi3` was implemented.) -- Best regards, LH_Mouse From 04f0579cb7e2f294e1e3ad2be18b8d059546208f Mon Sep 17 00:00:00 2001 From: Liu HaoDate: Wed, 3 May 2017 15:52:32 +0800 Subject: [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7. GCC targeting i686 _may_ generate an external call to the function in question when divding a 64-bit (DIMode) integer with another one. Since we are linking against a fake libgcc, this function is not available. Signed-off-by: Liu Hao --- .../winpthreads/src/libgcc/dll_math.c | 27 ++ 1 file changed, 27 insertions(+) diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c index e09b481b..aeec0680 100644 --- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c +++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c @@ -120,6 +120,7 @@ u_quad_t __qdivrem(u_quad_t u, u_quad_t v, u_quad_t *rem); u_quad_t __udivdi3(u_quad_t a, u_quad_t b); u_quad_t __umoddi3(u_quad_t a, u_quad_t b); int__ucmpdi2(u_quad_t a, u_quad_t b); +quad_t __divmoddi4(quad_t a, quad_t b, quad_t *rem); #endif /* !_LIBKERN_QUAD_H_ */ @@ -546,6 +547,32 @@ __umoddi3(a, b) (void)__qdivrem(a, b, ); return (r); } + +/* + * Divide two signed quads. + * This function is new in GCC 7. + */ +quad_t +__divmoddi4(a, b, rem) + quad_t a, b, *rem; +{ + u_quad_t ua, ub, uq, ur; + int negq, negr; + + if (a < 0) + ua = -(u_quad_t)a, negq = 1, negr = 1; + else + ua = a, negq = 0, negr = 0; + if (b < 0) + ub = -(u_quad_t)b, negq ^= 1; + else + ub = b; + uq = __qdivrem(ua, ub, ); + if (rem) + *rem = (negr ? -ur : ur); + return (negq ? -uq : uq); +} + #else static int __attribute__((unused)) dummy; #endif /*deined (_X86_) && !defined (__x86_64__)*/ -- 2.12.1 From 04f0579cb7e2f294e1e3ad2be18b8d059546208f Mon Sep 17 00:00:00 2001 From: Liu Hao Date: Wed, 3 May 2017 15:52:32 +0800 Subject: [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7. GCC targeting i686 _may_ generate an external call to the function in question when divding a 64-bit (DIMode) integer with another one. Since we are linking against a fake libgcc, this function is not available. Signed-off-by: Liu Hao --- .../winpthreads/src/libgcc/dll_math.c | 27 ++ 1 file changed, 27 insertions(+) diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c index e09b481b..aeec0680 100644 --- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c +++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c @@ -120,6 +120,7 @@ u_quad_t__qdivrem(u_quad_t u, u_quad_t v, u_quad_t *rem); u_quad_t __udivdi3(u_quad_t a, u_quad_t b); u_quad_t __umoddi3(u_quad_t a, u_quad_t b); int__ucmpdi2(u_quad_t a, u_quad_t b); +quad_t __divmoddi4(quad_t a, quad_t b, quad_t *rem); #endif /* !_LIBKERN_QUAD_H_ */ @@ -546,6 +547,32 @@ __umoddi3(a, b) (void)__qdivrem(a, b, ); return (r); } + +/* + * Divide two signed quads. + * This function is new in GCC 7. + */ +quad_t +__divmoddi4(a, b, rem) + quad_t a, b, *rem; +{ + u_quad_t ua, ub, uq, ur; + int negq, negr; + + if (a < 0) + ua = -(u_quad_t)a, negq = 1, negr = 1; + else + ua = a, negq = 0, negr = 0; + if (b < 0) + ub = -(u_quad_t)b, negq ^= 1; + else + ub = b; + uq = __qdivrem(ua, ub, ); + if (rem) + *rem = (negr ? -ur : ur); + return (negq ? -uq : uq); +} + #else static int __attribute__((unused)) dummy; #endif /*deined (_X86_) && !defined (__x86_64__)*/ -- 2.12.1 -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public