public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Spundun Bhatt <spundun@ISI.EDU>
To: Spundun Bhatt <spundun@ISI.EDU>
Cc: Hans-Peter Nilsson <hp@bitrange.com>, gcc@gcc.gnu.org
Subject: PLEASE DISREGARD MY PREVIOUR MAIL Re: machine description porting question.
Date: Tue, 22 Oct 2002 15:14:00 -0000	[thread overview]
Message-ID: <3DB5A3E0.90603@isi.edu> (raw)
In-Reply-To: <3DB5A332.2080308@isi.edu>

hit the send button before completing the mail!! :( very sorry about that.
Spundun

Spundun Bhatt wrote:

> 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.
>
>
>


  reply	other threads:[~2002-10-22 19:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.BSF.4.44.0210190225060.1915-100000@dair.pair.com>
2002-10-22 14:58 ` Spundun Bhatt
2002-10-22 15:14   ` Spundun Bhatt [this message]
2002-10-22 15:44   ` David Edelsohn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DB5A3E0.90603@isi.edu \
    --to=spundun@isi.edu \
    --cc=gcc@gcc.gnu.org \
    --cc=hp@bitrange.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).