Hi all,

please review and comment on
https://github.com/msys2/MINGW-packages/pull/8317 .

The idea of this binutils patch is to create unaligned rather than aligned
instructions at the assembler stage (as.exe) regardless of the created
assembler code by the user or the compiler. This is done by replacing the
opcodes with the opcodes of unaligned versions of the following
instructions:

VMOVDQA   >>  VMOVDQU
VMOVAPS   >>  VMOVUPS
VMOVAPD   >>  VMOVUPD
VMOVAPD32  >>  VMOVUPD32
VMOVAPD64  >>  VMOVUPD64

This replacement is unconditional. That means ALL occurrences of these
aligned instructions will be replaced, regardless of whether they work on
XMM, YMM, or ZMM registers. According to Intel the performance is not
affected in case of aligned memory accesses. On the other hand unaligned
memory access will of course work also on Win64 with these instructions.

There are some other aligned instructions which cannot be replaced easily
as they have no unaligned counterpart - the non-temporal streaming
instructions:

VMOVNTPS, VMOVNTPD, VMOVNTDQ, VMOVNTDQA

However, these instructions will only be generated by the coder with i.e.:
_mm256_stream_si256 / _mm512_stream_si512 / _mm512_stream_pd /
_mm512_stream_ps
or directly with assembler code.

To avoid segfaults one has to fall back on the SSE2 streaming instructions
on Win64

Cheers

Carl


Am Mi., 18. Apr. 2018 um 15:19 Uhr schrieb Liu Hao <lh_mo...@126.com>:

> 在 2018/4/8 21:39, Royi Avital via Mingw-w64-public 写道:
> > Hello,
> > Currently MinGW64 cant generate proper code with AVX / AVX2 on Windows
> 64 Bit due to alignment issues.
> >
> > Is there a plan to fix this significant issue in the near term?
> >
>
> This is a GCC issue:
> <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412>
>
> It is not fixable on the CRT side.
>
> > This issue is a rel problem for anyone generating code with intense
> number crunching which is a usually big motivation for using GCC.
> > I'd guess many scientists will be happy if it is solved.
> >
> > Thank You.
> >
> > Royi
> >
>
>
> --
> 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
>

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to