共查询到18条相似文献,搜索用时 93 毫秒
1.
在对IA-64二进制代码进行翻译的过程中,一个重要的问题就是识别和恢复通过跳转表实现的switch语句。分析了编译器生成跳转表时采用的策略,提出了前向预取同反向切片及表达式置换相结合以识别和恢复switch语句的技术,归纳了用于获取跳转表地址的规格化形式,给出了跳转表分支目标地址恢复方法,从而可将包含跳转表的IA-64二进制代码恢复为高级switch语句。该技术已经在二进制翻译框架I2A上进行了测试,可以处理编译器gcc 2.96及gcc 3.2.3在多种优化级别下生成的IA-64代码。 相似文献
2.
二进制翻译技术能够有效解决二进制兼容问题,促进新型体系结构的发展,也是虚拟机技术的重要组成部分,具有重要的研究和应用价值,但是其效率仍然有待提升,特别是目标代码生成的效率。设计了一种高效的目标代码生成算法——代码生成的子图覆盖算法(subgraph covering for code generation,SCCG),能够以尽可能少的代价生成精简的目标代码。该算法应用数据流图对二进制代码中的基本块进行建模,获取指令间的数据相关,并采用基于子图覆盖的贪心算法得到目标代码。在TransARM原型系统中进行了实现和测试,结果表明该算法获得了更优质的目标代码,并且成本得到了有效控制。 相似文献
3.
4.
二进制翻译是在不同硬件平台之间实现软件迁移的重要手段.在二进制翻译系统中,如何在没有标志位寄存器的目标平台上模拟实现源平台上标志位寄存器的功能,是影响系统性能的关键.现有的标志位分析技术通过对标志位的定值引用进行数据流分析,尽可能多地消除冗余的标志位定值.但是,对于那些会被引用的标志位定值,现有的技术仍然需要进行翻译.这不仅会导致翻译生成代码的膨胀,还会影响二进制翻译系统的性能.提出了一种二进制翻译中基于模式化的标志位翻译方法.该方法在标志位分析技术基础上,通过将源平台上标志位定值指令和引用指令组合成固定的标志位模式,然后根据模式的具体语义选择目标平台上具有相同语义功能的指令组合进行翻译.这种模式化的翻译方法,不仅可以降低因翻译标志位而引入的代码膨胀,还可以提升二进制翻译系统的性能.实验结果表明,对于SPEC CINT2006中的程序,该方法不仅可以使翻译生成的代码量平均减少7.5%,还可以将程序的性能平均提升10%. 相似文献
5.
6.
为了有效进行目标码分析与验证,提出了通过扩展CPU模块获取目标码控制流图及结构覆盖率的方法.采用CPU分支指令功能扩展,并新增动态地址跳转记录单元,实现目标码控制流信息的有效采集,结合目标码流图构造算法,完成结构覆盖率计算.分析结果表明,该方法不依赖于开发工具链信息和无需代码插桩,对CPU运行性能影响小且目标码流图构造算法为线性复杂度. 相似文献
7.
在对IA-64二进制代码进行分析的过程中,一个基本的问题就是识别通过跳转表实现的switch语句中n-条件分支的目标地址,该问题的解决使得对指定过程的机器指令的解码更加完整。文章基于切片和表达式置换技术,结合IA-64中为switch语句生成的汇编代码特点,给出了恢复跳转表及目标地址的方法,从而可以将包含跳转表的IA-64二进制代码恢复为高级switch语句。 相似文献
8.
9.
在二进制翻译中引入TCG中间表示技术可以实现多目标平台之间的程序移植,同时可以更加方便地引入新型平台,解决新平台对主流平台的兼容性问题。然而由于原有的中间表示在翻译过程中影响了代码的关联度,生成的后端代码中存在较多冗余指令,影响翻译程序的执行效率。分析了指令优化可行性,针对条件跳转指令进行优化,通过指令预处理对中间表示进行改进,实现中间表示到后端代码生成由一对多翻译模式到多对多翻译模式的转变,采用指令归约技术,针对条件跳转指令的2种模式CMP-JX型与TEST-JX型,分别设计相应的优化翻译算法,并在开源二进制平台QEMU上实现。基于NPB-3.3和SPEC CPU 2006测试集进行了测试,与以前的翻译模式进行对比,优化后的代码膨胀率平均减少了14.62%,翻译程序运行速度提升了17.23%,验证了该优化方法的有效性。 相似文献
10.
11.
《Computer Architecture Letters》2008,7(1):1-4
Indirect jumps are used to implement increasingly common programming language constructs such as virtual function calls, switch-case statements, jump tables, and interface calls. Unfortunately, the prediction accuracy of indirect jumps has remained low because many indirect jumps have multiple targets that are difficult to predict even with specialized hardware. This paper proposes a new way of handling hard-to-predict indirect jumps: dynamically predicating them. The compiler identifies indirect jumps that are suitable for predication along with their control-flow merge (CFM) points. The microarchitecture predicates the instructions between different targets of the jump and its CFM point if the jump turns out to be hardto-predict at run time. We describe the new indirect jump predication architecture, provide code examples showing why it could reduce the performance impact of jumps, derive an analytical cost-benefit model for deciding which jumps and targets to predicate, and present preliminary evaluation results. 相似文献
12.
Indirect jumps are used to implement increasingly-common programming language constructs such as virtual function calls, switch-case statements, jump tables, and interface calls. Unfortunately, the prediction accuracy of indirect jumps has remained low because many indirect jumps have multiple targets that are difficult to predict even with specialized hardware. This paper proposes a new way of handling hard-to-predict indirect jumps: dynamically predicating them. The compiler identifies indirect jumps that are suitable for predication along with their control-flow merge (CFM) points. The microarchitecture predicates the instructions between different targets of the jump and its CFM point if the jump turns out to be hard-to-predict at run time. We describe the new indirect jump predication architecture, provide code examples showing why it could reduce the performance impact of jumps, derive an analytical cost-benefit model for deciding which jumps and targets to predicate, and present preliminary evaluation results. 相似文献
13.
二进制翻译可以用于解决遗产代码的迁移问题,也可以实现不同硬件平台之间软件的通用.如果源平台通过标志位进行条件跳转,那么如何处理标志位就成为翻译中的一个重要问题,对翻译的代码质量起着决定性作用.提出标志位线性分析算法,复杂度为线性,基本上能够消除所有的标志位冗余计算,提高了动态执行的效率.基于动态profiling技术,消除了间接跳转的基本块标志位冗余计算.分析了spec 2000中的大部分整点测试例子,实验结果表明,EfLA(Eflag linear analysis)算法对于大运算量的程序是非常有效的. 相似文献
14.
动态二进制翻译提供了无需重新编译源代码就能将源机器生成的可执行代码自动转换到目标机器的方法,很好地解决了代码兼容性问题.其核心思想是根据程序的动态运行信息找到反复执行的代码序列,对代码序列进行翻译和优化,并将结果多次重用.指令调度作为一种有效的编译优化手段,也适用于动态二进制翻译.在对gcc的指令调度器分析研究的基础上,结合动态二进制翻译的实时性特点,提出了适合动态二进制翻译的效率高、开销小的指令调度算法. 相似文献
15.
间接过程调用的恢复问题是静态二进制翻译中的难点之一。针对使用c后端的静态二进制翻译框架,提出并实现间接过程调用恢复方法,该方法结合代码间隙分析,在后端c代码生成过程中插入映射源过程地址到目标机过程地址的代码。相对于使用解释器的方法,该方法具有实现简洁、在目标机上运行速度更快的优点。 相似文献
16.
17.
Binary translation and dynamic optimization are widely used to provide compatibility between legacy and promising upcoming architectures on the level of executable binary codes. Dynamic optimization is one of the key contributors to dynamic binary translation system performance. At the same time it can be a major source of overhead, both in terms of CPU cycles and whole system latency, as long as optimization time is included in the execution time of the application under translation. One of the solutions that allow to eliminate dynamic optimization overhead is to perform optimization simultaneously with the execution, in a separate thread. In the paper we present implementation of this technique in full system dynamic binary translator. For this purpose, an infrastructure for multithreaded execution was implemented in binary translation system. This allowed running dynamic optimization in a separate thread independently of and concurrently with the main thread of execution of binary codes under translation. Depending on the computational resources available, this is achieved whether by interleaving the two threads on a single processor core or by moving optimization thread to an underutilized processor core. In the first case the latency introduced to the system by a computational intensive dynamic optimization is reduced. In the second case overlapping of execution and optimization threads also results in elimination of optimization time from the total execution time of original binary codes. 相似文献