public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc and assembly
@ 2002-04-03 12:14 Stephen Turner
  2002-04-03 16:08 ` Claudio Bley
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Turner @ 2002-04-03 12:14 UTC (permalink / raw)
  To: gcc-help

i heard you can optimize the code to assembly, i also
heard the more you optimize the bigger it gets? i
wanted to optimize linux into the pure asm code, so
that it would be smaller faster and cleaner, well
maybe not cleaner but smaller and faster. whats the
command to do this if there is one?  thanks for your
time and help :)

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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

* Re: gcc and assembly
  2002-04-03 12:14 gcc and assembly Stephen Turner
@ 2002-04-03 16:08 ` Claudio Bley
  2002-04-05 16:09   ` Stephen Turner
  0 siblings, 1 reply; 4+ messages in thread
From: Claudio Bley @ 2002-04-03 16:08 UTC (permalink / raw)
  To: Stephen Turner; +Cc: gcc-help

>>>>> "Stephen" == Stephen Turner <artic_knight@yahoo.com> writes:

    Stephen> i heard you can optimize the code to assembly, 

No, it is just a translation (compilation) into just another
language. This by itself does not lead to a performance gain in any
way.

There are four stages when producing executable files: preprocess,
compile, assemble, link. You may tell gcc to stop after the
compilation step, which will produce assembler output.

    Stephen> i also heard the more you optimize the bigger it gets? 

This depends on the optimization methods used and on the code. But
yes, this may be the case.

    Stephen> i wanted to optimize linux into the pure asm code, 
    Stephen> so that it would be smaller faster and cleaner, 
    Stephen> well maybe not cleaner but smaller and faster. 

This is an illusion. You can't do that without getting your hands
dirty (e.g. by hand writing asm code).

    Stephen> whats the command to do this if there is one?  

RTFM. 'gcc -S <file*>' will produce assembler code for each
non-assembler input file specified.

HTH
Claudio

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

* Re: gcc and assembly
  2002-04-03 16:08 ` Claudio Bley
@ 2002-04-05 16:09   ` Stephen Turner
  2002-04-05 17:31     ` John Love-Jensen
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Turner @ 2002-04-05 16:09 UTC (permalink / raw)
  To: gcc-help

i have a stupid question. when a person programs in
asm or machine code they make a smaller and faster
program cause they can optimize it better than an
assembler, but cant an assembler be made better, maybe
even close to a humans quality in programing and
optimization? i was just curious, seen a fast machine
coded distro on a disk a while back and wondered why
compiling your own code optimized wasnt as fast..

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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

* Re: gcc and assembly
  2002-04-05 16:09   ` Stephen Turner
@ 2002-04-05 17:31     ` John Love-Jensen
  0 siblings, 0 replies; 4+ messages in thread
From: John Love-Jensen @ 2002-04-05 17:31 UTC (permalink / raw)
  To: Stephen Turner; +Cc: gcc-help

Hi Stephen,

Your question is off topic, but I'll give you my $0.02.

I gave up writing in assembly language around 1988 ... I thought that I
could write more efficient code than my C compiler.

After spending two days hand tweaking a blitter algorithm, I implemented
the same thing in C -- just to double check my work and count cycles to
see how superior my lovingly hand coded assembly was over crufty, cookie
cutter C (with all optimizations enabled).

Well, knock me down with a feather -- the compiler's code was x2.3
faster than my code.  That was the last assembly I ever did.

Now, I'm not ruling out the possibility that I'm just  lame assembly
programmer.  But, until then, I had fancied myself competent, until the
compiler humbled me.

Sincerely,
John "Eljay" Love-Jensen
Adobe Systems

Stephen Turner wrote:

> i have a stupid question. when a person programs in
> asm or machine code they make a smaller and faster
> program cause they can optimize it better than an
> assembler, but cant an assembler be made better, maybe
> even close to a humans quality in programing and
> optimization? i was just curious, seen a fast machine
> coded distro on a disk a while back and wondered why
> compiling your own code optimized wasnt as fast..

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

end of thread, other threads:[~2002-04-06  1:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-03 12:14 gcc and assembly Stephen Turner
2002-04-03 16:08 ` Claudio Bley
2002-04-05 16:09   ` Stephen Turner
2002-04-05 17:31     ` John Love-Jensen

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