Skip to content

ghc-9.4 compiled code executes avx-instructions on unsupported platforms.

Looking at the disassembly for _hs_bytestring_long_long_uint_hex from bytestring for ghc-9.4.4 we see this:

   8e411:       49 89 f0                mov    %rsi,%r8
   8e414:       48 89 e5                mov    %rsp,%rbp
   8e417:       48 83 e4 e0             and    $0xffffffffffffffe0,%rsp
   8e41b:       48 83 ec 68             sub    $0x68,%rsp
   8e41f:       49 c1 e8 07             shr    $0x7,%r8
   8e423:       0f 84 7f 04 00 00       je     8e8a8 <sbs_elem_index@@Base+0xd58>
   8e429:       c5 e9 ef d2             vpxor  %xmm2,%xmm2,%xmm2
   8e42d:       49 c1 e0 07             shl    $0x7,%r8
   8e431:       c5 7d 6f 35 67 3e 0c    vmovdqa 0xc3e67(%rip),%ymm14        # 1522a0 <bytestringzm0zi11zi3zi1_DataziByteStringziLazzyziInternalziDeque_zdtrModule2_bytes@@Base+0x152>
   8e438:       00
   8e439:       49 01 f8                add    %rdi,%r8
   8e43c:       c5 fd 7f 54 24 28       vmovdqa %ymm2,0x28(%rsp)
   8e442:       c5 7d 6f e2             vmovdqa %ymm2,%ymm12
   8e446:       c5 7d 6f fa             vmovdqa %ymm2,%ymm15
   8e44a:       c5 fd 7f 54 24 08       vmovdqa %ymm2,0x8(%rsp)

There are some avx-only instructions in the code as a result from auto-vectorization resulting in downstream issues on CPUs without avx support.

See https://github.com/jgm/pandoc/issues/8947

We should disable avx in the release builds to avoid this. But I'm not sure how it currently gets enabled as I believe gcc still won't enable avx by default.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information