lkml.org 
[lkml]   [2003]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: nasm over gas?
Hi!

> A random example form one small unrelated program (gcc 3.2):
>
> main:
> pushl %ebp
> pushl %edi
> pushl %esi
> pushl %ebx
> subl _32, %esp
> xorl %ebp, %ebp
> cmpl _1, 52(%esp)
> movl _0, 20(%esp)
> movl _1000000, %edi <----
> movl _1000000, 16(%esp) <----
> movl _0, 12(%esp)
> movl _.LC27, 8(%esp)
> je .L274
> movl _1, %esi
> cmpl 52(%esp), %esi
> jge .L272
>
> No sane human will do that.
>
> main:
> pushl %ebp
> pushl %edi
> pushl %esi
> pushl %ebx
> subl _32, %esp
> xorl %ebp, %ebp
> cmpl _1, 52(%esp)
> movl _0, 20(%esp)
> movl _1000000, %edi
> movl %edi, 16(%esp) <-- save 4 bytes
> movl %ebp, 12(%esp) <-- save 4 bytes
> movl _.LC27, 8(%esp)

Hmm, but gcc version is likely faster. No sane person would write
multiply by 5 using single lea instruction, yet gcc will do that...
Pavel
--
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.283 / U:1.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site