@@ -237,6 +237,10 @@ limitations in handling dllimport attribute. */
237237# endif
238238#endif
239239
240+ #if !defined(__CRTDLL__) && __MSVCRT_VERSION__ == 0x00
241+ #define __CRTDLL__
242+ #endif
243+
240244#if !defined(_UCRT) && ((__MSVCRT_VERSION__ >= 0x1400) || (__MSVCRT_VERSION__ >= 0xE00 && __MSVCRT_VERSION__ < 0x1000))
241245/* Allow both 0x1400 and 0xE00 to identify UCRT */
242246#define _UCRT
@@ -594,12 +598,12 @@ extern "C" {
594598void __cdecl __debugbreak (void );
595599__MINGW_INTRIN_INLINE void __cdecl __debugbreak (void )
596600{
597- #if defined(__i386__) || defined(__x86_64__)
601+ #if defined(__aarch64__) || defined(__arm64ec__)
602+ __asm__ __volatile__ (" brk #0xf000" );
603+ #elif defined(__i386__) || defined(__x86_64__)
598604 __asm__ __volatile__ (" int {$}3" :);
599605#elif defined(__arm__)
600606 __asm__ __volatile__ (" udf #0xfe" );
601- #elif defined(__aarch64__)
602- __asm__ __volatile__ (" brk #0xf000" );
603607#else
604608 __asm__ __volatile__ (" unimplemented" );
605609#endif
@@ -615,14 +619,14 @@ __MINGW_INTRIN_INLINE void __cdecl __debugbreak(void)
615619void __cdecl __MINGW_ATTRIB_NORETURN __fastfail (unsigned int code);
616620__MINGW_INTRIN_INLINE void __cdecl __MINGW_ATTRIB_NORETURN __fastfail (unsigned int code)
617621{
618- #if defined(__i386__) || defined(__x86_64__)
622+ #if defined(__aarch64__) || defined(__arm64ec__)
623+ register unsigned int w0 __asm__ (" w0" ) = code;
624+ __asm__ __volatile__ (" brk #0xf003" ::" r" (w0));
625+ #elif defined(__i386__) || defined(__x86_64__)
619626 __asm__ __volatile__ (" int {$}0x29" ::" c" (code));
620627#elif defined(__arm__)
621628 register unsigned int r0 __asm__ (" r0" ) = code;
622629 __asm__ __volatile__ (" udf #0xfb" ::" r" (r0));
623- #elif defined(__aarch64__)
624- register unsigned int w0 __asm__ (" w0" ) = code;
625- __asm__ __volatile__ (" brk #0xf003" ::" r" (w0));
626630#else
627631 __asm__ __volatile__ (" unimplemented" );
628632#endif
@@ -636,13 +640,13 @@ __MINGW_INTRIN_INLINE void __cdecl __MINGW_ATTRIB_NORETURN __fastfail(unsigned i
636640#define __MINGW_PREFETCH_IMPL 1
637641#endif
638642#if __MINGW_PREFETCH_IMPL == 1
639- #if defined(__arm__) || defined(__aarch64__)
643+ #if defined(__arm__) || defined(__aarch64__) || defined(__arm64ec__)
640644void __cdecl __prefetch (const void *addr);
641645__MINGW_INTRIN_INLINE void __cdecl __prefetch (const void *addr)
642646{
643647#if defined(__arm__)
644648 __asm__ __volatile__ (" pld [%0]" ::" r" (addr));
645- #elif defined(__aarch64__)
649+ #elif defined(__aarch64__) || defined(__arm64ec__)
646650 __asm__ __volatile__ (" prfm pldl1keep, [%0]" ::" r" (addr));
647651#endif
648652}
0 commit comments