近年,SIMD命令は組み込みプロセッサで実装され,マルチメディア向けアプリケーション処理において広く用いられている.SIMD命令は1レジスタ内に詰められた複数個のデータに対して同一の演算を実行する.一方,並べ替え命令は,異なる2つのレジスタそれぞれからデータを取り出し,1レジスタ内にデータを並べ替えて格納する,並べ替え命令を適切に使用することで演算の並列性を活用してより効率的にSIMD命令を利用できる.しかし,SIMD命令や並べ替え命令を効率的に利用するコンパイラのコード生成技術は,まだ発展途上である.本稿では,2並列のSIMD命令を対象とし,並べ替え命令を活用してSIMD命令をより効果的に利用するコード生成手法を提案する.提案手法では,並べ替え命令を扱えるようにコード選択問題を拡張する.コード選択問題は整数線形計画問題に定式化して解く.並べ替え命令を扱うことによって,最適なデータの並べ替えを行ってSIMD命令を効率的に利用するコードが生成される.評価実験では,提案手法は並べ替え命令を利用しない場合と比較して,最適化対象のベーシックブロックにおいて,生成するアセンブリコード行数をおよそ30%,実行サイクル数を20%削減することが確認された.%Recently, SIMD insturctions are often implemented in embedded proccessors and widely used for processing multimedia applications. SIMD instructions perform same operations on each data packed in one register. On the other hand, permutation instructions take some data from two registers and, perrmrtate and store them into one register. Using permutation instructions to increase the parallelism adequately, high performance can be lead by exploiting SIMD instructions. However, the code generation methodology to make the best use of SIMD insturctions has not been seen established in compilers. This paper proposes a code selection method for SIMD instructions with permutation instructions. In the proposed method, the code selection problem is extended to handle permutation instructions. Additional nodes are added DAGs which represent data flow in a basic block, then permutation instructions are assigned to the additional nodes. The code selection problems are formulated into integer programing problem and solved by IP solver, so the optimal assembly code exploiting SIMD insturctions can be obtained. Experimental results show that the proposed method reduced the code size by 20.5% and the execution cycles by 23.6% or more, comparing to the method without permutation instructions.
展开▼