Changes between Version 3 and Version 4 of Commentary/Compiler/Backends/LLVM/GHC_LLVMPorting


Ignore:
Timestamp:
Jun 28, 2011 1:12:11 AM (3 years ago)
Author:
dterei
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/Backends/LLVM/GHC_LLVMPorting

    v3 v4  
    2929 'includes/stg/MachRegs.h'. 
    3030 
    31  2. You will need to implement a custom calling convention for LLVM for your platform 
     312. You will need to implement a custom calling convention for LLVM for your platform 
    3232 that supports passing arguments using the register map you 
    3333 decided on. You can see the calling convention I have created for X86 
    3434 in the llvm source file 'lib/Target/X86/X86CallingConvention.td'. 
    3535 
    36  3. Get GHC's build system running on your platform in registerised mode. 
     363. Get GHC's build system running on your platform in registerised mode. 
    3737 
    38  4. Add new inline assembly code for your platform to ghc's RTS. See files like 
     384. Add new inline assembly code for your platform to ghc's RTS. See files like 
    3939 'rts/StgCRun.c' that include assembly code for the architectures GHC 
    4040 supports. This is the main place as its where the boundary between the 
     
    4343 existing assembly and add code for your platform appropriately. 
    4444 
    45  5. Will need to change a few things in LLVM code gen. 
     455. Will need to change a few things in LLVM code gen. 
    4646 
    47  5.1 'compiler/llvmGen/LlvmCodeGen/Ppr.hs' defines a platform specific 
     475.1 'compiler/llvmGen/LlvmCodeGen/Ppr.hs' defines a platform specific 
    4848 string that is included in all generated llvm code. Add one for your platform. 
    4949 This string specifies the datalayout parameters for the platform (e.g 
    5050 pointer size, word size..). If you don't include one llvm should still 
    5151 work but wont optimise as aggressively. 
    52  5.2 'compiler/llvmGen/LlvmCodeGen/CodeGen.hs' has some platform 
     525.2 'compiler/llvmGen/LlvmCodeGen/CodeGen.hs' has some platform 
    5353 specific code on how write barriers should be handled. 
    5454 
    55  6. Probably some stuff elsewhere in ghc that needs to be changed (most 
     556. Probably some stuff elsewhere in ghc that needs to be changed (most 
    5656 likely in the main/ subfolder which is where most the compiler driver 
    5757 lives or in codegen/ which is the Cmm code generator). 
    5858 
    59  7. This is just what I know needs to be done, I'm sure there is many 
     597. This is just what I know needs to be done, I'm sure there is many 
    6060 small pieces missing although they should all fall into one of the 
    6161 above categories. In the end just trial and error your way to success.