X86

From Ellcc

Jump to: navigation, search

Assembly generated by sieve.c:

./x86-ecc -v -O5 -S test/sieve.c
        .text
        .align  16
        .globl  main
        .type   main,@function
main:
.Leh_func_begin1:
.Llabel1:
        pushl   %ebx
        pushl   %edi
        pushl   %esi
        subl    $8, %esp
        movl    $str, (%esp)
        call    puts
        xorl    %eax, %eax
        jmp     .LBB1_11        # body2.outer
.LBB1_1:        # next
        movl    %ecx, 4(%esp)
        movl    $.str1, (%esp)
        call    printf
        movl    $.str3, 4(%esp)
        movl    $.str2, (%esp)
        call    printf
        movl    $44, 4(%esp)
        movl    $.str4, (%esp)
        call    printf
        movl    $.str6, 4(%esp)
        movl    $.str5, (%esp)
        call    printf
        movl    $.str8, 4(%esp)
        movl    $.str7, (%esp)
        call    printf
        movl    $0, 4(%esp)
        movl    $.str9, (%esp)
        call    printf
        movl    $1, 4(%esp)
        movl    $.str10, (%esp)
        call    printf
        movl    $0, 4(%esp)
        movl    $.str11, (%esp)
        call    printf
        movl    $.str13, 4(%esp)
        movl    $.str12, (%esp)
        call    printf
        movl    $.str15, 4(%esp)
        movl    $.str14, (%esp)
        call    printf
        xorl    %eax, %eax
        addl    $8, %esp
        popl    %esi
        popl    %edi
        popl    %ebx
        ret
        .align  16
.LBB1_2:        # body2
        movb    $1, flags(%ecx)
        incl    %ecx
        cmpl    $8191, %ecx
        jne     .LBB1_2 # body2
.LBB1_3:        # body2.body6_crit_edge
        xorl    %edx, %edx
        movl    $3, %esi
        movl    %esi, %edi
        movl    %edx, %ecx
        .align  16
.LBB1_4:        # body6
        cmpb    $0, flags(%edx)
        je      .LBB1_9 # next9
.LBB1_5:        # ifTrue
        cmpl    $8190, %esi
        jg      .LBB1_8 # next12
.LBB1_6:        # ifTrue.body11_crit_edge
        movl    %esi, %ebx
        .align  16
.LBB1_7:        # body11
        movb    $0, flags(%ebx)
        addl    %edi, %ebx
        cmpl    $8191, %ebx
        jl      .LBB1_7 # body11
.LBB1_8:        # next12
        incl    %ecx
.LBB1_9:        # next9
        addl    $3, %esi
        addl    $2, %edi
        incl    %edx
        cmpl    $8191, %edx
        jne     .LBB1_4 # body6
.LBB1_10:       # next8
        incl    %eax
        cmpl    $10000, %eax
        je      .LBB1_1 # next
        .align  16
.LBB1_11:       # body2.outer
        xorl    %ecx, %ecx
        jmp     .LBB1_2 # body2
        .size   main, .-main
.Leh_func_end1:
        .type   flags,@object
        .globl flags
        .bss
        .align  16
flags:                          # flags
        .size   flags, 8191
        .zero   8191
        .type   .str1,@object
        .section        .rodata.str1.1,"aMS",@progbits,1
.str1:                          # .str1
        .size   .str1, 11
        .asciz  "%d primes\n"
        .type   .str2,@object
.str2:                          # .str2
        .size   .str2, 15
        .asciz  "__FILE__ = %s\n"
        .type   .str3,@object
.str3:                          # .str3
        .size   .str3, 13
        .asciz  "test/sieve.c"
        .type   .str4,@object
.str4:                          # .str4
        .size   .str4, 15
        .asciz  "__LINE__ = %d\n"
        .type   .str5,@object
.str5:                          # .str5
        .size   .str5, 15
        .asciz  "__DATE__ = %s\n"
        .type   .str6,@object
.str6:                          # .str6
        .size   .str6, 12
        .asciz  "Jul 13 2008"
        .type   .str7,@object
.str7:                          # .str7
        .size   .str7, 15
        .asciz  "__TIME__ = %s\n"
        .type   .str8,@object
.str8:                          # .str8
        .size   .str8, 9
        .asciz  "06:32:19"
        .type   .str9,@object
.str9:                          # .str9
        .size   .str9, 16
        .asciz  "__ELLCC__ = %d\n"
        .type   .str10,@object
        .align  16
.str10:                         # .str10
        .size   .str10, 22
        .asciz  "__ELLCC_MINOR__ = %d\n"
        .type   .str11,@object
        .align  16
.str11:                         # .str11
        .size   .str11, 27
        .asciz  "__ELLCC_PATCHLEVEL__ = %d\n"
        .type   .str12,@object
        .align  16
.str12:                         # .str12
        .size   .str12, 31
        .asciz  "__ELLCC_VERSION_STRING__ = %s\n"
        .type   .str13,@object
.str13:                         # .str13
        .size   .str13, 6
        .asciz  "0.1.0"
        .type   .str14,@object
        .align  16
.str14:                         # .str14
        .size   .str14, 25
        .asciz  "__ELLCC_VERSIONG__ = %s\n"
        .type   .str15,@object
        .align  16
.str15:                         # .str15
        .size   .str15, 24
        .asciz  "0.1.0 ALPHA Jul 13 2008"
        .type   str,@object
        .align  16
str:                            # str
        .size   str, 17
        .asciz  "10000 iterations"
        .section        .eh_frame,"aw",@progbits
EH_frame0:
.Lsection_eh_frame:
.Leh_frame_common:
        .long   .Leh_frame_common_end-.Leh_frame_common_begin
.Leh_frame_common_begin:
        .long   0x0
        .byte   0x1
        .asciz  "zR"
        .uleb128        1
        .sleb128        -4
        .byte   0x8
        .uleb128        1
        .byte   0x1b
        .byte   0xc
        .uleb128        4
        .uleb128        4
        .byte   0x88
        .uleb128        1
        .align  4
.Leh_frame_common_end:

main.eh:
        .long   .Leh_frame_end1-.Leh_frame_begin1
.Leh_frame_begin1:
        .long   .Leh_frame_begin1-.Leh_frame_common
        .long   .Leh_func_begin1-.
        .long   .Leh_func_end1-.Leh_func_begin1
        .uleb128        0
        .byte   0xe
        .uleb128        24
        .byte   0x86
        .uleb128        4
        .byte   0x87
        .uleb128        3
        .byte   0x83
        .uleb128        2
        .byte   0x4
        .long   .Llabel1-.Leh_func_begin1
        .byte   0xd
        .uleb128        4
        .align  4
.Leh_frame_end1:
Personal tools