Advertisement

A Binary Translation Backend Registers Allocation Algorithm Based on Priority

Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 849)

Abstract

As most binary translation systems don’t consider the difference of register requirements of basic blocks, which brings redundant memory access instructions caused by unnecessary registers overflow. To solve this problem, a binary translation backend registers allocation algorithm based on priority (BTBRAP) is proposed. Firstly, local global register is allocated statically to reduce the global register maintenance overhead, according to the statistical features of registers on the source platform. Then, the number of every register requested in basic blocks is determined, according to the relationship between intermediate representation and the source platform registers. So the priority of registers allocation is obtained. Conclusively, allocate the registers dynamically based on the priority to reduce the registers overflow. As the test results of nbench, representative recursive programs and SPEC2006 show, the algorithm effectively reduces the redundant memory access of local code, and improves the program performance with an average increase of 7.94%.

Keywords

Binary translation Register allocation QEMU TCG 

References

  1. 1.
    Altman, E.R., Kaeli, D., Sheffer, Y.: Welcome to the opportunities of binary translation. J. Comput. 33(3), 40–45 (2000)Google Scholar
  2. 2.
    Ma, J., Li, Z., Hu, C., et al.: A reconstruction method of type abstraction in binary code. J. Comput. Res. Dev. 50(11), 2418–2428 (2013)Google Scholar
  3. 3.
    Chen, J.S., Lan, X.H., Wei, Z.: Software transplant based on instruction simulation. J. Electron. Instrum. Customer (2010)Google Scholar
  4. 4.
    Muth, R.: Register liveness analysis of executable code. Manuscript, Department of Computer Science, the University of Arizona, December 1998Google Scholar
  5. 5.
    Ma, X., Wu, C., Tang, F., et al.: Two condition code optimization approaches in binary translation. J. Comput. Res. Dev. 42(2), 329–337 (2005)CrossRefGoogle Scholar
  6. 6.
    Liang, A., Guan, H., Li, Z.: A research on register mapping strategies of QEMU. In: 2nd International Symposium on Intelligence Computation and Application (2007)Google Scholar
  7. 7.
    Wen, Y., Tang, D., Ql, F.: Register mapping and register function cutting out implementation in binary translation. J. Softw. 20(2), 1–7 (2009)Google Scholar
  8. 8.
    Liao, Y., Sun Z.G., Jiang, H., et al.: All registers direct mapping method in dynamic binary translation. J. Comput. Appl. Softw. 28(11), 21–24 (2011)Google Scholar
  9. 9.
    Cai, Z., Liang, A., Qi, Z., et al.: Performance comparison of register allocation algorithms in dynamic binary translation. In: International Conference on Knowledge and Systems Engineering, pp. 113–119. IEEE (2009)Google Scholar
  10. 10.
    Liang, Y., Shao, Y., Yang, G., et al.: Register allocation for QEMU dynamic binary translation systems. Int. J. Hybrid Inf. Technol. 8(2), 199–210 (2015)Google Scholar
  11. 11.
    Bellard, F.C.: QEMU, a fast and portable dynamic translator. In: Conference on Usenix Technical Conference, p. 41. USE-NIX Association (2005)Google Scholar
  12. 12.
    Jiang, J., Wang, C., Wei, H.: An optimization strategy for local register allocation. J. Comput. Appl. Softw. 12, 215–217 (2013)Google Scholar
  13. 13.
    Zhang, X., Guo, X., Zhao, L.: Study on TCG dynamic binary translation technique. J. Comput. Appl. Softw. 30(11), 34–37 (2013)Google Scholar
  14. 14.
    Dai, T., Shan, Z., Lu, S., et al.: Register allocation algorithm of dynamic binary translation based on priority. J. Zhejiang Univ. (Eng. Sci.) 50(1), 158–165 (2016)Google Scholar
  15. 15.
    Smith, T.F., Waterman, M.S.: Identification of common molecular subsequences. J. Mol. Biol. 147, 195–197 (1981)CrossRefGoogle Scholar

Copyright information

© Springer Nature Singapore Pte Ltd. 2018

Authors and Affiliations

  1. 1.State Key Laboratory of Mathematical Engineering and Advanced ComputingZhengzhouChina

Personalised recommendations