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

git at git.haskell.org git at git.haskell.org
Thu Oct 15 02:11:31 UTC 2015


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

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

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

commit 0c2cdc84abfffb516ea1b45a15a71765624f7306
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).


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

0c2cdc84abfffb516ea1b45a15a71765624f7306
 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