haskell - LLVM 对 GHC 的调用约定

标签 haskell compiler-construction llvm x86-64 ghc

这是LLVM's doc "langref"中的文字:

"cc 10" - GHC convention

This calling convention has been implemented specifically for use by the Glasgow Haskell Compiler (GHC). It passes everything in registers, going to extremes to achieve this by disabling callee save registers. This calling convention should not be used lightly but only for specific situations such as an alternative to the register pinning performance technique often used when implementing functional programming languages.At the moment only X86 supports this convention and it has the following limitations:

  • On X86-32 only supports up to 4 bit type parameters. No floating point types are supported.
  • On X86-64 only supports up to 10 bit type parameters and 6 floating point parameters.


问:
  • “寄存器固定”是否意味着或指“通过寄存器中的所有内容”,可能。
  • 什么是“4 位类型参数”?我刚刚搜索了英特尔的 IA 手册,但没有找到任何东西。它是英特尔 CPU 的功能吗?
  • 最佳答案

  • “寄存器固定”似乎是指将特定的东西分配给特定的硬件寄存器;见"Register Pinning" section of these GHC LLVM back-end noteslinked discussion .
  • Dirk 是对的——你可以在 LLVM tblgen code which defines these conventions 中清楚地看到它。 (寻找 CC_X86_64_GHCCC_X86_32_GHC )。
  • 关于haskell - LLVM 对 GHC 的调用约定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6394937/

    相关文章:

    C++ 枚举 : Assign a variable or use scope resolution?

    gcc - 自动展开并输出C/C++代码

    objective-c - 如何找到无意的对象指针比较?

    Haskell:以良好的方式命名多个参数

    c# - 了解编译器优化

    c# - Option<T> 集合的功能转换

    python - 为什么LLVM在创建数组时会抛出 "arguments of incompatible type"错误?

    llvm - 如何获取表达式中所有操作数的内存地址

    haskell - 为什么更通用的类型会影响 Haskell 中的运行时?

    haskell - 如何在 Haskell 中以隐藏的方式初始化状态(就像 PRNG 一样)?