This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: machine description porting question.


Hi, I am redirecting my message from the gcc-bugs list to here.
I still have many confusions about creating temp registers in machine description.

Hans-Peter Nilsson wrote:

On Fri, 18 Oct 2002, Spundun Bhatt wrote:

Hi,
I am porting gcc to a new platform and it seems this mailing list is the
closest match. My apologies if this is not the correct place.

gcc@ is better.

The machine that I am porting to has an instruction set similar to IBM
rs6000, so we have taken rs6000 config files as the tmplate and are
trying to make modifications to it.
My question is mainly regarding adding a temporary register in any insn
definition in the machine description file.

It's not really "mainly", but a special case.  (Getting a
temporary register is done by other solutions in other
contexts.)

I am still trying to get hold of -one- way to do this. :)


the scenario:
my machine doesnt have a compare instruction so I want to use subc
instruction (subtract and modify cc).
The compare instruction on powerpc looks similar to cmp RA,RB while
subtract instruction on my architecture looks like SUBC rD,rA,rB.
So gcc has to allocate a temporary register for rD, and I dont know how
to go about that.

You make the compare instruction pattern a define_expand which
expands to the subtract insn.  Or, since you say your machine is

I tried as you but couldnt get it working. Details follow.

rs6000-like, you use the same expand-compare-insn-in-the-cc-user
method used there, and expand to a *subtraction* (e.g.
gen_subsi3) in your equivalent to rs6000_generate_compare.  You
get the temporary result register from gen_reg_rtx (mode).

I think this expand-compare.... is some mnemonic that you came up with and I didnt understand, because I couldnt grep it in the cvs code :). Here I need to clarify that the version of gcc that I am working with is a branch from gcc 2.95.2 patched by motorola for the altivec instruction set. In 2.95.2, the rs6000_generate_compare does not exist so I couldnt try this sugession.

brgds, H-P


the following is the snipped part of my original mail.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]