高级检索
    谢海斌, 武成岗, 崔慧敏, 李 晶. 二进制翻译中的X86浮点栈处理[J]. 计算机研究与发展, 2007, 44(11): 1946-1954.
    引用本文: 谢海斌, 武成岗, 崔慧敏, 李 晶. 二进制翻译中的X86浮点栈处理[J]. 计算机研究与发展, 2007, 44(11): 1946-1954.
    Xie Haibin, Wu Chenggang, Cui Huimin, Li Jing. Disposing X86 FPU Stack in Binary Translation[J]. Journal of Computer Research and Development, 2007, 44(11): 1946-1954.
    Citation: Xie Haibin, Wu Chenggang, Cui Huimin, Li Jing. Disposing X86 FPU Stack in Binary Translation[J]. Journal of Computer Research and Development, 2007, 44(11): 1946-1954.

    二进制翻译中的X86浮点栈处理

    Disposing X86 FPU Stack in Binary Translation

    • 摘要: 二进制翻译系统是一种基于软件的跨平台代码迁移系统,它将一种体系结构的二进制代码翻译成另一种体系结构的二进制代码.二进制翻译可以用于解决遗产代码的迁移问题,也可以实现不同硬件平台之间软件的通用.浮点栈的处理已成为以X86为源的二进制翻译的研究中的关键性问题之一,如何处理X86浮点栈问题直接关系到以X86为源的二进制翻译系统的性能.针对X86浮点寄存器栈的特征,提出了一种扩展虚拟栈(extending virtual stack)处理方案.它采用归一的方法,保证了每个基本块中的运算所涉及到的浮点寄存器可以直接映射到目标机器中的浮点寄存器,确保了翻译的效率,并利用翻译时的分析避免了在入口处不必要的判断;同时还给出了在基本块入口处判别一个基本块是否会出现浮点栈上溢和下溢的充分必要条件,为生成更加高效的代码提供了条件.实验表明,它能够在保证正确实现其功能的前提下,获得更好的执行效率.

       

      Abstract: Binary translation system is an across-architecture code migration system based on software, which translates binary codes of one architecture into those of another architecture. Binary translation is applied for not only the legacy code porting but also software being used in different hardware platform. The research on the binary translation has significance not only for legacy code migration but also for the program performance improvement and other aspects. How to dispose X86 FPU stack is one of the critical problems of research on binary translation whose source platform is X86, and it is also critical to the performance of binary translation whose source platform is X86. An extending virtual stack method has been presented. It makes sure that every floating register in every basic block which is referred by floating computing can directly be mapped to a target floating register using unifying method. It omits unnecessary judges in the entrance of every block using translation analysis, which ensures the effectiveness of translation. Besides, the necessary and sufficient conditions of floating register stack overflow and underflow have also been presented. It does goodness to generate more effective native code. It can dispose the problem of X86 float stack in binary translation successfully. The experiments show that this method can gain better performance without influencing the correctness of programs.

       

    /

    返回文章
    返回