作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2008, Vol. 34 ›› Issue (3): 102-104. doi: 10.3969/j.issn.1000-3428.2008.03.036

• 软件技术与数据库 • 上一篇    下一篇

自修改代码在Godson-X上的处理实现

张 浩,钱学海   

  1. (中国科学院计算技术研究所,北京 100080)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2008-02-05 发布日期:2008-02-05

Self-modifying Code Implementation on Godson-X

ZHANG Hao, QIAN Xue-hai   

  1. (Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100080)
  • Received:1900-01-01 Revised:1900-01-01 Online:2008-02-05 Published:2008-02-05

摘要: 主流处理器中采用的超标量流水线机制及高速缓存使得SMC操作需要特殊处理。该文基于对多种程序的SMC行为的分析和多种SMC冲突的解决方案的对比,设计了一种灵活高效的SMC解决方法。该方法对结构的复杂度及主流水线的性能的影响小,目前已被应用在支持CISC指令集的Godsonx处理器模型上。

关键词: 自修改代码, 超标量流水线, 指令高速缓存

Abstract: The act of a processor writing data into a currently executing code segment with the intent of executing that data as code is called self-modifying code. As processor architectures become more complex and start to speculatively execute code ahead of the retirement point, the rules regarding which code should execute, pre- or post-modification, become blurred. Although SMC seldom happens in current normal applications, it is necessary to handle this situation for programs with SMC. This paper analyses several methods for SMC handling, and gives a facile method that can be easily implemented. This method has been implemented on Godson-X processor model.

Key words: self modifying code, superscalar pipeline, instruction high speed cache

中图分类号: