Re: [Mingw-w64-public] [PATCH 00/18] ARM64 support in MinGW, v2

2017-08-08 Thread Jean-Baptiste Kempf
Hello, On Tue, 8 Aug 2017, at 22:32, Martin Storsjö wrote: > This is v2 of the patchset, rebased on top of master with the > math files split into subdirectories. From a quick review from a clueless guy like me: - 1, 2, 3, 4, 5, 7, 11, 13, 14, 15 seems very much OK to me. - 6 is so-so to

[Mingw-w64-public] [PATCH 4/4] math: arm: Replace the copysignl assembly file with a C file

2017-08-08 Thread Martin Storsjö
This function, on arm, just calls the normal double copysign function, and there's no need to do that in assembly. --- mingw-w64-crt/Makefile.am | 2 +- mingw-w64-crt/math/arm/{copysignl.S => copysignl.c} | 14 +- 2 files changed, 6 insertions(+), 10

[Mingw-w64-public] [PATCH 3/4] math: Split source files with plain assembly into different directories

2017-08-08 Thread Martin Storsjö
The files that previously had assembly for both x86 and arm are copied into subdirectories and the arm specific parts are removed from x86 and vice versa. Some of the remaining .c files in the main math directory also include arch specific assembly. But when porting to a new architecture, they

[Mingw-w64-public] [PATCH 2/4] math: Move x86 specific files to an x86 subdirectory

2017-08-08 Thread Martin Storsjö
--- mingw-w64-crt/Makefile.am| 36 +++- mingw-w64-crt/math/{ => x86}/acosf.c | 0 mingw-w64-crt/math/{ => x86}/acosh.c | 0 mingw-w64-crt/math/{ => x86}/acosh.def.h | 0 mingw-w64-crt/math/{ => x86}/acoshf.c| 0

[Mingw-w64-public] [PATCH 1/4] math: Deduplicate the list of x86 specific math source files

2017-08-08 Thread Martin Storsjö
Both src_libmingwex32 and src_libmingwex64 had the exact same list of files; share this list in a common variable. --- mingw-w64-crt/Makefile.am | 24 +--- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am

Re: [Mingw-w64-public] [PATCH 01/19] math: Add errors in assembly sources if no implementation exists

2017-08-08 Thread Martin Storsjö
On Mon, 7 Aug 2017, Martin Storsjö wrote: On Sun, 6 Aug 2017, JonY via Mingw-w64-public wrote: On 08/06/2017 02:59 PM, David Grayson wrote: I would agree with Martin; I think it's a very good practice for source files to have an error or not define a function instead of defining a function

Re: [Mingw-w64-public] [PATCH 1/4] math: Deduplicate the list of x86 specific math source files

2017-08-08 Thread JonY via Mingw-w64-public
On 08/08/2017 11:02 AM, Martin Storsjö wrote: > Both src_libmingwex32 and src_libmingwex64 had the exact same list > of files; share this list in a common variable. Thanks for reorganizing the files, I don't have any objections. You can go ahead for master if x86 builds don't break.

[Mingw-w64-public] [PATCH 07/18] math: Use the same generic codepaths for arm64 as for arm

2017-08-08 Thread Martin Storsjö
Just as on arm, long double is the same as double. --- mingw-w64-crt/math/cephes_mconf.h | 4 ++-- mingw-w64-crt/math/fabs.c | 4 ++-- mingw-w64-crt/math/fabsf.c| 4 ++-- mingw-w64-crt/math/fabsl.c| 2 +- mingw-w64-crt/math/fmal.c | 2 +-

[Mingw-w64-public] [PATCH 01/18] setjmp.h: Add a fallback definition for unsupported architectures

2017-08-08 Thread Martin Storsjö
This allows including the header without errors, if building for an architecture that we lack setjmp support for so far. This matches what wine have got at the end of their setjmp.h. --- mingw-w64-headers/crt/setjmp.h | 5 + 1 file changed, 5 insertions(+) diff --git

[Mingw-w64-public] [PATCH 05/18] headers: Skip the inline interlocked functions for arm64 (as on all other non-i386 archs)

2017-08-08 Thread Martin Storsjö
These are skipped on x86_64, arm and arm64 - in practice the condition maybe should be inverted to only include i386. --- mingw-w64-headers/include/interlockedapi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-headers/include/interlockedapi.h

[Mingw-w64-public] [PATCH 06/18] fenv: Add arm64 specific codepaths in fenv functions, add arm64 fenv.h header section

2017-08-08 Thread Martin Storsjö
The fpcr register used in arm64 is the same as the fpscr register in 32 bit arm, but when the register is accessed via the msr/mrs instructions, a 64 bit register has to be used - thus use a 64 bit local variable instead of accessing a fenv_t directly. --- mingw-w64-crt/crt/CRT_fp10.c |

[Mingw-w64-public] [PATCH 10/18] stdio: Add arm64 assembly wrappers for the v*scanf functions

