[commit: ghc] wip/aarch64-regd: Implement AArch64 codegen in `mkJumpToAddr` (for GHCi). (96ad129)

git at git.haskell.org git at git.haskell.org
Fri Oct 23 02:54:36 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/aarch64-regd
Link       : http://ghc.haskell.org/trac/ghc/changeset/96ad129c90dc0ef524e3edd2c31959c9763dc21e/ghc

>---------------------------------------------------------------

commit 96ad129c90dc0ef524e3edd2c31959c9763dc21e
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Mon Oct 12 15:17:30 2015 +1100

    Implement AArch64 codegen in `mkJumpToAddr` (for GHCi).


>---------------------------------------------------------------

96ad129c90dc0ef524e3edd2c31959c9763dc21e
 compiler/ghci/ByteCodeItbls.hs | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/compiler/ghci/ByteCodeItbls.hs b/compiler/ghci/ByteCodeItbls.hs
index a01fcd8..a97c79a 100644
--- a/compiler/ghci/ByteCodeItbls.hs
+++ b/compiler/ghci/ByteCodeItbls.hs
@@ -232,6 +232,23 @@ mkJumpToAddr dflags a = case platformArch (targetPlatform dflags) of
                 , 0x11, 0xff, 0x2f, 0xe1
                 , byte0 w32, byte1 w32, byte2 w32, byte3 w32]
 
+    ArchARM64 { } ->
+        -- Generates:
+        --
+        --      ldr     x1, label
+        --      br      x1
+        -- label:
+        --      .quad <addr>
+        --
+        -- which looks like:
+        --     0:       58000041        ldr     x1, <label>
+        --     4:       d61f0020        br      x1
+       let w64 = fromIntegral (funPtrToInt a) :: Word64
+       in Right [ 0x58000041
+                , 0xd61f0020
+                , fromIntegral w64
+                , fromIntegral (w64 `shiftR` 32) ]
+
     arch ->
         panic ("mkJumpToAddr not defined for " ++ show arch)
 



More information about the ghc-commits mailing list