public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* is movccsi a standard names?
@ 2003-08-05  6:58 Shen Hui
  2003-08-10  6:48 ` Jim Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Shen Hui @ 2003-08-05  6:58 UTC (permalink / raw)
  To: gcc

gcc,hello!
      i want to know the real defination of standard names (RTL),
and if movccsi is a stantard name (see gcc-2.95.3 arm.md),then why cannot emit conditional move rtl in generation.

for example (t.c):

	int foo(int a)
	{
		int b;
		if (a>0)
			b=1;
		else
			b=2;
		return b;
	}

arm-linux-gcc t.c -O -S -dr
its t.c.rtl as:

(note 8 6 10 0 NOTE_INSN_BLOCK_BEG)

(insn 10 8 11 (set (reg:CC 24 cc)
        (compare:CC (reg/v:SI 32)
            (const_int 0 [0x0]))) -1 (nil)
    (nil))

(jump_insn 11 10 14 (set (pc)
        (if_then_else (le (reg:CC 24 cc)
                (const_int 0 [0x0]))
            (label_ref 17)
            (pc))) 247 {*condbranch} (nil)
    (nil))

(insn 14 11 15 (set (reg/v:SI 33)
        (const_int 1 [0x1])) -1 (nil)
    (nil))

(jump_insn 15 14 16 (set (pc)
        (label_ref 21)) -1 (nil)
    (nil))

(barrier 16 15 17)

(code_label 17 16 20 3 "" [num uses: 0])

(insn 20 17 21 (set (reg/v:SI 33)
        (const_int 2 [0x2])) -1 (nil)
    (nil))

(code_label 21 20 24 4 "" [num uses: 0])

(insn 24 21 25 (set (reg/i:SI 0 r0)
        (reg/v:SI 33)) -1 (nil)
    (nil))

(insn 25 24 26 (use (reg/i:SI 0 r0)) -1 (nil)
    (nil))

(jump_insn 26 25 27 (set (pc)
        (label_ref 32)) -1 (nil)
    (nil))

(barrier 27 26 29)

(note 29 27 30 0 NOTE_INSN_BLOCK_END)

can anybody help me ?
  

 				
              Shen Hui
              shenhui@mprc.pku.edu.cn
                 2003-08-05

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

* Re: is movccsi a standard names?
  2003-08-05  6:58 is movccsi a standard names? Shen Hui
@ 2003-08-10  6:48 ` Jim Wilson
  2003-08-10 17:28   ` Richard Earnshaw
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Wilson @ 2003-08-10  6:48 UTC (permalink / raw)
  To: Shen Hui; +Cc: gcc

Shen Hui wrote:
>       i want to know the real defination of standard names (RTL),
> and if movccsi is a stantard name (see gcc-2.95.3 arm.md),then why cannot emit conditional move rtl in generation.

movcc is for moving the condition code value from one place to another.
cmov is for generating condition moves.

The .rtl file is before any optimization pass, so it won't have any cmov
instructions.  They are only created by optimizations.

Using current gcc 3.x development sources, I get movlt/movgt
instructions for this example which is apparently what you want.

Jim

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

* Re: is movccsi a standard names?
  2003-08-10  6:48 ` Jim Wilson
@ 2003-08-10 17:28   ` Richard Earnshaw
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Earnshaw @ 2003-08-10 17:28 UTC (permalink / raw)
  To: Jim Wilson; +Cc: Shen Hui, gcc, Richard.Earnshaw

> Shen Hui wrote:
> >       i want to know the real defination of standard names (RTL),
> > and if movccsi is a stantard name (see gcc-2.95.3 arm.md),then why cannot emit conditional move rtl in generation.
> 
> movcc is for moving the condition code value from one place to another.
> cmov is for generating condition moves.

There's some confusion here.  ARM has movsicc (note the order of si and cc 
is reversed).  This is an instruction that matches mov<mode>cc in the rtl 
expanders.  In fact, these instructions are not used during initial 
expansion into RTL, but are generated at later stages of optimization.

R.



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

end of thread, other threads:[~2003-08-10 16:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-05  6:58 is movccsi a standard names? Shen Hui
2003-08-10  6:48 ` Jim Wilson
2003-08-10 17:28   ` Richard Earnshaw

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