{- GHC 9.12.2 gcc (GCC) 15.2.1 20250813 (also reproducible on play.haskell.org with GHC 9.12.2) ghc -O0 fails with the following assembler error Error: operand type mismatch for `movsd' | 101 | movsd %rbx,%rcx | ^ ghc -O1 succeeds ghc -O2 fails with the following assembler error /tmp/ghc20360_tmp_0_0/ghc_tmp_0_1.s: Assembler messages: /tmp/ghc20360_tmp_0_0/ghc_tmp_0_1.s:103:0: error: Error: operand type mismatch for `movsd' | 103 | movsd %rsi,%r8 | ^ /tmp/ghc20360_tmp_0_0/ghc_tmp_0_1.s:106:0: error: Error: operand type mismatch for `movsd' | 106 | movsd %rbx,%rdx | ^ /tmp/ghc20360_tmp_0_0/ghc_tmp_0_1.s:116:0: error: Error: operand type mismatch for `movsd' | 116 | movsd %rbx,%rsi | ^ : error: `gcc' failed in phase `Assembler'. (Exit code: 1) -} {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} module Wat where import qualified GHC.Base as B int16ToInt64# :: B.Int16# -> B.Int64# int16ToInt64# n = B.intToInt64# (B.int16ToInt# n) int64ToInt16# :: B.Int64# -> B.Int16# int64ToInt16# n = B.intToInt16# (B.int64ToInt# n) liftA2_I16_I64X2 :: (B.Int16# -> B.Int16# -> B.Int16#) -> B.Int64X2# -> B.Int64X2# -> B.Int64X2# liftA2_I16_I64X2 f a b = let !(# al, ar #) = B.unpackInt64X2# a !(# bl, br #) = B.unpackInt64X2# b al16 = int64ToInt16# al ar16 = int64ToInt16# ar bl16 = int64ToInt16# bl br16 = int64ToInt16# br xl = int16ToInt64# (f al16 bl16) xr = int16ToInt64# (f ar16 br16) in B.packInt64X2# (# xl, xr #)