public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Question on .md file
@ 2003-09-21  5:01 Savithri Venkatachalapathy
  0 siblings, 0 replies; 3+ messages in thread
From: Savithri Venkatachalapathy @ 2003-09-21  5:01 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1120 bytes --]

Hi,

I had a few questions about the .md file.

1.In the .md file I noticed that there are certain
instructions defined as: define_insn "aaa_internal1",
"aaa_internal2a" etc..
What does this actually mean? What does "internal"
suggest?

2. I have 4 brach instructions:
 BNE (Branch on Not Equal)
 BEQ (Branch on EQual)
 BEQZ(Branch on EQual to Zero)
 BNEZ(Branch on Not Equal to Zero)

I have defined the first 2 instructions as define_insn
"bne" and define_insn "beq".
But I am not sure which name I should use for the last
2 instructions. 

3. Also I noticed in arm.md, sh.md, that the branch
instructions have define_expand and not define_insn.
Why is that?


I would appreciate any help in this regard.

Thanks,
savi



=====
-------------------------------------------------------------------------------
 “Personality is born out of pain. It is the fire shut up in the flint.” --- Yeats
--------------------------------------------------------------------------------

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question on .md file
  2003-09-22  3:25 Savithri Venkatachalapathy
@ 2003-09-22  3:49 ` Ian Lance Taylor
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 2003-09-22  3:49 UTC (permalink / raw)
  To: Savithri Venkatachalapathy; +Cc: gcc-help

Savithri Venkatachalapathy <snvpathy@yahoo.com> writes:

Your questions are all answered by the gcc internals manual.  Check
there first.

> 1.In the .md file I noticed that there are certain
> instructions defined as: define_insn "aaa_internal1",
> "aaa_internal2a" etc..
> What does this actually mean? What does "internal"
> suggest?

The only names which matters are the standard names used to generate
RTL instructions.  These are defined here:
    http://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html#Standard%20Names

Other insn names are used only as comments.  A name like aaa_internal
might mean that aaa is a standard name represented by a define_expand,
and that aaa_internal is a particular implementation for a particular
CPU class.  Or it might mean something else entirely.

> 2. I have 4 brach instructions:
>  BNE (Branch on Not Equal)
>  BEQ (Branch on EQual)
>  BEQZ(Branch on EQual to Zero)
>  BNEZ(Branch on Not Equal to Zero)
> 
> I have defined the first 2 instructions as define_insn
> "bne" and define_insn "beq".
> But I am not sure which name I should use for the last
> 2 instructions. 

The name doesn't matter as such, because gcc will never generate beqz
or bnez.  It may generate a comparison instruction against a constant
zero followed by a bne or beq.  Exactly how you should handle this
depends upon your CPU and how it handles comparisons and branches.
Look at other similar MD files.

> 3. Also I noticed in arm.md, sh.md, that the branch
> instructions have define_expand and not define_insn.
> Why is that?

Well, for the ARM it's because the branch instruction wants to pick up
the comparison information saved by cmpsi define_expand.  For example,
when gcc wants to generate a branch when two operands are equal, it
will call cmpsi and then beq.  On the ARM cmpsi will save the
operands.  The beq will pick up the operands, generate the compare (in
arm_gen_compare_reg()), and generate a branch insn.  At assembler
generation time, if the branch hasn't been optimized into something
else, it will be recognized by arm_cond_branch which will generate the
actual branch.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Question on .md file
@ 2003-09-22  3:25 Savithri Venkatachalapathy
  2003-09-22  3:49 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Savithri Venkatachalapathy @ 2003-09-22  3:25 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1229 bytes --]

Hello All,

I am once again posting my question on the list and
hope to get some pointers regarding this.

A few questions about the .md file.

1.In the .md file I noticed that there are certain
instructions defined as: define_insn "aaa_internal1",
"aaa_internal2a" etc..
What does this actually mean? What does "internal"
suggest?

2. I have 4 brach instructions:
 BNE (Branch on Not Equal)
 BEQ (Branch on EQual)
 BEQZ(Branch on EQual to Zero)
 BNEZ(Branch on Not Equal to Zero)

I have defined the first 2 instructions as define_insn
"bne" and define_insn "beq".
But I am not sure which name I should use for the last
2 instructions. 

3. Also I noticed in arm.md, sh.md, that the branch
instructions have define_expand and not define_insn.
Why is that?


I would really really appreciate any help in this
regard.

Thanks,
savi


=====
-------------------------------------------------------------------------------
 “Personality is born out of pain. It is the fire shut up in the flint.” --- Yeats
--------------------------------------------------------------------------------

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-09-22  3:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-21  5:01 Question on .md file Savithri Venkatachalapathy
2003-09-22  3:25 Savithri Venkatachalapathy
2003-09-22  3:49 ` Ian Lance Taylor

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