上海交通大学学报(自然版) ›› 2015, Vol. 49 ›› Issue (02): 173-177.

• 自动化技术、计算机技术 • 上一篇    下一篇

基于转移指令特性的动态翻译算法

李战辉1,孟建熠2,陈志坚1,严晓浪1,2   

  1. (1.浙江大学 超大规模集成电路设计研究所,杭州 310027;2.复旦大学 专用集成电路与系统国家重点实验室,上海 201203)
  • 收稿日期:2014-05-26 出版日期:2015-02-28 发布日期:2015-02-28
  • 基金资助:

    中央高校基本科研业务费(2012QNA5004)

Dynamic Binary Translation Algorithm Based on Characteristic of Transfer Instructions

LI Zhanhui1,MENG Jianyi2,CHEN Zhijian1,YAN Xiaolang1,2   

  1. (1. Institute of VLSI Design, Zhejiang University, Hangzhou 310027, China; 2. State Key Laboratory of ASIC and System, Fudan University, Shanghai 201203, China)
  • Received:2014-05-26 Online:2015-02-28 Published:2015-02-28

摘要:

摘要:  针对传统方法统一转译转移指令导致翻译器效率较低的问题,基于转移目标地址在函数内外的不同特征,提出了直接映射和指令类型转译策略组合的动态翻译方法.对函数内转移指令,直接采用目标架构中对应的分支指令进行映射,通过转移前后指令翻译码的无缝链接,高效转译了条件分支指令,且无需生成源寄存器到内存同步指令;对函数间转移指令,区别对待函数转移和其他转移指令,通过将源程序函数转移指令属性继承给翻译码以提高目标机转移预测器准确率.基于EEMBC(Embedded Microprocessor Benchmark Consortium)测试基准的实验表明,该方法使转移指令翻译码执行指令数平均减少58.9%,转移预测器命中率平均提高80.7%,翻译器整体性能提高12.3%.

关键词: 动态翻译, 转移指令, 直接映射, 转移预测器

Abstract:

Abstract: The traditional dynamic binary translator(DBT) deals with different kinds of transfer instructions in the same way, which leads to great performance loss of DBT. This paper proposed a novel DBT algorithm composed of directmapping and transfertypeinheriting mechanism to efficiently handle transfer translation,based on the distinctive characteristics between innerfunction and outerfunction transfers. Innerfunction transfers were exactly mapped to the same type of transfers in the source machine, which not only reduced the transfers induced by conditional branches, but also avoids memory synchronizations. Outerfunction transfers were dealt with differently to pass function callreturn attributes from source code to translation code, thus improving the hit rate of the target machine branch predictor. The experiment results from EEMBC(embedded microprocessor benchmark consortium) show that the instructions executed in translation code of transfers has been reduced by 58.9%, the branch predictor hit rate has been increased by 80.7%, and the overall DBT performance has been improved by 12.3%.

Key words: dynamic binary translation (DBT), transfer instructions, direct mapping, branch predictor

中图分类号: