Login |
Contact Us |
|
||
Essential Abstractions in GCC '10
A Workshop on GCC Internals by GCC Resource Center July 5-8, 2010, IIT Bombay |
||
Assignment on RTL IR Manipulation Problem Statement
Example: For the following two rtl instructions : (insn 5 4 6 3 1.c:15 (set (reg:SI 59)(mem/c/i:SI (plus:SI (reg/f:SI 54 virtual-stack-vars) (const_int -8 [0xfffffff8])) [0 b+0 S4 A32])) -1 (nil)) (insn 6 5 7 3 1.c:15 (set (reg:SI 61) (mem/c/i:SI (plus:SI (reg/f:SI 54 virtual-stack-vars) (const_int -4 [0xfffffffc])) [0 a+0 S4 A32])) -1 (nil)) (insn 7 6 8 3 1.c:15 (parallel [ (set (reg:SI 60) (plus:SI (reg:SI 61) (reg:SI 59))) (clobber (reg:CC 17 flags)) ]) -1 (nil)) Generate the following: r59 = *(r54 - 8)r61 = *(r54 - 4) r60 = r61 + r59 || clobber r17 Hints: A. Possible approach:
B. Solution hint: Use recursion. Trying modifying the base code. Debugging AID: use GET_RTX_NAME(int rxt_code) to print the ascii string describing the rtl object you are currently processing. Anticipated Problems:
|
||