Re: What micros do you actually hate to work with?




ammonton@xxxxxxxxxxxxxxxxxxxxxxxx wrote:
Isaac Bosompem <x86asm@xxxxxxxxx> wrote:

I used the O2 switch for optimization. Hope this helps. Seems like VS
.NET did a better job.

What do you get when optimizing for size (GCC and VS)? Optimizing for
speed on x86 can produce rather verbose code.

-a

Here is the output of VS .NET optimized for size. I will test for GCC a
bit later.
Shorter code:


00000 8b 4c 24 04 mov ecx, DWORD PTR _a$[esp-4]
00004 85 c9 test ecx, ecx
00006 8b 44 24 08 mov eax, DWORD PTR _b$[esp-4]
0000a 75 06 jne SHORT $L1429
0000c 85 c0 test eax, eax
0000e 75 15 jne SHORT $L1428
; Line 607
00010 40 inc eax
; Line 627
00011 c3 ret 0
$L1429:
; Line 610
00012 85 c0 test eax, eax
00014 75 0b jne SHORT $L1538
; Line 611
00016 8b c1 mov eax, ecx
; Line 627
00018 c3 ret 0
$L1539:
; Line 618
00019 73 04 jae SHORT $L1437
; Line 619
0001b 2b c1 sub eax, ecx
; Line 620
0001d eb 02 jmp SHORT $L1538
$L1437:
; Line 621
0001f 2b c8 sub ecx, eax
$L1538:
; Line 616
00021 3b c8 cmp ecx, eax
00023 75 f4 jne SHORT $L1539
$L1428:
; Line 627
00025 c3 ret 0

Again not to confuse anyone, this is Intel syntax (dest, src)

-Isaac

.



Relevant Pages

  • Re: [POLITICS] Re: When is the Last Time You Booted to Windows?
    ... Somebody participating in this thread suggested that the death of Objective C was an example of the failure of the GPL. ... Surely GCC is not as "good" at optimizing C code as iNTEL's closed compiler. ... And Apple, who makes much of their profits on closed systems, has been no small help in pushing GCC ahead since they recognized the legal necessity of making their Apple Public License properly compatible with the GPL. ... Still, the fact is that iNTEL has had a huge head start and has the advantage of building the processors that they are optimizing to. ...
    (Fedora)
  • Re: AES in LibTomCrypt
    ... I hope you've notified the gcc maintainers... ... >>I wouldn't go too crazy optimizing the last cycles out of the portable ... When all was said and done [and I got the MSVC optimizer bug workaround ... 460Mbit/sec through MSVC [28 and 34 cycles per byte respectively]. ...
    (sci.crypt)
  • Re: GCC front-end for FORTH?
    ... Forth used as the front-end wouldn't have to invest much effort ... When you look at native optimizing Forths, ... duplicated by the mechanisms of GCC. ... Writing a GCC Front End ("Language designers rejoice! ...
    (comp.lang.forth)
  • Re: GCC front-end for FORTH?
    ... placing limits on the Forth programmer. ... There is no need to place limits on the Forth programmer for that. ... When you look at native optimizing Forths, ... duplicated by the mechanisms of GCC. ...
    (comp.lang.forth)
  • Re: AES in LibTomCrypt
    ... I hope you've notified the gcc maintainers... ... > I wouldn't go too crazy optimizing the last cycles out of the portable ... result in a record (in the sense of Guiness Record) ...
    (sci.crypt)