作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程

• 软件技术与数据库 • 上一篇    下一篇

基于C-SKY CPU的地址立即数编译优化方法

廉玉龙 1,史峥 1,李春强 2,王会斌 1,尚云海 2   

  1. (1.浙江大学超大规模集成电路设计研究所,杭州 310027; 2.杭州中天微系统有限公司软件研发部,杭州 310012)
  • 收稿日期:2014-12-15 出版日期:2016-01-15 发布日期:2016-01-15
  • 作者简介:廉玉龙(1989-),男,硕士研究生,主研方向为编译优化;史峥,副教授;李春强、王会斌,博士研究生;尚云海,硕士研究生。
  • 基金资助:
    “核高基”重大专项“高性能嵌入式CPU关键技术研究”(2010ZX01030-001-001-002)。

Compiling Optimization Method of Address Immediate Value Based on C-SKY CPU

LIAN Yulong  1,SHI Zheng  1,LI Chunqiang  2,WANG Huibin  1,SHANG Yunhai  2   

  1. (1.Institute of Very Large Scale Integration Circuit Design,Zhejiang University,Hangzhou 310027,China; 2.Department of Software Research and Development,C-SKY Microsystems Co.,Ltd.,Hangzhou 310012,China)
  • Received:2014-12-15 Online:2016-01-15 Published:2016-01-15

摘要: 精简指令集计算机架构处理器的指令长度固定,须借助常量池完成复杂指令集计算机架构处理器常见的长跳转指令功能。针对国产嵌入式CPU C-SKY的地址立即数管理问题,提出一种基于C-SKY CPU的优化方法。在编译阶段对地址立即数进行有效性验证,对符合条件的地址立 即数进行拆分并提取出公共的基地址,减少内存访问指令的生成。通过对不同函数之间的地址立即数共享,进一步降低内存消耗。实验结果表明,对于驱动程序类程序,该方法能减少3.77%的生成代码。

关键词: 精简指令集计算机, 地址立即数, 代码密度, 嵌入式系统, 编译优化

Abstract: As Reduced Instruction Set Computer(RISC) architecture processors generally use fixed-length instructions,they have to perform the function of long jump instruction in Complex Instruction Set Computer(CISC) architecture processors by a literal pool.This paper proposes an optimized method dealing with the management of addresses immediate value in C-SKY CPU.On one hand,the new algorithm validates every constant address,splits the appropriate ones and stores the common base addresses to reduce the number of memory access instructions,on the other hand,by sharing the common base addresses between different functions,the memory consumption can be reduced further.Experimental result shows that to some drivers,this method can reduce the code size by 3.77%.

Key words: Reduced Instruction Set Computer(RISC), address immediate value, code density, embedded system, compiling optimization

中图分类号: