[Git][ghc/ghc][wip/fix-movq-comment] compiler: Clarify comment regarding need for MOVABS

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Sat Jun 8 11:44:09 UTC 2024



Ben Gamari pushed to branch wip/fix-movq-comment at Glasgow Haskell Compiler / GHC


Commits:
3cdd85b5 by Ben Gamari at 2024-06-08T07:43:26-04:00
compiler: Clarify comment regarding need for MOVABS

The comment wasn't clear in stating that it was only applicable to
immediate source and memory target operands.

- - - - -


1 changed file:

- compiler/GHC/CmmToAsm/X86/Instr.hs


Changes:

=====================================
compiler/GHC/CmmToAsm/X86/Instr.hs
=====================================
@@ -198,10 +198,13 @@ data Instr
 
         -- Moves.
         | MOV         Format Operand Operand
-             -- ^ N.B. when used with the 'II64' 'Format', the source
+             -- ^ N.B. Due to AT&T assembler quirks, when used with 'II64'
+             -- 'Format' immediate source and memory target operand, the source
              -- operand is interpreted to be a 32-bit sign-extended value.
-             -- True 64-bit operands need to be moved with @MOVABS@, which we
-             -- currently don't use.
+             -- True 64-bit operands need to be either first moved to a register or moved
+             -- with @MOVABS@; we currently do not use this instruction in GHC.
+             -- See https://stackoverflow.com/questions/52434073/whats-the-difference-between-the-x86-64-att-instructions-movq-and-movabsq.
+
         | MOVD   Format Operand Operand -- ^ MOVD/MOVQ SSE2 instructions
                                         -- (bitcast between a general purpose
                                         -- register and a float register).



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3cdd85b584ec09bc3170264a77cd85fb98b016da

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3cdd85b584ec09bc3170264a77cd85fb98b016da
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240608/df92f565/attachment-0001.html>


More information about the ghc-commits mailing list