This is the mail archive of the
mailing list for the GCC project.
Machine Description for Freedom CPU
- To: gcc at gcc dot gnu dot org
- Subject: Machine Description for Freedom CPU
- From: Lee Randolph Salzman <lsalzman+ at andrew dot cmu dot edu>
- Date: Tue, 21 Nov 2000 15:34:31 -0500 (EST)
I'm currently working on writing a machine description for the Freedom CPU.
One of the particular little quirks of the F-CPU is that it has no PC-relative
branch instruction. Instead, such branches must be done by first loading
(PC + displacement) into a register (of which there exists a dedicated
instruction to do) and then doing an indirect jump through that register.
Currently I have this described via a define_expand that maps:
(set (pc) (label_ref ...))
(set (reg ...) (label_ref ...))
(set (pc) (reg ...))
and a corresponding define_insn to handle the (set (reg ...) (label_ref ...))
This scheme works fine and dandy and even emits correct code in the absence
of optimizations. However, the second optimization is turned on, the
transitive use of the label_ref is transformed into a direct use, i.e.
the (set (pc) (label_ref ...)) I was trying to get rid of in the first place.
So, the essential questions here:
1) How do I stop GCC from performing this transformation or otherwise how
can I get it to undo it after optimization? The first choice is preferred
because the registers holding labels should ideally be moved outside
of loops, but can GCC still do the analyses it needs to do without getting
rid of indirect jumps (even if it knows the value of the particular
2) Can this be done at all? :)
Lee Salzman (firstname.lastname@example.org)