Skip to main content
Log in

Hyperchaining for LLVM-Based Binary Translators on the x86-64 Platform

  • Published:
Journal of Signal Processing Systems Aims and scope Submit manuscript

Abstract

Rabbit is an LLVM-based hybrid binary translator with several innovative optimizations (including an extension to traditional block chaining, called hyperchaining) to improve the performance. In addition to platform-independent hyperchaining (indep), Rabbit also includes platform-dependent hyperchaining (dep) on both x86-64 and RISC-V architectures for both direct and indirect branches. The dep optimizations leverage architecture-specific instructions and patches to achieve the same effect as the indep optimization but gains more performance improvements. The experimental results show that the platform-dependent hyperchaining can achieve 1.08x and 1.05x speedup in comparison with platform-independent hyperchaining for direct and indirect branches, respectively. The experimental results also show that platform-dependent hyperchaining incurs little memory space overhead in comparison with platform-independent hyperchaining.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Figure. 1
Figure. 2
Figure. 3
Figure. 4
Figure. 5
Figure. 6
Figure. 7
Figure. 8
Figure. 9

Similar content being viewed by others

Data Availability

The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.

Notes

  1. Stblocks mean the translated code blocks which are generated from static binary translation. Dtblocks mean the translated code blocks which are generated from dynamic binary translation. We will discuss those notions in later sections.

  2. In contrast, a direct branch has exactly one destination.

  3. Because the length of an x86-64 instruction is not fixed, finding the starting address of an x86-64 instruction is not easy. In contrast, the starting address of a RISC-V instruction is always a multiple of 4.

  4. r64 denotes any 64-bit register.

  5. \(0.57 = 880/1560\)

