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

Computer Engineering & Science

Previous Articles     Next Articles

Optimization of binary translation conditional
transfer instructions based on TCG technology

ZHANG Jia-hao,SHAN Zheng,YUE Feng,FU Li-guo,WANG Jun,LI Ming-liang   

  1. (State Key Laboratory of Mathematical Engineering and Advanced Computing,Zhengzhou 450001,China)
  • Received:2019-01-15 Revised:2019-04-01 Online:2019-08-25 Published:2019-08-25

Abstract:

The application of TCG intermediate representation technology in binary translation can realize the migration of programs between multiple target platforms. In addition, it makes the introduction of new platforms more conveniently and ensure the compatibility between new platforms and mainstream platforms. However, due to a lack of consideration for the association of code in the translation process, the traditional intermediate representation generates back-end codes with many redundant instructions which affect the execution efficiency of the translation program. We firstly analyze the feasibility of instruction optimization and optimize conditional jump instructions. Secondly, we improve intermediate representation via instruction preprocessing, and implement the many-to-many translation model instead of one-to-many translation model to realize the transformation from intermediate representation to back-end code generation. We adopt the instruction reduction technique to design corresponding optimized translation algorithms for the two modes (CMP-JX and TEST-JX) of conditional jump instructions, and realize them on the open source binary platform QEMU. Experiments on the NPB-3.3 and SPEC CPU 2006 test sets show that the code expansion rate is reduced by an average of 14.62% and the running speed of translation programs is improved by 17.23% in comparison with the existing translation modes, which verifies the effectiveness of the proposed method.
 

Key words: binary translation, TCG intermediate representation, conditional jump instruction, code preprocessing, instruction optimization