RISC-V数据模型,-mabi=ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d
RISC-V GCC通过-mabi
选项指定数据模型和浮点参数传递规则。有效的选项值包括ilp32、ilp32f、ilp32d、lp64、lp64f 和 lp64d。前半部分指定数据模型,后半部分指定浮点参数传递规则。
mingdu.zheng at gmail dot com
http://blog.csdn.net/zoomdy/article/details/79353313
i
指int
,l
指long
,p
指pointer
即指针,32/64
指前面给出的类型是32/64位的;f
指float
,指float型浮点数参数通过浮点数寄存器传递;d
指double
,指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相关推荐
- 数据模型 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 ...
- RISC V (RV32+RV64) 架构 整体介绍
文章目录 riscv 市场 芯片介绍 软件介绍 开发板介绍 PC介绍 riscv 架构 编程模型(指令集/寄存器/ABI/SBI) 运行状态 指令集 寄存器 riscv32和riscv64两者的区别 ...
- 计组学习笔记2(RISC v版)
指令集解释 (规定:R[r]表示通用寄存器r的内容,M[addr]表示存储单元addr的内容,SEXT[imm]表示对imm进行符号扩展,ZEXT[imm]表示对imm进行零扩展) 整数运算类 -U型 ...
- 数据模型LP32 ILP32 LP64 LLP64 ILP64
各个C++实现所选择采用的基础类型的大小统称为"数据模型".有四种广泛采用的数据模型: 32 位系统: LP32 或 2/4/4(int 为 16-bit,long 和指针为 32 ...
- 安装Ubuntu RISC V toolchain失败(网速、git配置原因)
git获取大容量工程出错:RPC failed: curl GnuTLS recv error : Decryption has failed. error: RPC failed; curl 56 ...
- RISCV toolchain编译工具链搭建
目录 写在前面 1.获取源文件 2.安装相关依赖包 3.修改环境变量 4.编译GCC 写在前面 刚刚接触RISCV编译器,根据网上RISCV toolchain工具链的搭建方法,结合自己体会,写点儿学 ...
- 沁恒CH32V103C8T6(二): Linux RISC-V编译和烧录环境配置
目录 沁恒CH32V103C8T6(一): 核心板焊接和Windows开发环境配置 沁恒CH32V103C8T6(二): Linux RISC-V编译和烧录环境配置 硬件准备 CH32V103 开发板 ...
- riscv-gnu-toolchain工具链下载安装(unbentu)
riscv-gnu-toolchain工具链下载安装 一.安装依赖 二.下载riscv-gnu-toolchain 三.编译安装riscv-gnu-toolchain 四.添加环境变量 五.测试安装是 ...
- LP32,ILP32,LP64,LLP64,ILP64数据模型
LP32,ILP32,LP64,LLP64,ILP64数据模型 在32位和64位平台上,float都是 4 字节,double都是 8 字节:(C中直接写小数,默认是double型) LP64.LLP ...
最新文章
- struts2 实现自定义标签
- 6月机器学习热文TOP10,精选自1400篇文章
- PowerShell通过安全组创建计算机账号
- Page.LoadTemplate的使用
- python字节码解析_从底层入手,解析字节码增强和Btrace应用
- java对redis的基本操作
- linux 文档操作,Linux学习之文档操作
- html特效代码是怎么实现的,html特效代码大全
- ElasticSearch倒排索引原理揭秘——基于mapreduce实现自己的倒排索引
- 稀疏矩阵乘法运算(C语言)
- codelite编译器配置
- 哪个城市美女最多?OPPO R11开启“谁是拍照King·仲夏之梦”活动
- matlab解方程、方程组
- 读漫画中国式项目管理总结
- 理解分布式一致性:Paxos协议之Multi-Paxos
- 全球及中国大豆蛋白行业未来发展趋势及投资建议分析报告2022-2028年版
- 震惊!拼多多出现大Bug:100无门槛券随便领 黑产团伙盗取数千万元
- science都夸好用,赶紧了解下空气eDNA技术
- PBD(Position Based Dynamics)学习笔记
- 【计算机毕业设计】个人网站
热门文章
- QNAP-NAS外网访问——aliyun-ddns,docker,myqnapcloud
- NFS服务器搭建指南
- 【PyTorch】50行代码实现GAN——PyTorch
- centos 安装 Go环境
- 「高级java工程师」常见面试题及其答案(持续更新)
- 人工智能,大数据,深度学习,机器学习(百度云581G学习资料免费分享)
- 娱乐网站(博主自用,他人勿扰)
- # 北京市职业技能提升管理平台#大数据#
- Win2012 R2 安装Exchange Server2016
- windows10怎么配置二个或多个JDK版本_详细图解