2017-08-08 Thread Martin Storsjö
Implement the forwarding function in scanf2-template.S and the va_list unwrapper in the __argtos function in scanf.S, and add arm64 to the list of supported architectures in the files that need it. --- mingw-w64-crt/stdio/scanf.S | 32

[Mingw-w64-public] [PATCH 04/18] headers: Detection of arm64 in some main locations

2017-08-08 Thread Martin Storsjö
--- mingw-w64-headers/crt/malloc.h| 2 +- mingw-w64-headers/include/winnt.h | 21 ++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/mingw-w64-headers/crt/malloc.h b/mingw-w64-headers/crt/malloc.h index b4c9dc4..9d75ea6 100644 ---

[Mingw-w64-public] [PATCH 00/18] ARM64 support in MinGW, v2

2017-08-08 Thread Martin Storsjö
Hi, This is v2 of the patchset, rebased on top of master with the math files split into subdirectories. Martin Storsjö (18): setjmp.h: Add a fallback definition for unsupported architectures crt: Add initial support for arm64 in mingw-w64-crt Makefile.am/configure.ac crt: Add an

[Mingw-w64-public] [PATCH 16/18] winnt.h: Add arm64 specific handling of TEB

2017-08-08 Thread Martin Storsjö
--- mingw-w64-headers/include/winnt.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index 9107a36..f48cb30 100644 --- a/mingw-w64-headers/include/winnt.h +++ b/mingw-w64-headers/include/winnt.h @@ -8395,6

[Mingw-w64-public] [PATCH 11/18] intrin-impl.h: Include compiler builtins based parts on arm64 as well

2017-08-08 Thread Martin Storsjö
--- mingw-w64-headers/include/psdk_inc/intrin-impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-headers/include/psdk_inc/intrin-impl.h b/mingw-w64-headers/include/psdk_inc/intrin-impl.h index 352b686..a1c77b5 100644 ---

[Mingw-w64-public] [PATCH 02/18] crt: Add initial support for arm64 in mingw-w64-crt Makefile.am/configure.ac

2017-08-08 Thread Martin Storsjö
This is only supported by llvm-dlltool so far. The actual def files in the libarm64 subdirectory are added in a separate commit. --- mingw-w64-crt/Makefile.am | 252 + mingw-w64-crt/configure.ac | 21 2 files changed, 273 insertions(+) diff

[Mingw-w64-public] [PATCH 13/18] crtexe: Skip __initenv on arm64 just as on arm

2017-08-08 Thread Martin Storsjö
--- mingw-w64-crt/crt/crtexe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c index ae37e0f..bbef685 100644 --- a/mingw-w64-crt/crt/crtexe.c +++ b/mingw-w64-crt/crt/crtexe.c @@ -26,7 +26,7 @@ extern wchar_t ***

[Mingw-w64-public] [PATCH 09/18] math: Implement the exp2() wrappers using assembly on arm64

2017-08-08 Thread Martin Storsjö
The LLVM optimizer replaces a call to pow(2, x) back into a call to exp2(x), which ends up in an infinite loop/recursion here. To avoid the issue, one could either build exp2.c (or easier to accomplish, all of libmingwex.a) using -fno-builtin or -ffreestanding, or produce the exp2() function

[Mingw-w64-public] [PATCH 08/18] math: Add arm64 specific implementations of math functions

2017-08-08 Thread Martin Storsjö
--- mingw-w64-crt/Makefile.am | 6 - mingw-w64-crt/math/{arm => arm64}/_chgsignl.S | 6 ++--- .../{stdio/vsscanf2.S => math/arm64/ceil.S}| 12 ++ .../{stdio/vsscanf2.S => math/arm64/ceilf.S} | 12 ++ .../{stdio/vsscanf2.S =>

[Mingw-w64-public] [PATCH 14/18] crt: Change a check for _WIN64 into __x86_64__ in an assembly file

2017-08-08 Thread Martin Storsjö
This is similar to what was done in 40f03bb9eb. This isn't necessarily supported on arm64 (at least not yet) even though it is on x86_64. --- mingw-w64-crt/stdio/scanf2-template.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mingw-w64-crt/stdio/scanf2-template.S

[Mingw-w64-public] [PATCH 17/18] winnt.h: Add empty definition of arch specific structs for arm64

2017-08-08 Thread Martin Storsjö
--- The correct/official definition of these structs are available in winnt.h in the win10 sdk (but they are not documented on e.g. MSDN). I haven't looked closer at them other than noticing that they exist there. This setup (with empty dummy structs) is enough for code to compile without error at

[Mingw-w64-public] [PATCH 15/18] crt: Change checks for _WIN64 into __x86_64__ around exception handling

2017-08-08 Thread Martin Storsjö
This keeps these codepaths disabled on arm64 for now, where _WIN64 also is defined, but exception handling isn't supported yet. --- mingw-w64-crt/crt/crt_handler.c | 2 +- mingw-w64-crt/crt/crtdll.c | 2 +- mingw-w64-crt/crt/crtexe.c | 2 +- 3 files changed, 3 insertions(+), 3