- 论坛徽章:
- 15
|
看看给优化成啥了:- .file "t.c"
- .text
- .p2align 2,,3
- .globl itoStr
- .type itoStr, @function
- itoStr:
- pushl %ebp
- movl %esp, %ebp
- pushl %edi
- pushl %esi
- pushl %ebx
- subl $28, %esp
- movl 8(%ebp), %ecx
- testl %ecx, %ecx
- movl 12(%ebp), %ebx
- movl %ecx, -20(%ebp)
- js .L10
- .L2:
- movl $10, %esi
- movl $1717986919, %edi
- .p2align 2,,3
- .L3:
- movl %ecx, %eax
- cltd
- idivl %esi
- addl $48, %edx
- movl %ecx, %eax
- movb %dl, (%ebx)
- imull %edi
- movl %edx, -28(%ebp)
- movl %ecx, %eax
- sarl $2, %edx
- movl %edx, -32(%ebp)
- cltd
- subl %edx, -32(%ebp)
- movl -32(%ebp), %ecx
- incl %ebx
- testl %ecx, %ecx
- jg .L3
- movl -20(%ebp), %ecx
- testl %ecx, %ecx
- js .L11
- movb $0, (%ebx)
- subl $12, %esp
- pushl 12(%ebp)
- call strrevers
- addl $16, %esp
- leal -12(%ebp), %esp
- movl %ebx, %eax
- popl %ebx
- popl %esi
- popl %edi
- leave
- ret
- .L10:
- negl %ecx
- jmp .L2
- .L11:
- movb $45, (%ebx)
- incl %ebx
- movb $0, (%ebx)
- subl $12, %esp
- pushl 12(%ebp)
- call strrevers
- addl $16, %esp
- leal -12(%ebp), %esp
- movl %ebx, %eax
- popl %ebx
- popl %esi
- popl %edi
- leave
- ret
- .size itoStr, .-itoStr
- .ident "GCC: (GNU) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)"
复制代码 |
|