.text .balign 4 .global _time_us _time_us sub sp, #4 wrlong lr, sp sub sp, #8 mov r1, #0 mov r0, sp lcall #_gettimeofday cmps r0, #0 wz,wc IF_NE mov r0, #0 IF_NE brs #.L2 mov r7, sp mvi r1,#1000000 add r7, #4 rdlong r0, sp call #__MULSI rdlong r7, r7 add r0, r7 .L2 mov r1, #0 add sp, #8 rdlong lr, sp add sp, #4 lret .data .balign 4 .LC0 .ascii "OpenMP not available on this system\0" .text .balign 4 .global _print_omp_version _print_omp_version mvi r0,#.LC0 brl #_puts .balign 4 .global _butterflies _butterflies mov __TMP0,#(8<<4)+8 call #__LMM_PUSHM sub sp, #56 mov r7, #20 add r7, sp mov r6, #28 add r6, sp mov r9, #1 shl r9, r2 wrlong r1, r7 mov r7, #32 add r7, sp wrlong r0, r6 mov r6, #44 add r6, sp wrlong r5, r7 mov r7, r2 add r7, #1 wrlong r3, r6 mvi r6,#1024 sar r6, r7 mov r0, r6 mov r1, r4 mov r7, #4 add r7, sp call #__DIVSI wrlong r6, sp mov r6, #8 add r6, sp wrlong r2, r6 mov r6, #20 add r6, sp wrlong r0, r7 rdlong r7, r6 mov r6, #28 add r6, sp rdlong r6, r6 sub r7, r6 mov r6, #20 add r6, sp wrlong r7, r6 jmp #__LMM_JMP long .L6 .L11 mov r7, #32 add r7, sp rdlong r7, r7 cmps r13, r7 wz,wc IF_AE brs #.L16 cmps r13, #0 wz,wc IF_AE brs #.L7 .L16 mov r6, #1 mvi r7,#_rangeError wrlong r6, r7 .L7 mov r6, #32 mov r7, r13 add r6, sp add r7, r8 rdlong r6, r6 cmps r7, r6 wz,wc IF_AE brs #.L17 cmps r7, #0 wz,wc IF_AE brs #.L9 .L17 mov r7, #1 mvi r6,#_rangeError wrlong r7, r6 .L9 mov r7, #36 add r7, sp add r13, #1 rdlong lr, r7 add lr, r12 rdlong r2, r7 add r2, r11 rdword r7, r10 mov r4, r7 mvi r7,#512 add r7, r10 shl r4, #16 sar r4, #16 mov r1, r4 rdword r7, r7 shl r7, #16 sar r7, #16 rdlong r5, lr add r1, r7 mov r0, r5 call #__MULSI rdlong r14, r2 mov r1, r5 mov r6, r0 add r1, r14 mov r0, r7 sar r6, #12 mov r3, r6 call #__MULSI mov r1, r14 mov r7, r0 sub r1, r5 mov r0, r4 call #__MULSI sar r7, #12 mov r4, r0 sub r3, r7 sar r4, #12 add r4, r6 rdlong r7, r12 mov r6, r7 sub r6, r3 rdlong r5, r11 add r7, r3 mov r0, r5 wrlong r6, lr mov r6, r5 sub r6, r4 wrlong r6, r2 mov r6, #48 add r6, sp wrlong r7, r12 add r0, r4 add r12, #4 rdlong r6, r6 add r10, r6 wrlong r0, r11 add r11, #4 .L13 djnz r9,#__LMM_JMP long .L11 mov r7, #52 add r7, sp mov r9, r8 rdlong r8, r7 mov r7, #12 add r7, sp rdlong r6, r7 mov r7, #24 add r7, sp rdlong r7, r7 add r6, r7 mov r7, #12 add r7, sp wrlong r6, r7 mov r7, #16 add r7, sp rdlong r6, r7 mov r7, #16 add r6, #1 add r7, sp wrlong r6, r7 mov r6, #40 add r6, sp rdlong r6, r6 add r8, r6 .L15 mov r7, #16 mov r6, #4 add r7, sp add r6, sp rdlong r7, r7 rdlong r6, r6 cmps r7, r6 wz,wc IF_AE brs #.L12 mov r7, #20 add r7, sp mov r14, r9 mov r6, #12 add r6, sp cmps r9, #0 wz,wc add r14, #1 mvi r10,#_cos mov r12, r8 IF_B mov r14,#1 rdlong r11, r7 add r11, r8 rdlong r13, r6 '' loop_start register r14 level #1 mov r7, #52 add r7, sp wrlong r8, r7 mov r8, r9 mov r9, r14 brs #.L13 .L12 mov r7, #4 add r7, sp rdlong r6, r7 mov r7, #4 sar r6, #1 add r7, sp wrlong r6, r7 rdlong r6, sp sar r6, #1 wrlong r6, sp mov r6, #8 add r6, sp rdlong r7, r6 mov r6, #8 add r7, #1 add r6, sp wrlong r7, r6 mov r7, #24 add r7, sp rdlong r9, r7 .L6 mov r6, #8 mov r7, #44 add r6, sp add r7, sp rdlong r6, r6 rdlong r7, r7 cmps r6, r7 wz,wc IF_A brs #.L5 mov r6, r9 mov r7, #24 shl r6, #1 add r7, sp wrlong r6, r7 mov r6, r9 mov r7, #40 shl r6, #3 add r7, sp wrlong r6, r7 mov r6, #28 add r6, sp rdlong r8, r6 mov r6, #16 mov r7, #0 add r6, sp wrlong r7, r6 mov r6, #12 add r6, sp wrlong r7, r6 mov r6, #48 add r6, sp rdlong r7, sp shl r7, #1 wrlong r7, r6 mov r7, r9 mov r6, #36 shl r7, #2 add r6, sp wrlong r7, r6 brs #.L15 .L5 add sp, #56 mov __TMP0,#(8<<4)+15 call #__LMM_POPRET '' never returns .data .balign 4 .LC1 .ascii "fft_bench v1.2\0" .balign 4 .LC2 .ascii "Error: Array bounds violation\0" .balign 4 .LC3 .ascii "Freq. Magnitude\0" .balign 4 .LC4 .ascii "%08x %08x\12\0" .balign 4 .LC5 .ascii "1024 point bit-reversal and butterfly run time = %d us\12\0" .text .balign 4 .global _fft_bench _fft_bench mov __TMP0,#(8<<4)+8 call #__LMM_PUSHM sub sp, #28 mvi r0,#.LC1 mov r14, #0 lcall #_puts lcall #_print_omp_version mov lr, #16 mvi r5,#_bx mvi r7,#_by add lr, sp mov r6, #12 add r6, sp mov r2, #0 mov r3, #0 mvi r12,#_input mvi r11,#-512 mvi r13,#512 mvi r4,#1024 wrlong r7, lr mov lr, r7 mov r7, r5 wrlong r5, r6 '' loop_start register r4 level #1 jmp #__LMM_FCACHE_LOAD long .L49-.L48 .L48 .L23 mov r6, r2 and r6, #15 mov r5, r14 shl r6, #2 add r6, r12 and r5, #15 mov r1, #4 shl r5, #2 add r5, r12 add r2, #3 add r14, #5 rdlong r0, r6 call #__DIVSI mov r6, r0 mov r1, #4 rdlong r0, r5 mov r5, #0 call #__DIVSI add r6, r0 test r3,#0x1 wz add r3, #1 wrlong r6, r7 IF_NE add r6, r13 IF_E add r6, r11 wrlong r6, r7 rdlong r6, r7 add r6, r13 wrlong r6, r7 add r7, #4 wrlong r5, lr add lr, #4 djnz r4,#__LMM_FCACHE_START+(.L23-.L48) jmp __LMM_RET .compress default .L49 mvi r2,#_bx mvi r3,#_by mov r1, #0 mvi r8,#-858993460 mvi r9,#858993459 mvi r10,#-252645136 mvi r11,#252645135 mvi r12,#-16711936 mvi r13,#16711935 mov r14, r2 mvi r0,#1024 '' loop_start register r0 level #1 jmp #__LMM_FCACHE_LOAD long .L44-.L43 .L43 .L25 mov r7,__LMM_FCACHE_START+(.L45-.L43) mov r6,__LMM_FCACHE_START+(.L46-.L43) and r7, r1 and r6, r1 shr r6, #1 shl r7, #1 or r7, r6 mov r6, r7 and r6, r8 and r7, r9 shr r6, #2 shl r7, #2 or r7, r6 mov r6, r7 and r6, r10 and r7, r11 shr r6, #4 shl r7, #4 or r7, r6 mov r6, r7 and r6, r12 and r7, r13 shr r6, #8 shl r7, #8 or r7, r6 ror r7, #16 shr r7, #22 cmps r1, r7 wz,wc IF_AE jmp #__LMM_FCACHE_START+(.L24-.L43) shl r7, #2 mov r6, r14 add r6, r7 rdlong lr, r6 rdlong r4, r2 wrlong lr, r2 mov lr,__LMM_FCACHE_START+(.L47-.L43) add r7, lr rdlong lr, r7 rdlong r5, r3 wrlong lr, r3 wrlong r4, r6 wrlong r5, r7 .L24 add r1, #1 add r2, #4 add r3, #4 djnz r0,#__LMM_FCACHE_START+(.L25-.L43) jmp __LMM_RET .compress default .L45 .long 1431655765 .L46 .long -1431655766 .L47 .long _by .L44 lcall #_time_us mov r8, r0 mov r9, r1 mov r13, #2 mov r12, #8 mov r10, #0 brs #.L26 .L27 mov r7, r14 shl r7, #10 mov r0, r7 mov r1, r13 call #__DIVSI mov r7, r0 shl r7, #2 mvi r5,#_by mvi r6,#_bx add r6, r7 add r7, r5 mov r0, r6 mov r1, r7 mov r2, r10 mov r3, r12 mov r4, r13 mov r5, r11 lcall #_butterflies add r14, #1 cmps r14, r13 wz,wc IF_B brs #.L27 cmps r12, #9 wz,wc sar r13, #1 IF_E brs #.L28 mov r12, #9 mov r10, #9 .L26 mvi r0,#1024 mov r1, r13 mov r14, #0 call #__DIVSI mov r11, r0 brs #.L27 .L28 mvi r7,#_rangeError rdlong r7, r7 cmps r7, #0 wz,wc IF_E brs #.L29 mvi r0,#.LC2 lcall #_puts .L29 lcall #_time_us mov r13, r0 mvi r0,#.LC3 mov r12, r1 mov r10, sp lcall #_puts mov r6, #12 mov r7, #16 mov r11, sp add r6, sp add r7, sp mov r3, r13 mov r2, r12 mov r14, #0 add r10, #4 add r11, #8 rdlong r13, r6 rdlong r12, r7 .L34 rdlong r0, r13 mvi r1,#1024 mov r4, #16 call #__DIVSI mov r7, r0 mvi r1,#1024 mov r5, #0 rdlong r0, r12 call #__DIVSI mov r6, r0 mov r1, r7 mov r0, r7 call #__MULSI mov r1, r6 mov r7, r0 mov r0, r6 mvi r6,#1073741824 call #__MULSI add r7, r0 '' loop_start register r4 level #1 jmp #__LMM_FCACHE_LOAD long .L42-.L41 .L41 .L32 or r5, r6 cmps r5, r7 wz,wc IF_BE sub r7, r5 IF_A sub r5, r6 IF_BE add r5, r6 sar r5, #1 sar r6, #2 djnz r4,#__LMM_FCACHE_START+(.L32-.L41) jmp __LMM_RET .compress default .L42 cmps r5, #0 wz,wc IF_BE brs #.L33 mvi lr,#.LC4 mov r6, #20 add r6, sp wrlong lr, sp wrlong r14, r10 wrlong r5, r11 mov r5, #24 add r5, sp wrlong r2, r5 wrlong r3, r6 lcall #_printf mov r7, #20 mov lr, #24 add r7, sp add lr, sp rdlong r3, r7 rdlong r2, lr .L33 add r14, #1 mvi r7,#513 cmps r14, r7 wz,wc add r13, #4 add r12, #4 IF_NE brs #.L34 mov r13, r3 mvi r5,#.LC5 mov r7, sp sub r13, r8 wc mov r1, r2 add r7, #4 subx r1, r9 wrlong r5, sp wrlong r13, r7 add r7, #4 wrlong r1, r7 lcall #_printf add sp, #28 mov __TMP0,#(8<<4)+15 call #__LMM_POPRET '' never returns .balign 4 .global _main _main sub sp, #4 wrlong lr, sp lcall #_fft_bench mov r0, #0 rdlong lr, sp add sp, #4 lret .global _rangeError .section .bss .balign 4 _rangeError .zero 4 .data .balign 4 _input long 4096 long 3784 long 2896 long 1567 long 0 long -1567 long -2896 long -3784 long -4096 long -3784 long -2896 long -1567 long 0 long 1567 long 2896 long 3784 .local _bx .comm _bx,4096,4 .local _by .comm _by,4096,4 .data .balign 4 _cos word 4095 word 4094 word 4094 word 4094 word 4093 word 4093 word 4092 word 4091 word 4090 word 4088 word 4087 word 4085 word 4083 word 4081 word 4079 word 4077 word 4075 word 4072 word 4070 word 4067 word 4064 word 4061 word 4057 word 4054 word 4050 word 4046 word 4042 word 4038 word 4034 word 4030 word 4025 word 4021 word 4016 word 4011 word 4006 word 4000 word 3995 word 3989 word 3984 word 3978 word 3972 word 3966 word 3959 word 3953 word 3946 word 3939 word 3932 word 3925 word 3918 word 3911 word 3903 word 3896 word 3888 word 3880 word 3872 word 3864 word 3855 word 3847 word 3838 word 3829 word 3820 word 3811 word 3802 word 3792 word 3783 word 3773 word 3763 word 3753 word 3743 word 3733 word 3723 word 3712 word 3701 word 3691 word 3680 word 3668 word 3657 word 3646 word 3634 word 3623 word 3611 word 3599 word 3587 word 3575 word 3563 word 3550 word 3537 word 3525 word 3512 word 3499 word 3486 word 3473 word 3459 word 3446 word 3432 word 3418 word 3404 word 3390 word 3376 word 3362 word 3348 word 3333 word 3318 word 3304 word 3289 word 3274 word 3258 word 3243 word 3228 word 3212 word 3197 word 3181 word 3165 word 3149 word 3133 word 3117 word 3100 word 3084 word 3067 word 3051 word 3034 word 3017 word 3000 word 2983 word 2965 word 2948 word 2930 word 2913 word 2895 word 2877 word 2859 word 2841 word 2823 word 2805 word 2787 word 2768 word 2750 word 2731 word 2712 word 2693 word 2674 word 2655 word 2636 word 2617 word 2597 word 2578 word 2558 word 2539 word 2519 word 2499 word 2479 word 2459 word 2439 word 2419 word 2398 word 2378 word 2357 word 2337 word 2316 word 2295 word 2275 word 2254 word 2233 word 2211 word 2190 word 2169 word 2148 word 2126 word 2105 word 2083 word 2061 word 2040 word 2018 word 1996 word 1974 word 1952 word 1930 word 1908 word 1885 word 1863 word 1841 word 1818 word 1796 word 1773 word 1750 word 1728 word 1705 word 1682 word 1659 word 1636 word 1613 word 1590 word 1567 word 1543 word 1520 word 1497 word 1473 word 1450 word 1426 word 1403 word 1379 word 1355 word 1332 word 1308 word 1284 word 1260 word 1236 word 1212 word 1188 word 1164 word 1140 word 1116 word 1092 word 1067 word 1043 word 1019 word 994 word 970 word 946 word 921 word 897 word 872 word 848 word 823 word 798 word 774 word 749 word 724 word 700 word 675 word 650 word 625 word 600 word 575 word 551 word 526 word 501 word 476 word 451 word 426 word 401 word 376 word 351 word 326 word 301 word 276 word 251 word 226 word 200 word 175 word 150 word 125 word 100 word 75 word 50 word 25 word 0 word -25 word -50 word -75 word -100 word -125 word -150 word -175 word -200 word -226 word -251 word -276 word -301 word -326 word -351 word -376 word -401 word -426 word -451 word -476 word -501 word -526 word -551 word -576 word -600 word -625 word -650 word -675 word -700 word -724 word -749 word -774 word -798 word -823 word -848 word -872 word -897 word -921 word -946 word -970 word -995 word -1019 word -1043 word -1067 word -1092 word -1116 word -1140 word -1164 word -1188 word -1212 word -1236 word -1260 word -1284 word -1308 word -1332 word -1355 word -1379 word -1403 word -1426 word -1450 word -1473 word -1497 word -1520 word -1543 word -1567 word -1590 word -1613 word -1636 word -1659 word -1682 word -1705 word -1728 word -1750 word -1773 word -1796 word -1818 word -1841 word -1863 word -1885 word -1908 word -1930 word -1952 word -1974 word -1996 word -2018 word -2040 word -2062 word -2083 word -2105 word -2126 word -2148 word -2169 word -2190 word -2212 word -2233 word -2254 word -2275 word -2295 word -2316 word -2337 word -2357 word -2378 word -2398 word -2419 word -2439 word -2459 word -2479 word -2499 word -2519 word -2539 word -2558 word -2578 word -2597 word -2617 word -2636 word -2655 word -2674 word -2693 word -2712 word -2731 word -2750 word -2768 word -2787 word -2805 word -2823 word -2841 word -2859 word -2877 word -2895 word -2913 word -2930 word -2948 word -2965 word -2983 word -3000 word -3017 word -3034 word -3051 word -3067 word -3084 word -3100 word -3117 word -3133 word -3149 word -3165 word -3181 word -3197 word -3212 word -3228 word -3243 word -3258 word -3274 word -3289 word -3304 word -3318 word -3333 word -3348 word -3362 word -3376 word -3390 word -3404 word -3418 word -3432 word -3446 word -3459 word -3473 word -3486 word -3499 word -3512 word -3525 word -3537 word -3550 word -3563 word -3575 word -3587 word -3599 word -3611 word -3623 word -3634 word -3646 word -3657 word -3669 word -3680 word -3691 word -3701 word -3712 word -3723 word -3733 word -3743 word -3753 word -3763 word -3773 word -3783 word -3792 word -3802 word -3811 word -3820 word -3829 word -3838 word -3847 word -3855 word -3864 word -3872 word -3880 word -3888 word -3896 word -3903 word -3911 word -3918 word -3925 word -3932 word -3939 word -3946 word -3953 word -3959 word -3966 word -3972 word -3978 word -3984 word -3989 word -3995 word -4000 word -4006 word -4011 word -4016 word -4021 word -4025 word -4030 word -4034 word -4038 word -4043 word -4046 word -4050 word -4054 word -4057 word -4061 word -4064 word -4067 word -4070 word -4072 word -4075 word -4077 word -4079 word -4081 word -4083 word -4085 word -4087 word -4088 word -4090 word -4091 word -4092 word -4093 word -4093 word -4094 word -4094 word -4094 word -4094 word -4094 word -4094 word -4094 word -4093 word -4093 word -4092 word -4091 word -4090 word -4088 word -4087 word -4085 word -4083 word -4081 word -4079 word -4077 word -4075 word -4072 word -4070 word -4067 word -4064 word -4061 word -4057 word -4054 word -4050 word -4046 word -4042 word -4038 word -4034 word -4030 word -4025 word -4021 word -4016 word -4011 word -4006 word -4000 word -3995 word -3989 word -3984 word -3978 word -3972 word -3966 word -3959 word -3953 word -3946 word -3939 word -3932 word -3925 word -3918 word -3911 word -3903 word -3896 word -3888 word -3880 word -3872 word -3863 word -3855 word -3847 word -3838 word -3829 word -3820 word -3811 word -3802 word -3792 word -3783 word -3773 word -3763 word -3753 word -3743 word -3733 word -3723 word -3712 word -3701 word -3691 word -3680 word -3668 word -3657 word -3646 word -3634 word -3623 word -3611 word -3599 word -3587 word -3575 word -3562 word -3550 word -3537 word -3525 word -3512 word -3499 word -3486 word -3473 word -3459 word -3446 word -3432 word -3418 word -3404 word -3390 word -3376 word -3362 word -3347 word -3333 word -3318 word -3304 word -3289 word -3274 word -3258 word -3243 word -3228 word -3212 word -3197 word -3181 word -3165 word -3149 word -3133 word -3117 word -3100 word -3084 word -3067 word -3050 word -3034 word -3017 word -3000 word -2983 word -2965 word -2948 word -2930 word -2913 word -2895 word -2877 word -2859 word -2841 word -2823 word -2805 word -2787 word -2768 word -2749 word -2731 word -2712 word -2693 word -2674 word -2655 word -2636 word -2617 word -2597 word -2578 word -2558 word -2539 word -2519 word -2499 word -2479 word -2459 word -2439 word -2419 word -2398 word -2378 word -2357 word -2337 word -2316 word -2295 word -2275 word -2254 word -2233 word -2211 word -2190 word -2169 word -2148 word -2126 word -2105 word -2083 word -2061 word -2040 word -2018 word -1996 word -1974 word -1952 word -1930 word -1908 word -1885 word -1863 word -1841 word -1818 word -1796 word -1773 word -1750 word -1728 word -1705 word -1682 word -1659 word -1636 word -1613 word -1590 word -1567 word -1543 word -1520 word -1497 word -1473 word -1450 word -1426 word -1403 word -1379 word -1355 word -1332 word -1308 word -1284 word -1260 word -1236 word -1212 word -1188 word -1164 word -1140 word -1116 word -1092 word -1067 word -1043 word -1019 word -994 word -970 word -946 word -921 word -897 word -872 word -848 word -823 word -798 word -774 word -749 word -724 word -700 word -675 word -650 word -625 word -600 word -575 word -551 word -526 word -501 word -476 word -451 word -426 word -401 word -376 word -351 word -326 word -301 word -276 word -251 word -225 word -200 word -175 word -150 word -125 word -100 word -75 word -50 word -25