Skip to content

Commit

Permalink
Merge #28151: build: use -muse-unaligned-vector-move for Windows bu…
Browse files Browse the repository at this point in the history
…ilds

96f2cf8 build: use -muse-unaligned-vector-move for Windows (fanquake)

Pull request description:

  We currently work around a longstanding GCC issue with aligned vector instructions, by patching the behaviour we want into GCC (see discussion in #24736). Possibly in response to the GCC thread (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412#c40), a new option was [introduced into the binutils assembler](https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c8480b58e1968f209b6365af7422678f348222c2) with the 2.38 release:
  ```
  x86: Add -muse-unaligned-vector-move to assembler

  Unaligned load/store instructions on aligned memory or register are as
  fast as aligned load/store instructions on modern Intel processors.  Add
  a command-line option, -muse-unaligned-vector-move, to x86 assembler to
  encode encode aligned vector load/store instructions as unaligned
  vector load/store instructions.
  ```

ACKs for top commit:
  theuni:
    ACK 96f2cf8.

Tree-SHA512: f5aaa125922bb17bbb51454103b3394d293184214b0dea554c36c2f130488a3ede2f39678044ec846fa0fdf4cd441d4227f4565c29d380f5a73b50bf6f3b9a67
  • Loading branch information
fanquake committed Sep 5, 2023
2 parents ecab855 + 96f2cf8 commit 9d3b216
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Expand Up @@ -725,6 +725,10 @@ case $host in

dnl We require Windows 7 (NT 6.1) or later
AX_CHECK_LINK_FLAG([-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"], [], [$LDFLAG_WERROR])

dnl Avoid the use of aligned vector instructions when building for Windows.
dnl See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412.
AX_CHECK_COMPILE_FLAG([-Wa,-muse-unaligned-vector-move], [CORE_CXXFLAGS="$CORE_CXXFLAGS -Wa,-muse-unaligned-vector-move"], [], [$CXXFLAG_WERROR])
;;
*darwin*)
TARGET_OS=darwin
Expand Down

0 comments on commit 9d3b216

Please sign in to comment.