References

  1. Smith, J. E., & Nair, R. (2005). Virtual Machines: Versatile Platforms for Systems and Processes. Morgan Kaufmann, San Francisco, CA, USA. https://doi.org/10.1016/B978-1-55860-910-5.X5000-9

  2. Shen, B.-Y., Hsu, W.-C., & Yang, W. (2014). A retargetable static binary translator for the arm architecture. ACM Transactions on Architecture and Code Optimization11(2). https://doi.org/10.1145/2629335

  3. Chen, J.-Y., Yang, W., Hsu, W.-C., Shen, B.-Y., & Ou, Q.-H. (2017). On static binary translation of arm/thumb mixed isa binaries. ACM Transactions on Embedded Computing Systems16(3). https://doi.org/10.1145/2996458

  4. Shen, B.-Y., Chen, J.-Y., Hsu, W.-C., & Yang, W. (2012). Llbt: An llvm-based static binary translator. In: Proc. 2012 International Conf. Compilers, Architectures and Synthesis for Embedded Systems. CASES’12, pp. 51–60. ACM, New York, NY, USA. https://doi.org/10.1145/2380403.2380419

  5. Chen, J.-Y., Shen, B.-Y., Ou, Q.-H., Yang, W., & Hsu, W.-C. (2013). Effective code discovery for arm/thumb mixed isa binaries in a static binary translator. In: Pro. 2013 International Conf. Compilers, Architectures and Synthesis for Embedded Systems. CASES’13. IEEE Press, Washington, DC, USA.

  6. Shen, B.-Y., You, J.-Y., Yang, W., & Hsu, W.-C. (2012) An llvm-based hybrid binary translation system. In: Proc. 7th IEEE International Symp. Industrial Embedded Systems (SIES’12), pp. 229–236. https://doi.org/10.1109/SIES.2012.6356589

  7. You, Y.-P., Lin, T.-C., & Yang, W. (2019). Translating aarch64 floating-point instruction set to the x86-64 platform. In: Proc. 48th International Conf. Parallel Processing: Workshops. ICPP 2019. ACM, New York, NY, USA. https://doi.org/10.1145/3339186.3339192

  8. Hiser, J. D., Williams, D. W., Hu, W., Davidson, J. W., Mars, J., & Childers, B. R. (2011). Evaluating indirect branch handling mechanisms in software dynamic translation systems. ACM Transaction Architecture and Code Optimization, 8(2), 1–28. https://doi.org/10.1145/1970386.1970390

    Article  Google Scholar 

  9. Foundation, R.-V. RISC-V Foundation - RISC-V Foundation. https://riscv.org/risc-v-foundation/

  10. Waterman, A., Asanovi’c, K., & Foundation, R.-V. (eds.). (2019). The RISC-V Instruction Set Manual Volume I: Unprivileged ISA Document Version 20191214-draft.

  11. Cai, H., Shao, Z., & Vaynberg, A. (2007) Certified self-modifying code. In: Proc. 28th ACM SIGPLAN Conf. Programming Language Design and Implementation. PLDI’07, pp. 66–77. ACM, New York, NY, USA (2007). https://doi.org/10.1145/1250734.1250743

  12. Moore, R. W., Baiocchi, J. A., Childers, B. R., Davidson, J. W., & Hiser, J. D. (2009) Addressing the challenges of dbt for the arm architecture. In: Proc. 2009 ACM SIGPLAN/SIGBED Conf. Languages, Compilers, and Tools for Embedded Systems (LCTES’09), pp. 147–156. ACM, New York, NY, USA.

  13. Baraz, L., Devor, T., Etzion, O., Goldenberg, S., Skaletsky, A., Wang, Y., & Zemach, Y. (2003) Ia-32 execution layer: A two-phase dynamic translator designed to support ia-32 applications on itanium-based systems. In: Proc. 36th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO 36). IEEE Computer Society, Washington, DC, USA.

  14. Bellard, F. (2005) Qemu, a fast and portable dynamic translator. In: Proc. USENIX Annual Technical Conf. ATEC’05, p. 41. USENIX Association, USA.

  15. DynamoRIO: dynamoRIO. https://dynamorio.org/

  16. Bala, V., Duesterwald, E., & Banerjia, S. (2011). Dynamo: A transparent dynamic optimization system. ACM SIGPLAN Notices, 46(4), 41–52. https://doi.org/10.1145/1988042.1988044

    Article  Google Scholar 

  17. Chen, J.-Y., Yang, W., Shen, B.-Y., Li, Y.-J., & Hsu, W.-C. (2015) Automatic validation for binary translation. Computer Languages, Systems and Structures, 43(C), 96–115. https://doi.org/10.1016/j.cl.2015.05.002

  18. LLVM: LLVM Language Reference Manual-LLVM 9 Documentation. https://releases.llvm.org/9.0.0/docs/LangRef.html

  19. d’Antras, A., Gorgovan, C., Garside, J., & Luján, M. (2016) Optimizing indirect branches in dynamic binary translators. ACM Transactions on Architecture and Code Optimization, 13(1). https://doi.org/10.1145/2866573

  20. Intel: Intel 64 and IA-32 Architectures Software Developer’s Manual vol. 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D, 4. Intel, Santa Clara, California, USA (2019)

  21. System V Application Binary Interface AMD64 Architecture Processor Supplement (With LP64 and ILP32 Programming Models) Version 1.0. (January 2018)

  22. Cano, N. (2016). Game Hacking: Developing Autonomous Bots for Online Games. No Starch Press, San Francisco, CA, USA.

Download references

Acknowledgements

This work was supported by Ministry of Science and Technology, Taiwan, R.O.C., under grant MOST 108-2221-E-009-050-MY3. An 8-page summary of this paper has been accepted by 2021 International Workshop on Embedded Multicore Systems (ICPP-EMS 2021), co-located with International Conf. Parallel Processing (ICPP 2021), August 9-12, 2021, Lemont, IL, USA.

Funding

This study was partially supported by the Ministry of Science and Technology of Taiwan [grant number MOST 108-2221-E-009-050-MY3].

Author information

Authors and Affiliations

Authors

Contributions

All authors contributed to the study conception and design. All authors read and approved the manuscript.

Corresponding author

Correspondence to Wuu Yang.

Ethics declarations

Competing Interest

The authors have no competing interests to declare that are relevant to the content of this article.

Ethics Approval

This research involves no human participants and/or animals.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Lai, JK., Yang, W. Hyperchaining for LLVM-Based Binary Translators on the x86-64 Platform. J Sign Process Syst 94, 1569–1589 (2022). https://doi.org/10.1007/s11265-022-01803-1

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11265-022-01803-1

Keywords

Navigation