Re: Gnu C compiler RTL question

From comp.compilers

From: lehotsky@tiac.net (Alan Lehotsky)
Newsgroups: comp.compilers
Date: 18 Sep 1998 23:04:29 -0400
Organization: Quality Software Management
References: 98-09-034
Keywords: GCC

>>>I read somewhere that the RTL is independent of the machine description, but
>>>looking at some compiled code shows that it does depend on the registers used
>>>as the stack and frame pointers.
>>>
>>>Are thes the only instances where this occurs??
>>>

GCC RTL is only independent of the machine description in principle.

e.g., RTL can describe a wide variety of architectures. The
machine description tailors RTL to a specific architecture by
providing code generation sequences for patterns (such as
adding integers, conditional tests, etc.). In addition, the
implementer of a port provides information on how to pass parameters
and how to allocate stack frames, etc.

The impressive thing about GCC and RTL is that all the machine
dependencies are segregated into about 6 files

target/target.h
target/target.c
target/target.md

plus a couple of make file fragments and shell scripts for configuration.

RTL is simple enough to provide generalized patterns and rich
enough to describe very complex code sequences. For example,
the code below show the multiply-and-accumulate instruction
for the SHARC DSP in a form that the compiler can use to
recognize opportunities to emit these instructions.

(define_insn ""
[(set (match_operand:SI 0 "mr_operand" "+f")
(plus:SI (match_dup 0)
(mult:SI (match_operand:SI 1 "datareg_operand" "d")
(match_operand:SI 2 "datareg_operand" "d"))))]
""
"%0=%0+%1*%2 (ssi);"
[(set (attr "type") (const_string "compute"))])

-- Al Lehotsky

--
Quality Software Management
http://www.tiac.net/users/lehotsky

Process Improvement | Management Consulting | Compiler Implementation
--


Return to the comp.compilers page.
Search the comp.compilers archives again.