Abstract:
Binary translation is an important way for software migration between different hardware platforms. For binary translation systems, how to simulate the flag register on target platform that does not have the function of the flag register, is a key factor affecting system performance. Previous flag analysis techniques delete the unnecessary flag computing via the flow analysis of flag definition and usage during the process of flag translation. However, for the necessary flag computing, these techniques still have to translate for simulation, which can lead to the expanse of generated native code and the loss of system performance. A pattern translation method is presented for necessary flag computing in binary translation system. Based on previous flag analysis techniques, this method makes flag definition instruction and flag usage instruction a flag pattern, and chooses appropriate instruction groups on target platform to translate flag computing based on the semantics of the flag pattern. This method for flag translation can reduce the expanse of generated native code and improve the performance of binary translation system. The experiment results demonstrate that, for the programs in SPEC CINT2006, this method can reduce the amount of generated native code by 7.5% and improve the system performance by 10% on average.