● example
例1 请写出C function definition. 三地址码。 int f ( int x, int y ) { return x + y + 1; }
解:This will translate into the following three-address code:
entry f t1 = x + y t2 = t1 + 1 return t2
8.9 A Survey of Code Optimizations Techniques 代码优化技术考察
8.10 Simple Optimizations for the TINY Code Generator TINY代 码生成器的简单优化
8.1 Intermediate Code and Data Structures for Code Generation 中间代码和用于代码生成的数据结构
t2=fact*x
label L1
fact=t2
halt
解:Quadruple implementation for the three-address code
(rd, x , _ , _ ) (gt, x, 0, t1 ) (if_f, t1, L1, _ ) (asn, 1,fact, _ ) (lab, L2, _ , _ ) (mul, fact, x, t2 ) (asn, t2, fact, _ )
8.6 Code Generation in Commercial Compilers: Two Case Studies 商用编译器 中的代码生成:两个案例研究
8.7 TM: A Simple Target Machine TM:简单的目标机器 8.8 Code Generation for the Tiny Language TINY语言的代码生成器