Sparc

From Ellcc

Jump to: navigation, search

Assembly generated by sieve.c:

./sparc-elf-ecc -v -O5 -S test/sieve.c
        .text
        .align  16
        .globl  main
        .type   main, #function
main:
        save -96, %o6, %o6
        sethi %hi(str), %l0
        sethi 0, %l1
        add %l0, %lo(str), %o0
        call puts
        nop
        ba .BB1_8       ! body2.outer
        nop
.BB1_1: ! next
        sethi %hi(.str1), %l1
        add %l1, %lo(.str1), %o0
        call printf
        nop
        sethi %hi(.str2), %l1
        sethi %hi(.str3), %l0
        add %l1, %lo(.str2), %o0
        add %l0, %lo(.str3), %o1
        call printf
        nop
        sethi %hi(.str4), %l1
        add %l1, %lo(.str4), %o0
        or %g0, 44, %o1
        call printf
        nop
        sethi %hi(.str5), %l1
        sethi %hi(.str6), %l0
        add %l1, %lo(.str5), %o0
        add %l0, %lo(.str6), %o1
        call printf
        nop
        sethi %hi(.str7), %l1
        sethi %hi(.str8), %l0
        add %l1, %lo(.str7), %o0
        add %l0, %lo(.str8), %o1
        call printf
        nop
        sethi %hi(.str9), %l1
        add %l1, %lo(.str9), %o0
        sethi 0, %i0
        or %g0, %i0, %o1
        call printf
        nop
        sethi %hi(.str10), %l1
        add %l1, %lo(.str10), %o0
        or %g0, 1, %o1
        call printf
        nop
        sethi %hi(.str11), %l1
        add %l1, %lo(.str11), %o0
        or %g0, %i0, %o1
        call printf
        nop
        sethi %hi(.str12), %l1
        sethi %hi(.str13), %l0
        add %l1, %lo(.str12), %o0
        add %l0, %lo(.str13), %o1
        call printf
        nop
        sethi %hi(.str14), %l1
        sethi %hi(.str15), %l0
        add %l1, %lo(.str14), %o0
        add %l0, %lo(.str15), %o1
        call printf
        nop
        restore %g0, %g0, %g0
        retl
        nop
.BB1_2: ! body2
        add %l2, 1, %l3
        or %g0, 1, %l4
        sethi 7, %l5
        stb %l4, [%l0+%l2]
        or %l5, 1023, %l2
        subcc %l3, %l2, %l2
        or %g0, %l3, %l2
        bne .BB1_2      ! body2
        nop
.BB1_3: ! body6.preheader
        sethi %hi(flags), %l0
        add %l0, %lo(flags), %l0
        sethi 0, %l2
        or %g0, 3, %l3
        or %g0, %l3, %l4
        or %g0, %l2, %o1
.BB1_4: ! body6
        ldub [%l0+%l2], %l5
        subcc %l5, 0, %l5
        bne .BB1_10     ! ifTrue
        nop
.BB1_5: ! body6.next9_crit_edge
        ba .BB1_6       ! next9
        nop
.BB1_6: ! next9
        add %l3, 3, %l3
        add %l4, 2, %l4
        add %l2, 1, %l2
        sethi 7, %l5
        or %l5, 1023, %l5
        subcc %l2, %l5, %l5
        be .BB1_7       ! next8
        nop
        ba .BB1_9       ! next9.body6_crit_edge
        nop
.BB1_7: ! next8
        sethi 9, %l0
        add %l1, 1, %l1
        or %l0, 784, %l0
        subcc %l1, %l0, %l0
        be .BB1_1       ! next
        nop
.BB1_8: ! body2.outer
        sethi %hi(flags), %l0
        add %l0, %lo(flags), %l0
        sethi 0, %l2
        ba .BB1_2       ! body2
        nop
.BB1_9: ! next9.body6_crit_edge
        ba .BB1_4       ! body6
        nop
.BB1_10:        ! ifTrue
        sethi 7, %l5
        or %l5, 1022, %l5
        subcc %l3, %l5, %l5
        bg .BB1_13      ! next12
        nop
        ba .BB1_11      ! bb.nph
        nop
.BB1_11:        ! bb.nph
        sethi %hi(flags), %l5
        add %l5, %lo(flags), %l5
        or %g0, %l3, %l6
.BB1_12:        ! body11
        add %l4, %l6, %l7
        sethi 0, %i0
        sethi 7, %i1
        stb %i0, [%l5+%l6]
        or %i1, 1023, %l6
        subcc %l7, %l6, %l6
        or %g0, %l7, %l6
        bl .BB1_12      ! body11
        nop
.BB1_13:        ! next12
        add %o1, 1, %o1
        ba .BB1_6       ! next9
        nop


        .globl flags
.bss
        .align 16
        .type flags,#object
        .size flags,8191
flags:
        .skip   8191


.data
        .align 1
        .type .str1,#object
        .size .str1,11
.str1:
        .asciz  "%d primes\n"


        .align 1
        .type .str2,#object
        .size .str2,15
.str2:
        .asciz  "__FILE__ = %s\n"


        .align 1
        .type .str3,#object
        .size .str3,13
.str3:
        .asciz  "test/sieve.c"


        .align 1
        .type .str4,#object
        .size .str4,15
.str4:
        .asciz  "__LINE__ = %d\n"


        .align 1
        .type .str5,#object
        .size .str5,15
.str5:
        .asciz  "__DATE__ = %s\n"


        .align 1
        .type .str6,#object
        .size .str6,12
.str6:
        .asciz  "Jul 12 2008"


        .align 1
        .type .str7,#object
        .size .str7,15
.str7:
        .asciz  "__TIME__ = %s\n"


        .align 1
        .type .str8,#object
        .size .str8,9
.str8:
        .asciz  "06:07:21"


        .align 1
        .type .str9,#object
        .size .str9,16
.str9:
        .asciz  "__ELLCC__ = %d\n"


        .align 16
        .type .str10,#object
        .size .str10,22
.str10:
        .asciz  "__ELLCC_MINOR__ = %d\n"


        .align 16
        .type .str11,#object
        .size .str11,27
.str11:
        .asciz  "__ELLCC_PATCHLEVEL__ = %d\n"


        .align 16
        .type .str12,#object
        .size .str12,31
.str12:
        .asciz  "__ELLCC_VERSION_STRING__ = %s\n"


        .align 1
        .type .str13,#object
        .size .str13,6
.str13:
        .asciz  "0.1.0"


        .align 16
        .type .str14,#object
        .size .str14,25
.str14:
        .asciz  "__ELLCC_VERSIONG__ = %s\n"


        .align 16
        .type .str15,#object
        .size .str15,24
.str15:
        .asciz  "0.1.0 ALPHA Jul 11 2008"


        .align 16
        .type str,#object
        .size str,17
str:
        .asciz  "10000 iterations"
Personal tools