Re: [Mingw-w64-public] [PATCH] rewrite the dirname.c and basename.c without wide character processing

2023-03-22 Thread 傅继晗
Thanks for your attention! I really understand this time.But I still have a question,why dirname in linux glib doesn't process MBCS? Maybe they think input as UTF-8 as default? LIU Hao 于2023年3月23日周四 13:30写道: > 在 2023-03-22 13:40, 傅继晗 写道: > > Hello: > > There is no need to convert multi-byte char

Re: [Mingw-w64-public] [PATCH] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread Martin Storsjö
On Wed, 22 Mar 2023, Jacek Caban wrote: On 3/22/23 15:21, LIU Hao wrote: 在 2023-03-22 21:07, Jacek Caban 写道: That's the motivation for this? I can see a point in supporting both syntaxes in headers (which may be included by users with various compiler options), but for crt, why isn't supporti

Re: [Mingw-w64-public] [PATCH] rewrite the dirname.c and basename.c without wide character processing

2023-03-22 Thread LIU Hao
在 2023-03-22 13:40, 傅继晗 写道: Hello: There is no need to convert multi-byte characters to wide-byte characters and then convert from wide-byte to multi-byte, just deal with multi-byte directly as __xpg_basename in gnu as this: glibc/xpg_basename.c at master · lattera/glibc (github.com)

Re: [Mingw-w64-public] [PATCH] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread LIU Hao
在 2023/3/23 05:48, Jacek Caban 写道: I didn't really mean to ask which syntax is better, but what exactly are we trying to achieve. From GCC thread, my understanding is that you want to support toolchains that default to Intel syntax. How about the attached patch? Being a compromise for some wel

Re: [Mingw-w64-public] [PATCH] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread Jacek Caban via Mingw-w64-public
On 3/22/23 15:21, LIU Hao wrote: 在 2023-03-22 21:07, Jacek Caban 写道: That's the motivation for this? I can see a point in supporting both syntaxes in headers (which may be included by users with various compiler options), but for crt, why isn't supporting a single syntax understood by all supp

[Mingw-w64-public] [PATCHv2] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread LIU Hao
Some fixes: 1. Fixed the order of operands of an FMUL. 2. Introduced dummy static functions for `__guard_dispatch_icall_dummy` and `_scprintf`. Only within function scopes, can extended asm statements be allowed. 3. There were condition `#if`s, where the x86 path pushed and popped EAX, but

Re: [Mingw-w64-public] [PATCH] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread LIU Hao
在 2023-03-22 21:07, Jacek Caban 写道: That's the motivation for this? I can see a point in supporting both syntaxes in headers (which may be included by users with various compiler options), but for crt, why isn't supporting a single syntax understood by all supported compilers enough? Yes that

Re: [Mingw-w64-public] [PATCH] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread Jacek Caban via Mingw-w64-public
On 3/22/23 04:08, LIU Hao wrote: This is the first attempt to allow the CRT to be built with `-masm=intel`. This patch itself may look messy because it contains a lot of inline changes. It should be examined with `git show --color-words='\S'`. I have only verified that the CRT actually builds

Re: [Mingw-w64-public] [PATCH] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread LIU Hao
在 2023/3/22 20:48, Martin Storsjö 写道: Sorry for the imprecise terminology - I meant that it expands to blank - no tokens at all, not an empty string. And it expands to blank for both AT&T and Intel mode. For AT&T it expands to a modulo operator, and for Intel it expands to blank. That's not

Re: [Mingw-w64-public] [PATCH] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread Martin Storsjö
On Wed, 22 Mar 2023, LIU Hao wrote: Looking at the change, I see that you're trying to use __REGISTER_PREFIX__ to disambiguate between the two modes - but as far as I can see, __REGISTER_PREFIX__ expands to an empty string in both GCC and Clang, for both i686 and x86_64, when running in the de

Re: [Mingw-w64-public] [PATCH] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread LIU Hao
在 2023/3/22 19:19, Martin Storsjö 写道: Out of curiosity, do you have a reference to when it got this new support? (16.0.0 was just released a few days ago.) Anyway, I'll test with the very latest from git. Looks like Clang 14: https://gcc.godbolt.org/z/oYd4Kfvdc The patch successfully builds w

Re: [Mingw-w64-public] [PATCH] crt: Make CRT buildable with `-masm=intel`

2023-03-22 Thread Martin Storsjö
On Wed, 22 Mar 2023, LIU Hao wrote: This is the first attempt to allow the CRT to be built with `-masm=intel`. This patch itself may look messy because it contains a lot of inline changes. It should be examined with `git show --color-words='\S'`. I have only verified that the CRT actually bui