.file "fftbench.c" .text .align 2 .globl time_us .type time_us, @function time_us: add sp,sp,-32 move a0,sp move a1,zero sw ra,28(sp) call gettimeofday bne a0,zero,.L3 lw a4,0(sp) lw a3,4(sp) li a2,999424 add a2,a2,576 mul a0,a4,a2 lw a5,8(sp) sra a1,a5,31 mul a3,a3,a2 add a0,a5,a0 sltu a5,a0,a5 mulhu a4,a4,a2 add a4,a3,a4 add a1,a1,a4 add a1,a5,a1 j .L2 .L3: move a0,zero move a1,zero .L2: lw ra,28(sp) add sp,sp,32 jr ra .size time_us, .-time_us .align 2 .globl print_omp_version .type print_omp_version, @function print_omp_version: lui a0,%hi(.LC0) add a0,a0,%lo(.LC0) tail puts .size print_omp_version, .-print_omp_version .align 2 .globl butterflies .type butterflies, @function butterflies: li t6,1 add a6,a2,t6 li t1,1024 sra t1,t1,a6 div a4,t1,a4 add sp,sp,-48 sw s7,16(sp) sw s0,44(sp) sw s1,40(sp) sw s2,36(sp) sw s3,32(sp) sw s4,28(sp) sw s5,24(sp) sw s6,20(sp) sw s8,12(sp) sw s9,8(sp) sw s10,4(sp) sw s11,0(sp) sll t5,t6,a2 lui s7,%hi(rangeError) .L8: bgt a2,a3,.L7 sll s6,t5,1 sll s10,t1,1 sll s5,t5,2 move s3,zero move t4,zero .L17: bge s3,a4,.L14 sll t0,t4,2 lui a6,%hi(.LANCHOR0) add s0,a0,t0 add s1,a6,%lo(.LANCHOR0) add t0,a1,t0 move t2,t4 .L15: sub a6,t2,t4 bge a6,t5,.L19 blt t2,zero,.L9 blt t2,a5,.L10 .L9: sw t6,%lo(rangeError)(s7) .L10: add a6,t2,t5 blt a6,zero,.L11 blt a6,a5,.L12 .L11: sw t6,%lo(rangeError)(s7) .L12: add s9,s0,s5 add s8,t0,s5 lw s4,0(s9) lh a6,0(s1) lh a7,512(s1) lw s2,0(s8) add s1,s1,s10 add t3,a6,a7 add s11,s4,s2 sub s2,s2,s4 mul a7,a7,s11 lw s11,0(s0) add t0,t0,4 add s0,s0,4 add t2,t2,1 mul a6,a6,s2 sra a7,a7,12 mul t3,s4,t3 sra a6,a6,12 sra t3,t3,12 sub a7,t3,a7 add t3,t3,a6 lw a6,-4(t0) sub s2,s11,a7 sw s2,0(s9) add a7,s11,a7 sub s2,a6,t3 add t3,a6,t3 sw s2,0(s8) sw a7,-4(s0) sw t3,-4(t0) j .L15 .L19: add t4,t4,s6 add s3,s3,1 j .L17 .L14: sra a4,a4,1 sra t1,t1,1 add a2,a2,1 move t5,s6 j .L8 .L7: lw s0,44(sp) lw s1,40(sp) lw s2,36(sp) lw s3,32(sp) lw s4,28(sp) lw s5,24(sp) lw s6,20(sp) lw s7,16(sp) lw s8,12(sp) lw s9,8(sp) lw s10,4(sp) lw s11,0(sp) add sp,sp,48 jr ra .size butterflies, .-butterflies .align 2 .globl fft_bench .type fft_bench, @function fft_bench: lui a0,%hi(.LC1) add sp,sp,-80 add a0,a0,%lo(.LC1) sw ra,76(sp) sw s0,72(sp) sw s2,64(sp) sw s1,68(sp) lui s2,%hi(.LANCHOR1) sw s3,60(sp) sw s4,56(sp) sw s5,52(sp) sw s6,48(sp) sw s7,44(sp) sw s8,40(sp) sw s9,36(sp) sw s10,32(sp) sw s11,28(sp) call puts call print_omp_version lui a0,%hi(.LANCHOR2) lui a1,%hi(.LANCHOR3) add a2,s2,%lo(.LANCHOR1) move a3,zero add s0,s2,%lo(.LANCHOR1) add a0,a0,%lo(.LANCHOR2) li t1,3 li a6,4 li t2,5 add t0,a1,%lo(.LANCHOR3) li a7,1024 .L23: mul a5,a3,t1 and a5,a5,15 sll a5,a5,2 add a5,a0,a5 lw a5,0(a5) div a4,a5,a6 mul a5,a3,t2 and a5,a5,15 sll a5,a5,2 add a5,a0,a5 lw a5,0(a5) div a5,a5,a6 add a5,a4,a5 sll a4,a3,31 sw a5,0(a2) bge a4,zero,.L21 add a5,a5,512 j .L44 .L21: add a5,a5,-512 .L44: sw a5,0(a2) lw a5,0(a2) add s1,a1,%lo(.LANCHOR3) add a2,a2,4 add a5,a5,512 sw a5,-4(a2) sll a5,a3,2 add a5,t0,a5 add a3,a3,1 sw zero,0(a5) bne a3,a7,.L23 li a0,1431654400 li a6,-1431654400 li a7,-858992640 li t0,858992640 li t1,-252645376 li t2,252645376 li t3,-16711680 li t4,16711680 move a1,zero move a2,zero add a0,a0,1365 add a6,a6,-1366 add a7,a7,-820 add t0,t0,819 add t1,t1,240 add t2,t2,-241 add t3,t3,-256 add t4,t4,255 li t5,1024 .L25: and a3,a2,a0 and a5,a2,a6 srl a5,a5,1 sll a3,a3,1 or a3,a3,a5 and a5,a3,a7 srl a4,a5,2 and a5,a3,t0 sll a5,a5,2 or a5,a5,a4 and a3,a5,t1 srl a4,a3,4 and a3,a5,t2 sll a3,a3,4 or a3,a3,a4 and a5,a3,t3 srl a4,a5,8 and a5,a3,t4 sll a5,a5,8 or a5,a5,a4 sll a5,a5,16 srl a5,a5,22 bge a2,a5,.L24 sll a5,a5,2 add a4,s0,a5 lw s5,0(a4) add t6,s0,a1 add a3,s1,a1 add a5,s1,a5 lw s4,0(t6) lw s3,0(a3) sw s5,0(t6) lw t6,0(a5) sw s4,0(a4) sw t6,0(a3) sw s3,0(a5) .L24: add a2,a2,1 add a1,a1,4 bne a2,t5,.L25 call time_us lui s7,%hi(.LANCHOR3) move s3,a0 move s4,a1 li s5,2 li s6,8 move s8,zero li s9,1024 add s2,s2,%lo(.LANCHOR1) add s7,s7,%lo(.LANCHOR3) li s10,1 li s11,9 .L26: div a6,s9,s5 move a0,s2 move a1,s7 move a2,s8 move a3,s6 move a4,s5 move a5,a6 sw a6,12(sp) call butterflies lw a6,12(sp) ble s5,s10,.L29 sll a1,a6,2 add a0,s2,a1 move a2,s8 add a1,s7,a1 move a3,s6 move a4,s5 move a5,a6 call butterflies .L29: sra s5,s5,1 li s8,9 beq s6,s11,.L27 move s6,s8 j .L26 .L27: lui a5,%hi(rangeError) lw a5,%lo(rangeError)(a5) beq a5,zero,.L30 lui a0,%hi(.LC2) add a0,a0,%lo(.LC2) call puts .L30: call time_us move s2,a0 lui a0,%hi(.LC3) add a0,a0,%lo(.LC3) move s5,a1 move s6,zero call puts li s7,1024 lui s9,%hi(.LC4) li s8,513 .L35: sll a5,s6,2 add a4,s0,a5 add a5,s1,a5 lw a4,0(a4) lw a5,0(a5) li a1,16 div a4,a4,s7 li a3,1073741824 move a2,zero div a5,a5,s7 mul a4,a4,a4 mul a5,a5,a5 add a5,a4,a5 .L33: or a2,a2,a3 sub a4,a2,a3 bgt a2,a5,.L32 sub a5,a5,a2 add a4,a2,a3 .L32: add a1,a1,-1 sra a2,a4,1 sra a3,a3,2 bne a1,zero,.L33 ble a2,zero,.L34 add a0,s9,%lo(.LC4) move a1,s6 call printf .L34: add s6,s6,1 bne s6,s8,.L35 sub a2,s2,s3 sub a3,s5,s4 sltu s2,s2,a2 sub a3,a3,s2 lw ra,76(sp) lw s0,72(sp) lw s1,68(sp) lw s2,64(sp) lw s3,60(sp) lw s4,56(sp) lw s5,52(sp) lw s6,48(sp) lw s7,44(sp) lw s8,40(sp) lw s9,36(sp) lw s10,32(sp) lw s11,28(sp) lui a0,%hi(.LC5) add a0,a0,%lo(.LC5) add sp,sp,80 tail printf .size fft_bench, .-fft_bench .section .text.startup,"ax",@progbits .align 2 .globl main .type main, @function main: add sp,sp,-16 sw ra,12(sp) call fft_bench lw ra,12(sp) move a0,zero add sp,sp,16 jr ra .size main, .-main .globl rangeError .section .rodata .align 2 .set .LANCHOR2,. + 0 .type input, @object .size input, 64 input: .word 4096 .word 3784 .word 2896 .word 1567 .word 0 .word -1567 .word -2896 .word -3784 .word -4096 .word -3784 .word -2896 .word -1567 .word 0 .word 1567 .word 2896 .word 3784 .data .align 2 .set .LANCHOR0,. + 0 .type cos, @object .size cos, 1536 cos: .half 4095 .half 4094 .half 4094 .half 4094 .half 4093 .half 4093 .half 4092 .half 4091 .half 4090 .half 4088 .half 4087 .half 4085 .half 4083 .half 4081 .half 4079 .half 4077 .half 4075 .half 4072 .half 4070 .half 4067 .half 4064 .half 4061 .half 4057 .half 4054 .half 4050 .half 4046 .half 4042 .half 4038 .half 4034 .half 4030 .half 4025 .half 4021 .half 4016 .half 4011 .half 4006 .half 4000 .half 3995 .half 3989 .half 3984 .half 3978 .half 3972 .half 3966 .half 3959 .half 3953 .half 3946 .half 3939 .half 3932 .half 3925 .half 3918 .half 3911 .half 3903 .half 3896 .half 3888 .half 3880 .half 3872 .half 3864 .half 3855 .half 3847 .half 3838 .half 3829 .half 3820 .half 3811 .half 3802 .half 3792 .half 3783 .half 3773 .half 3763 .half 3753 .half 3743 .half 3733 .half 3723 .half 3712 .half 3701 .half 3691 .half 3680 .half 3668 .half 3657 .half 3646 .half 3634 .half 3623 .half 3611 .half 3599 .half 3587 .half 3575 .half 3563 .half 3550 .half 3537 .half 3525 .half 3512 .half 3499 .half 3486 .half 3473 .half 3459 .half 3446 .half 3432 .half 3418 .half 3404 .half 3390 .half 3376 .half 3362 .half 3348 .half 3333 .half 3318 .half 3304 .half 3289 .half 3274 .half 3258 .half 3243 .half 3228 .half 3212 .half 3197 .half 3181 .half 3165 .half 3149 .half 3133 .half 3117 .half 3100 .half 3084 .half 3067 .half 3051 .half 3034 .half 3017 .half 3000 .half 2983 .half 2965 .half 2948 .half 2930 .half 2913 .half 2895 .half 2877 .half 2859 .half 2841 .half 2823 .half 2805 .half 2787 .half 2768 .half 2750 .half 2731 .half 2712 .half 2693 .half 2674 .half 2655 .half 2636 .half 2617 .half 2597 .half 2578 .half 2558 .half 2539 .half 2519 .half 2499 .half 2479 .half 2459 .half 2439 .half 2419 .half 2398 .half 2378 .half 2357 .half 2337 .half 2316 .half 2295 .half 2275 .half 2254 .half 2233 .half 2211 .half 2190 .half 2169 .half 2148 .half 2126 .half 2105 .half 2083 .half 2061 .half 2040 .half 2018 .half 1996 .half 1974 .half 1952 .half 1930 .half 1908 .half 1885 .half 1863 .half 1841 .half 1818 .half 1796 .half 1773 .half 1750 .half 1728 .half 1705 .half 1682 .half 1659 .half 1636 .half 1613 .half 1590 .half 1567 .half 1543 .half 1520 .half 1497 .half 1473 .half 1450 .half 1426 .half 1403 .half 1379 .half 1355 .half 1332 .half 1308 .half 1284 .half 1260 .half 1236 .half 1212 .half 1188 .half 1164 .half 1140 .half 1116 .half 1092 .half 1067 .half 1043 .half 1019 .half 994 .half 970 .half 946 .half 921 .half 897 .half 872 .half 848 .half 823 .half 798 .half 774 .half 749 .half 724 .half 700 .half 675 .half 650 .half 625 .half 600 .half 575 .half 551 .half 526 .half 501 .half 476 .half 451 .half 426 .half 401 .half 376 .half 351 .half 326 .half 301 .half 276 .half 251 .half 226 .half 200 .half 175 .half 150 .half 125 .half 100 .half 75 .half 50 .half 25 .half 0 .half -25 .half -50 .half -75 .half -100 .half -125 .half -150 .half -175 .half -200 .half -226 .half -251 .half -276 .half -301 .half -326 .half -351 .half -376 .half -401 .half -426 .half -451 .half -476 .half -501 .half -526 .half -551 .half -576 .half -600 .half -625 .half -650 .half -675 .half -700 .half -724 .half -749 .half -774 .half -798 .half -823 .half -848 .half -872 .half -897 .half -921 .half -946 .half -970 .half -995 .half -1019 .half -1043 .half -1067 .half -1092 .half -1116 .half -1140 .half -1164 .half -1188 .half -1212 .half -1236 .half -1260 .half -1284 .half -1308 .half -1332 .half -1355 .half -1379 .half -1403 .half -1426 .half -1450 .half -1473 .half -1497 .half -1520 .half -1543 .half -1567 .half -1590 .half -1613 .half -1636 .half -1659 .half -1682 .half -1705 .half -1728 .half -1750 .half -1773 .half -1796 .half -1818 .half -1841 .half -1863 .half -1885 .half -1908 .half -1930 .half -1952 .half -1974 .half -1996 .half -2018 .half -2040 .half -2062 .half -2083 .half -2105 .half -2126 .half -2148 .half -2169 .half -2190 .half -2212 .half -2233 .half -2254 .half -2275 .half -2295 .half -2316 .half -2337 .half -2357 .half -2378 .half -2398 .half -2419 .half -2439 .half -2459 .half -2479 .half -2499 .half -2519 .half -2539 .half -2558 .half -2578 .half -2597 .half -2617 .half -2636 .half -2655 .half -2674 .half -2693 .half -2712 .half -2731 .half -2750 .half -2768 .half -2787 .half -2805 .half -2823 .half -2841 .half -2859 .half -2877 .half -2895 .half -2913 .half -2930 .half -2948 .half -2965 .half -2983 .half -3000 .half -3017 .half -3034 .half -3051 .half -3067 .half -3084 .half -3100 .half -3117 .half -3133 .half -3149 .half -3165 .half -3181 .half -3197 .half -3212 .half -3228 .half -3243 .half -3258 .half -3274 .half -3289 .half -3304 .half -3318 .half -3333 .half -3348 .half -3362 .half -3376 .half -3390 .half -3404 .half -3418 .half -3432 .half -3446 .half -3459 .half -3473 .half -3486 .half -3499 .half -3512 .half -3525 .half -3537 .half -3550 .half -3563 .half -3575 .half -3587 .half -3599 .half -3611 .half -3623 .half -3634 .half -3646 .half -3657 .half -3669 .half -3680 .half -3691 .half -3701 .half -3712 .half -3723 .half -3733 .half -3743 .half -3753 .half -3763 .half -3773 .half -3783 .half -3792 .half -3802 .half -3811 .half -3820 .half -3829 .half -3838 .half -3847 .half -3855 .half -3864 .half -3872 .half -3880 .half -3888 .half -3896 .half -3903 .half -3911 .half -3918 .half -3925 .half -3932 .half -3939 .half -3946 .half -3953 .half -3959 .half -3966 .half -3972 .half -3978 .half -3984 .half -3989 .half -3995 .half -4000 .half -4006 .half -4011 .half -4016 .half -4021 .half -4025 .half -4030 .half -4034 .half -4038 .half -4043 .half -4046 .half -4050 .half -4054 .half -4057 .half -4061 .half -4064 .half -4067 .half -4070 .half -4072 .half -4075 .half -4077 .half -4079 .half -4081 .half -4083 .half -4085 .half -4087 .half -4088 .half -4090 .half -4091 .half -4092 .half -4093 .half -4093 .half -4094 .half -4094 .half -4094 .half -4094 .half -4094 .half -4094 .half -4094 .half -4093 .half -4093 .half -4092 .half -4091 .half -4090 .half -4088 .half -4087 .half -4085 .half -4083 .half -4081 .half -4079 .half -4077 .half -4075 .half -4072 .half -4070 .half -4067 .half -4064 .half -4061 .half -4057 .half -4054 .half -4050 .half -4046 .half -4042 .half -4038 .half -4034 .half -4030 .half -4025 .half -4021 .half -4016 .half -4011 .half -4006 .half -4000 .half -3995 .half -3989 .half -3984 .half -3978 .half -3972 .half -3966 .half -3959 .half -3953 .half -3946 .half -3939 .half -3932 .half -3925 .half -3918 .half -3911 .half -3903 .half -3896 .half -3888 .half -3880 .half -3872 .half -3863 .half -3855 .half -3847 .half -3838 .half -3829 .half -3820 .half -3811 .half -3802 .half -3792 .half -3783 .half -3773 .half -3763 .half -3753 .half -3743 .half -3733 .half -3723 .half -3712 .half -3701 .half -3691 .half -3680 .half -3668 .half -3657 .half -3646 .half -3634 .half -3623 .half -3611 .half -3599 .half -3587 .half -3575 .half -3562 .half -3550 .half -3537 .half -3525 .half -3512 .half -3499 .half -3486 .half -3473 .half -3459 .half -3446 .half -3432 .half -3418 .half -3404 .half -3390 .half -3376 .half -3362 .half -3347 .half -3333 .half -3318 .half -3304 .half -3289 .half -3274 .half -3258 .half -3243 .half -3228 .half -3212 .half -3197 .half -3181 .half -3165 .half -3149 .half -3133 .half -3117 .half -3100 .half -3084 .half -3067 .half -3050 .half -3034 .half -3017 .half -3000 .half -2983 .half -2965 .half -2948 .half -2930 .half -2913 .half -2895 .half -2877 .half -2859 .half -2841 .half -2823 .half -2805 .half -2787 .half -2768 .half -2749 .half -2731 .half -2712 .half -2693 .half -2674 .half -2655 .half -2636 .half -2617 .half -2597 .half -2578 .half -2558 .half -2539 .half -2519 .half -2499 .half -2479 .half -2459 .half -2439 .half -2419 .half -2398 .half -2378 .half -2357 .half -2337 .half -2316 .half -2295 .half -2275 .half -2254 .half -2233 .half -2211 .half -2190 .half -2169 .half -2148 .half -2126 .half -2105 .half -2083 .half -2061 .half -2040 .half -2018 .half -1996 .half -1974 .half -1952 .half -1930 .half -1908 .half -1885 .half -1863 .half -1841 .half -1818 .half -1796 .half -1773 .half -1750 .half -1728 .half -1705 .half -1682 .half -1659 .half -1636 .half -1613 .half -1590 .half -1567 .half -1543 .half -1520 .half -1497 .half -1473 .half -1450 .half -1426 .half -1403 .half -1379 .half -1355 .half -1332 .half -1308 .half -1284 .half -1260 .half -1236 .half -1212 .half -1188 .half -1164 .half -1140 .half -1116 .half -1092 .half -1067 .half -1043 .half -1019 .half -994 .half -970 .half -946 .half -921 .half -897 .half -872 .half -848 .half -823 .half -798 .half -774 .half -749 .half -724 .half -700 .half -675 .half -650 .half -625 .half -600 .half -575 .half -551 .half -526 .half -501 .half -476 .half -451 .half -426 .half -401 .half -376 .half -351 .half -326 .half -301 .half -276 .half -251 .half -225 .half -200 .half -175 .half -150 .half -125 .half -100 .half -75 .half -50 .half -25 .section .rodata.str1.4,"aMS",@progbits,1 .align 2 .LC0: .string "OpenMP not available on this system" .LC1: .string "fft_bench v1.2" .zero 1 .LC2: .string "Error: Array bounds violation" .zero 2 .LC3: .string "Freq. Magnitude" .zero 1 .LC4: .string "%08x %08x\n" .zero 1 .LC5: .string "1024 point bit-reversal and butterfly run time = %d us\n" .section .sbss,"aw",@nobits .align 2 .type rangeError, @object .size rangeError, 4 rangeError: .zero 4 .bss .align 2 .set .LANCHOR1,. + 0 .set .LANCHOR3,. + 4096 .type bx, @object .size bx, 4096 bx: .zero 4096 .type by, @object .size by, 4096 by: .zero 4096 .ident "GCC: (GNU) 4.9.2"