Created
April 20, 2011 11:00
-
-
Save itisravi/930995 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.arch armv7-a | |
.eabi_attribute 27, 3 | |
.fpu vfp3 | |
.eabi_attribute 20, 1 | |
.eabi_attribute 21, 1 | |
.eabi_attribute 23, 3 | |
.eabi_attribute 24, 1 | |
.eabi_attribute 25, 1 | |
.eabi_attribute 26, 2 | |
.eabi_attribute 30, 6 | |
.eabi_attribute 18, 2 | |
.file "plain.c" | |
.section .rodata | |
.align 2 | |
.LC0: | |
.ascii "Time for compute : %d microseconds\012\000" | |
.text | |
.align 2 | |
.global main | |
.type main, %function | |
main: | |
.fnstart | |
.LFB0: | |
@ args = 0, pretend = 0, frame = 16024 | |
@ frame_needed = 1, uses_anonymous_args = 0 | |
stmfd sp!, {fp, lr} | |
.save {fp, lr} | |
.setfp fp, sp, #4 | |
add fp, sp, #4 | |
.pad #16000 | |
sub sp, sp, #16000 | |
.pad #24 | |
sub sp, sp, #24 | |
mov r3, #0 | |
str r3, [fp, #-8] | |
b .L2 | |
.L3: | |
ldr r1, [fp, #-8] | |
ldr r3, [fp, #-8] | |
add r2, r3, #1 | |
movw r3, #:lower16:-16020 | |
movt r3, #:upper16:-16020 | |
mov r1, r1, asl #2 | |
sub r0, fp, #4 | |
add r1, r1, r0 | |
add r3, r1, r3 | |
str r2, [r3, #0] | |
ldr r3, [fp, #-8] | |
add r3, r3, #1 | |
str r3, [fp, #-8] | |
.L2: | |
ldr r2, [fp, #-8] | |
movw r3, #3999 | |
cmp r2, r3 | |
bls .L3 | |
sub r3, fp, #16 | |
mov r0, r3 | |
mov r1, #0 | |
bl gettimeofday | |
sub r3, fp, #16000 | |
sub r3, r3, #4 | |
sub r3, r3, #20 | |
mov r0, r3 | |
mov r1, #4000 | |
bl double_elements | |
sub r3, fp, #24 | |
mov r0, r3 | |
mov r1, #0 | |
bl gettimeofday | |
mov r0, #10 | |
bl putchar | |
movw r3, #:lower16:.LC0 | |
movt r3, #:upper16:.LC0 | |
ldr r1, [fp, #-20] | |
ldr r2, [fp, #-12] | |
rsb r1, r2, r1 | |
ldr r0, [fp, #-24] | |
ldr r2, [fp, #-16] | |
rsb r0, r2, r0 | |
movw r2, #:lower16:1000000 | |
movt r2, #:upper16:1000000 | |
mul r2, r2, r0 | |
add r2, r1, r2 | |
mov r0, r3 | |
mov r1, r2 | |
bl printf | |
mov r3, #0 | |
mov r0, r3 | |
sub sp, fp, #4 | |
ldmfd sp!, {fp, pc} | |
.fnend | |
.size main, .-main | |
.align 2 | |
.global double_elements | |
.type double_elements, %function | |
double_elements: | |
.fnstart | |
.LFB1: | |
@ args = 0, pretend = 0, frame = 16 | |
@ frame_needed = 1, uses_anonymous_args = 0 | |
@ link register save eliminated. | |
str fp, [sp, #-4]! | |
.save {fp} | |
.setfp fp, sp, #0 | |
add fp, sp, #0 | |
.pad #20 | |
sub sp, sp, #20 | |
str r0, [fp, #-16] | |
str r1, [fp, #-20] | |
mov r3, #0 | |
str r3, [fp, #-8] | |
b .L6 | |
.L7: | |
ldr r3, [fp, #-8] | |
mov r2, r3, asl #2 | |
ldr r3, [fp, #-16] | |
add r3, r2, r3 | |
ldr r2, [fp, #-8] | |
mov r1, r2, asl #2 | |
ldr r2, [fp, #-16] | |
add r2, r1, r2 | |
ldr r2, [r2, #0] | |
mov r2, r2, asl #1 | |
str r2, [r3, #0] | |
ldr r3, [fp, #-8] | |
add r3, r3, #1 | |
str r3, [fp, #-8] | |
.L6: | |
ldr r2, [fp, #-8] | |
ldr r3, [fp, #-20] | |
cmp r2, r3 | |
bcc .L7 | |
add sp, fp, #0 | |
ldmfd sp!, {fp} | |
bx lr | |
.fnend | |
.size double_elements, .-double_elements | |
.ident "GCC: (Linux release 2010-06-30) 4.4.1" | |
.section .note.GNU-stack,"",%progbits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
arm-v7a8-linux-gnueabi-gcc -S plain.c