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

git at git.haskell.org git at git.haskell.org
Sun Nov 1 20:53:55 UTC 2015


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

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

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

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


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

c8d42fe36cbd642f8ccf3af81b5b14c843def1ce
 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