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

git at git.haskell.org git at git.haskell.org
Mon Nov 16 00:48:20 UTC 2015


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

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

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

commit fe52a8138d1fddb9ddabd55330af73cc99974052
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).


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

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

diff --git a/compiler/ghci/ByteCodeItbls.hs b/compiler/ghci/ByteCodeItbls.hs
index 01420f5..ed6a97c 100644
--- a/compiler/ghci/ByteCodeItbls.hs
+++ b/compiler/ghci/ByteCodeItbls.hs
@@ -229,6 +229,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