RISC-V GCC通过-mabi选项指定数据模型和浮点参数传递规则。有效的选项值包括ilp32、ilp32f、ilp32d、lp64、lp64f 和 lp64d。前半部分指定数据模型,后半部分指定浮点参数传递规则。

mingdu.zheng at gmail dot com
http://blog.csdn.net/zoomdy/article/details/79353313

iintllongppointer即指针,32/64指前面给出的类型是32/64位的;ffloat,指float型浮点数参数通过浮点数寄存器传递;ddouble,指float型和double型浮点数参数通过浮点数寄存器传递。

数据模型:

x int字长 long字长 指针字长
ilp32/ilp32f/ilp32d 32bits 32bits 32bits
lp64/lp64f/lp64d 32bits 64bits 64bits

浮点参数传递规则:

x 需要浮点扩展指令? float参数 double参数
ilp32/lp64 不需要 通过整数寄存器(a0-a1)传递 通过整数寄存器(a0-a3)传递
ilp32f/lp64f 需要F扩展 通过浮点寄存器(fa0-fa1)传递 通过整数寄存器(a0-a3)传递
ilp32d/lp64d 需要F扩展和D扩展 通过浮点寄存器(fa0-fa1)传递 通过浮点寄存器(fa0-fa1)传递

浮点参数传递规则只跟-mabi选项有关,和-march选项没有直接关系,但是部分-mabi选项需要浮点寄存器,浮点寄存器是通过浮点扩展指令引入的,这就需要在-march选项中指定浮点扩展。

RISC-V GCC 使用手册对-mabi选项的说明:

-mabi=ABI-string
.
Specify integer and floating-point calling convention. ABI-string contains two parts: the size of integer types and the registers used for floating-point types. For example -march=rv64ifd -mabi=lp64d means that long and pointers are 64-bit (implicitly defining int to be 32-bit), and that floating-point values up to 64 bits wide are passed in F registers. Contrast this with -march=rv64ifd -mabi=lp64f, which still allows the compiler to generate code that uses the F and D extensions but only allows floating-point values up to 32 bits long to be passed in registers; or -march=rv64ifd -mabi=lp64, in which no floating-point arguments will be passed in registers.
.
The default for this argument is system dependent, users who want a specific calling convention should specify one explicitly. The valid calling conventions are: ilp32, ilp32f, ilp32d, lp64, lp64f, and lp64d. Some calling conventions are impossible to implement on some ISAs: for example, -march=rv32if -mabi=ilp32d is invalid because the ABI requires 64-bit values be passed in F registers, but F registers are only 32 bits wide.

RISC-V数据模型,-mabi=ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d相关推荐

  1. 数据模型 LP32 ILP32 LP64 ILP64 LLP64

    data model Datetype LP64 ILP64 LLP64 ILP32 LP32 char 8 8 8 8 8 short 16 16 16 16 16 _int32 32 int 32 ...

  2. RISC V (RV32+RV64) 架构 整体介绍

    文章目录 riscv 市场 芯片介绍 软件介绍 开发板介绍 PC介绍 riscv 架构 编程模型(指令集/寄存器/ABI/SBI) 运行状态 指令集 寄存器 riscv32和riscv64两者的区别 ...

  3. 计组学习笔记2(RISC v版)

    指令集解释 (规定:R[r]表示通用寄存器r的内容,M[addr]表示存储单元addr的内容,SEXT[imm]表示对imm进行符号扩展,ZEXT[imm]表示对imm进行零扩展) 整数运算类 -U型 ...

  4. 数据模型LP32 ILP32 LP64 LLP64 ILP64

    各个C++实现所选择采用的基础类型的大小统称为"数据模型".有四种广泛采用的数据模型: 32 位系统: LP32 或 2/4/4(int 为 16-bit,long 和指针为 32 ...

  5. 安装Ubuntu RISC V toolchain失败(网速、git配置原因)

    git获取大容量工程出错:RPC failed: curl GnuTLS recv error : Decryption has failed. error: RPC failed; curl 56 ...

  6. RISCV toolchain编译工具链搭建

    目录 写在前面 1.获取源文件 2.安装相关依赖包 3.修改环境变量 4.编译GCC 写在前面 刚刚接触RISCV编译器,根据网上RISCV toolchain工具链的搭建方法,结合自己体会,写点儿学 ...

  7. 沁恒CH32V103C8T6(二): Linux RISC-V编译和烧录环境配置

    目录 沁恒CH32V103C8T6(一): 核心板焊接和Windows开发环境配置 沁恒CH32V103C8T6(二): Linux RISC-V编译和烧录环境配置 硬件准备 CH32V103 开发板 ...

  8. riscv-gnu-toolchain工具链下载安装(unbentu)

    riscv-gnu-toolchain工具链下载安装 一.安装依赖 二.下载riscv-gnu-toolchain 三.编译安装riscv-gnu-toolchain 四.添加环境变量 五.测试安装是 ...

  9. LP32,ILP32,LP64,LLP64,ILP64数据模型

    LP32,ILP32,LP64,LLP64,ILP64数据模型 在32位和64位平台上,float都是 4 字节,double都是 8 字节:(C中直接写小数,默认是double型) LP64.LLP ...

最新文章

  1. struts2 实现自定义标签
  2. 6月机器学习热文TOP10,精选自1400篇文章
  3. PowerShell通过安全组创建计算机账号
  4. Page.LoadTemplate的使用
  5. python字节码解析_从底层入手,解析字节码增强和Btrace应用
  6. java对redis的基本操作
  7. linux 文档操作,Linux学习之文档操作
  8. html特效代码是怎么实现的,html特效代码大全
  9. ElasticSearch倒排索引原理揭秘——基于mapreduce实现自己的倒排索引
  10. 稀疏矩阵乘法运算(C语言)
  11. codelite编译器配置
  12. 哪个城市美女最多?OPPO R11开启“谁是拍照King·仲夏之梦”活动
  13. matlab解方程、方程组
  14. 读漫画中国式项目管理总结
  15. 理解分布式一致性:Paxos协议之Multi-Paxos
  16. 全球及中国大豆蛋白行业未来发展趋势及投资建议分析报告2022-2028年版
  17. 震惊!拼多多出现大Bug:100无门槛券随便领 黑产团伙盗取数千万元
  18. science都夸好用,赶紧了解下空气eDNA技术
  19. PBD(Position Based Dynamics)学习笔记
  20. 【计算机毕业设计】个人网站

热门文章

  1. QNAP-NAS外网访问——aliyun-ddns,docker,myqnapcloud
  2. NFS服务器搭建指南
  3. 【PyTorch】50行代码实现GAN——PyTorch
  4. centos 安装 Go环境
  5. 「高级java工程师」常见面试题及其答案(持续更新)
  6. 人工智能,大数据,深度学习,机器学习(百度云581G学习资料免费分享)
  7. 娱乐网站(博主自用,他人勿扰)
  8. # 北京市职业技能提升管理平台#大数据#
  9. Win2012 R2 安装Exchange Server2016
  10. windows10怎么配置二个或多个JDK版本_详细图解