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

计算机工程 ›› 2012, Vol. 38 ›› Issue (12): 272-275. doi: 10.3969/j.issn.1000-3428.2012.12.080

• 开发研究与设计技术 • 上一篇    下一篇

基于编译指示的向量化方法

姚 远,赵荣彩   

  1. (解放军信息工程大学信息工程学院,郑州 450002)
  • 收稿日期:2011-10-25 出版日期:2012-06-20 发布日期:2012-06-20
  • 作者简介:姚 远(1972-),男,副教授,主研方向:高性能计算,并行处理;赵荣彩,教授、博士生导师
  • 基金资助:
    “核高基”重大专项“支持国产CPU的编译系统及工具链”分课题“自动并行化与二进制翻译系统”(2009ZX01036-001- 001-2)

Vectorization Method Based on Compiler Directive

YAO Yuan, ZHAO Rong-cai   

  1. (Institute of Information Engineering, PLA Information Engineering University, Zhengzhou 450002, China)
  • Received:2011-10-25 Online:2012-06-20 Published:2012-06-20

摘要: 编译器由于程序分析能力不足,无法自动实现循环向量化或者会造成盲目自动向量化。为此,提出一种基于编译指示的向量化方法。通过在代码中插入向量化编译指示语句,指导自动向量化编译工具的处理过程,自动生成高效的向量化代码。测试结果表明,该方法能够有效提高目标代码的运行性能。

关键词: 单指令多数据流, 自动向量化, 数据依赖关系, 编译指示, 循环不变量, 向量寄存器

Abstract: Aiming at the problems that vectorization compiler tool can not perform auto-vectorization or does blind auto-vectorization because of the insufficient of program analysis ability, this paper proposes a vectorization method based on the compiler directive. The compiler directive is used to guide vectorization compiler tool to perform some special actions and produce high efficiency vectorization code automaticly when it is inserted into the program. Test results show that the method can effectively improve the performance of the object code.

Key words: Single Instruction Multiple Data(SIMD), automatic vectorization, data dependence relationship, compiler directive, loop invariant, vector register

中图分类号: