基于THUMP的编译优化技术研究
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
编译程序不仅是任何计算机系统的重要系统软件,也是处理器开发支撑环境的主要组成之一。论文研究了C、C++以及Java优化编译环境,为清华大学自主研制的32位高性能低功耗的RISC处理器-THUMP提供开发环境。
    论文介绍了THUMP的C、C++编译器的总体结构以及设计方案,并详细阐述了利用可重定向编译器GCC实现THUMP的C、C++编译器的方法和过程,包括延迟槽修改、指令互锁的实现、宏指令展开以及软件浮点库的生成等,并实现了THUMP的交叉编译器和本地编译器。
    论文讨论了如何利用THUMP体系结构的特点进一步提高目标代码生成质量的优化技术,并实现了两种窥孔优化,包括针对THUMP的多媒体指令的优化算法和基于THUMP的高速乘除处理部件的优化算法。实验数据表明所进行的优化对于典型图像处理程序和立即数与变量相乘运算较密集程序具有良好的效果。
    论文还给出了THUMP的Java优化编译器的设计方案。THUMP的Java优化编译器以ORP的动态编译系统为基础,利用其profiling机制和动态重编译机制等进行优化。论文对方案的可行性进行了合理的分析。
THUMP is a high-performance 32-bit RISC processor which is designed and developed by Tsinghua University. Compiler is not only one of the most necessary components of the system, but also important during the processor development. The thesis discusses the design and implementation of optimized C、C++ and Java compilers for THUMP.
    Firstly the thesis introduces the frame and design of the C、C++ compiler, and discusses the implementation of the compiler based on GCC, which is a retargetable compiler. The implementation considers the architecture of THUMP, including the delay slots, the instruction interlock, macro expansion, and libraries for soft-float. And addresses the process developing the cross compiler and native compiler for THUMP.
    Then the thesis presents two peephole optimizations for the C、C++ compiler based on the architecture of THUMP to improve the quality of generated codes. One optimization is on multimedia applications. Since THUMP supports two MMX instructions, the optimized compiler can generate these instructions to improve the performance. The other optimization is on multiplication of immediate operand and variable. This optimization is based on the multiply/divide unit and utilizes its pipeline. Both of these optimizations can reduce the execution time and size of object codes.
    Finally the thesis discusses the design of optimized Java compiler for THUMP. Based on the research of dynamic compilation, the design of the compiler is studied. ORP, which is a dynamic compiler, is considered to transplant from x86 to THUMP, due to the analysis of it mechanisms of profiling and recompilation. And two optimizations are designed for THUMP based on ORP.
引文
[1]. Masuhara H et al. Dynamic Compilation of a Reflective Language Using Run-Time
    Specialization. Principles of Software Evolution, 2000. Proceedings. International Symposium on , 1-2 Nov 2000: 128 -137
    [2]. Noel F et al. Automatic, Template-Based Run-Time Specialization: Implementation and
    Experimental Study. Computer Languages, 1998. Proceedings. 1998 International Conference on , 14-16 May 1998: 132-142
    [3]. Auslander J et al. Fast, Effective Dynamic Compilation. Proceedings of the ACM SIGPLAN
    '96 conference on Programming language design and implementation, May 1996
    [4]. Grant B et al. DyC: An Expressive Annotation-Directed Dynamic Compiler for C. Theoretical
    Computer Science, October 2000, Vol: 248, Issue: 1-2
    [5]. Mock M et al. Calpa: A Tool for Automating Dynamic Compilation. Microarchitecture, 2000.
    MICRO-33. Proceedings. 33rd Annual IEEE/ACM International Symposium on , 10-13 Dec. 2000: 291-302
    [6]. Gupta R, Mehofer E, et al (2002) Profile Guided Compiler Optimizations. The Compiler
    Design Handbook: Optimizations & Machine Code Generation, Auerbach Publications.
    [7]. Michal C et al. Practicing JUDO: Java Under Dynamic Optimizations. Proceedings of the
    ACM SIGPLAN '00 conference on Programming language design and implementation, August 2000
    [8]. Michael G B et al. The Jalapeno Dynamic Optimizing Compiler for JavaTM. ACM.
    Proceedings of the ACM 1999 conference on Java Grande, June 1999
    [9]. Matthew A et al. Adaptive Optimization in the Jalapeno JVM. Proceedings of the conference on Object-oriented programming, systems, languages, and applications, October 2000
    [10]. Chandra K et al. Reducing the Overhead of Dynamic Compilation. Software: Practice and Experience, Vol: 31, Issue: 8, March 2001: 717-738
    [11]. Krintz C. Coupling On-Line and Off-Line Profile Information to Improve Program
    Performance. Code Generation and Optimization, 2003. CGO 2003. International Symposium on , 23-26 Mar 2003: 69-78
    [12]. Ali-Reza A et al. Fast, Effective Code Generation in a Just-In-Time Java Compiler.
    Proceedings of the ACM SIGPLAN '98 conference on Programming language design and implementation, May 1998
    [13]. Michal C et al. The Open Runtime Platform: A Flexible High-Performance Managed
    
    
    Runtime Environment. Proceedings of the 2002 joint ACM-ISCOPE conference on Java Grande, November 2002
    [14]. Matthew A et al. Online Feedback-Directed Optimization of Java. Proceedings of the 17th
    ACM conference on Object-oriented programming, systems, languages, and applications, November 2002
    [15]. Bowen A et al. The Jalapeno virtual machine. IBM Systems Journal, Java Performance
    Issue, Vol. 39, No. 1, 2000.
    [16]. Bruening D et al. An Infrastructure for Adaptive Dynamic Optimization. Code Generation
    and Optimization, 2003. CGO 2003. International Symposium on, 23-26 Mar 2003 : 265-275
    [17]. http://gcc.gnu.org
    [18]. L. Rainer. Compiler Design Issues for Embedded Processors. IEEE Design and Test of
    Computers, Vol. 19, No, 4, 2002, pp. 51-58.
    [19]. http://www.mips.com/content/Documentation/MIPSDocumentation/ProcessorCores
    [20]. W. D. Jack and W. F. Christopher. The Design and Application of a Retargetable Peephole
    Optimizer. ACM Transactions On Programming Languages and Systems, Vol. 2, No. 2, 1980, pp. 191-202.
    [21]. 吕映芝,张素琴,蒋维杜,编译原理,清华大学出版社,1999

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700