Mail Archives: djgpp/1998/09/29/22:55:13
In a previous article, tomstdenis AT my-dejanews DOT com () says:
>Sometimes I see things like:
>
>movl %eax,%eax
This might be done to set flags. Also no
C compiler can come close to what any average program
can do if he takes his time. Since the programer is really
using addtional information that the complier can never
really know. And that is true of any high level language.
>
>in the outputed code? That's really bad.
>
>Also, the following code:
>
>int test()
>{
> return test2() % 4;
>}
>
>makes:
>
>_test:
> pushl %ebp
> movl %esp,%ebp
> call _test2
> movl %eax,%edx
> testl %edx,%edx
> jge L2
> leal 15(%edx),%eax
>L2:
> andb $240,%al
> subl %eax,%edx
> movl %edx,%eax
> leave
> ret
>
>
>The % 16, could be simplified into one bitshift, ala
>
>_test:
> pushl %ebp
> movl %esp,%ebp
> call _test2
> shll $4,%eax
most compilers never really take advantage of the
full instruction set. I have noticed on old Univac
systems when fortran V was hot the old time complier
writers really made good use of the instruction sets.
But as time marched on the compliers became worse and
worse at using the full set of instructions. I think it
is beacuse machines are so much faster and have so much
more memory that little attension goes to optimizing.
Also most high level compliers now a days are written
fast and for many machine types so attension to one
machine is hard to justify spending much time on.
This is just my point of view I am sure others see
it from a different point of view.
--
http://cryptography.org/cgi-bin/crypto.cgi/Misc/scott19u.zip
for the version with a real key of voer one million bytes.
also scott16u.zip and scott4u.zip
- Raw text -