• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2013, Vol. 35 ›› Issue (8): 8-14.

• 论文 • 上一篇    下一篇

atrix编译器中饱和算术指令映射的设计与实现

淡孝强,陈跃跃,孙海燕,阳柳,罗杰,辛乃军,王霁   

  1. (国防科学技术大学计算机学院,湖南 长沙 410073)
  • 收稿日期:2012-01-08 修回日期:2012-04-09 出版日期:2013-08-25 发布日期:2013-08-25

Design and implementation of saturation
arithmetic instructions mapping in Matrix complier       

DAN Xiaoqiang,CHEN Yueyue,SUN Haiyan,YANG Liu,LUO Jie,XIN Naijun,WANG Ji   

  1. (School of Computer Science,National University of Defense Technology,Changsha 410073,China)
  • Received:2012-01-08 Revised:2012-04-09 Online:2013-08-25 Published:2013-08-25

摘要:

Matrix是一款面向软基站的高性能DSP,饱和算术指令是Matrix体系结构中很重要的一种指令,它使得DSP算法更加安全、准确、高效。因此,Matrix编译器对饱和算术指令的映射支持就尤为关键。Matrix编译器的开发平台是gcc,现有的gcc版本只支持Fixedpoint的饱和算术指令,不支持整数和浮点的饱和算术指令。首先分析了gcc内部指令映射的机制,在此基础上提出了一种基于C扩展的饱和算术指令映射实现方案,并通过实现饱和加法指令的映射来验证所提出的方案。实验结果表明,该方案能够高效、准确地实现饱和算术指令的映射。

关键词: gcc, 饱和算术, 指令映射, C扩展

Abstract:

Matrix is a highperformance DSP processor for soft base stations. The saturation arithmetic instruction is of importance in Matrix, which enables the DSP algorithms more secure, accurate and efficient. As a result, supporting saturation arithmetic instructions mapping is critical for Matrix compiler, which is developed based on GCC. However, the current versions of GCC only support saturation arithmetic instruction with fixed-point types rather than integer or float types. Based on the internal mechanism of instructions mapping in GCC, an implementation scheme of C extensions based saturation arithmetic instructions is proposed. Further more, the proposed scheme is validated by implementing the saturation integer addition instruction mapping, and the results show that this scheme can support Matrix's saturation arithmetic instruction mapping efficiently and accurately.

Key words: gcc;saturation arithmetic;instruction mapping;C extensions