public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: question about gcc assembly
@ 2006-06-27 14:21 Coline Lelong-Pantel
  0 siblings, 0 replies; 3+ messages in thread
From: Coline Lelong-Pantel @ 2006-06-27 14:21 UTC (permalink / raw)
  To: tprince; +Cc: gcc-help


> Both gcc versions you quote are fairly old; if efficiency
interests you,
> you might try a current version.  Were you able to show a
significant
> difference in performance on a CPU which is important to you?

I have not checked that, my goal is to produce, if it is
possible, the same assembly code.

I would
> guess the most important reason for avoiding use of eax here
would be to
> keep that register available for other use.  The
optimization could be
> affected by compiler switches (-Os, -O2) or by selection of
-march
> option, and many other possibilities.

If I try using optimisation flags or -march, i get a
completely different code.

> Newer CPUs have hardware merging of operations, as well as
stalls on
> certain immediate data operations, so it is impossible to
know the
> performance implications from what you have presented.

What do you mean by "hardware merging of operations" ?


Accédez au courrier électronique de La Poste : www.laposte.net
3615 LAPOSTENET (0,34 €/mn)


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

* Re: question about gcc assembly
  2006-06-27  8:04 Coline Lelong-Pantel
@ 2006-06-27 13:57 ` Tim Prince
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Prince @ 2006-06-27 13:57 UTC (permalink / raw)
  To: Coline Lelong-Pantel; +Cc: gcc-help

Coline Lelong-Pantel wrote:
> Hi
> 
> I've compiled a short program with two different gcc versions
> (3.2.3 and 3.4.3) but it seems that the produced assembly code
> isn't the same.
> 
> In fact 3.4.3 produce a more important code. For example when
> gcc 3.2.3 produces :
> movl	$0x405c28f6, -4(%ebp)
> 
> gcc 3.4.3 may use:
> movl	$0x405c28f6, %eax
> movl	%eax, -4(%ebp)
> 
> I wonder why it now uses %eax register ? And is there any way
> to prevent this, in order to have similar assembly code with
> both gcc versions ? Maybe some kind of option ?
> 
> Thanks for your answers.
> 

Both gcc versions you quote are fairly old; if efficiency interests you, 
you might try a current version.  Were you able to show a significant 
difference in performance on a CPU which is important to you?  I would 
guess the most important reason for avoiding use of eax here would be to 
keep that register available for other use.  The optimization could be 
affected by compiler switches (-Os, -O2) or by selection of -march 
option, and many other possibilities.
Newer CPUs have hardware merging of operations, as well as stalls on 
certain immediate data operations, so it is impossible to know the 
performance implications from what you have presented.

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

* question about gcc assembly
@ 2006-06-27  8:04 Coline Lelong-Pantel
  2006-06-27 13:57 ` Tim Prince
  0 siblings, 1 reply; 3+ messages in thread
From: Coline Lelong-Pantel @ 2006-06-27  8:04 UTC (permalink / raw)
  To: gcc-help

Hi

I've compiled a short program with two different gcc versions
(3.2.3 and 3.4.3) but it seems that the produced assembly code
isn't the same.

In fact 3.4.3 produce a more important code. For example when
gcc 3.2.3 produces :
movl	$0x405c28f6, -4(%ebp)

gcc 3.4.3 may use:
movl	$0x405c28f6, %eax
movl	%eax, -4(%ebp)

I wonder why it now uses %eax register ? And is there any way
to prevent this, in order to have similar assembly code with
both gcc versions ? Maybe some kind of option ?

Thanks for your answers.

Coline

PS Excuse my poor english, but it isn't my native langage.

Accédez au courrier électronique de La Poste : www.laposte.net
3615 LAPOSTENET (0,34 €/mn)


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

end of thread, other threads:[~2006-06-27 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-27 14:21 question about gcc assembly Coline Lelong-Pantel
  -- strict thread matches above, loose matches on Subject: below --
2006-06-27  8:04 Coline Lelong-Pantel
2006-06-27 13:57 ` Tim Prince

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