314 lines
4.6 KiB
ArmAsm
314 lines
4.6 KiB
ArmAsm
|
.file "26_scope4.sy"
|
||
|
.option pic
|
||
|
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
|
||
|
.attribute unaligned_access, 0
|
||
|
.attribute stack_align, 16
|
||
|
.text
|
||
|
.align 1
|
||
|
.globl getA
|
||
|
.type getA, @function
|
||
|
getA:
|
||
|
lla a5,.LANCHOR0
|
||
|
lw a0,0(a5)
|
||
|
addiw a0,a0,1
|
||
|
sw a0,0(a5)
|
||
|
ret
|
||
|
.size getA, .-getA
|
||
|
.align 1
|
||
|
.globl f1
|
||
|
.type f1, @function
|
||
|
f1:
|
||
|
lla a3,.LANCHOR0
|
||
|
lw a4,0(a3)
|
||
|
lw a5,4(a3)
|
||
|
addiw a2,a4,1
|
||
|
addw a5,a5,a0
|
||
|
addiw a4,a4,2
|
||
|
addw a5,a5,a2
|
||
|
addw a5,a5,a4
|
||
|
addw a5,a5,a2
|
||
|
addw a5,a5,a2
|
||
|
sw a4,0(a3)
|
||
|
sw a5,4(a3)
|
||
|
ret
|
||
|
.size f1, .-f1
|
||
|
.align 1
|
||
|
.globl f2
|
||
|
.type f2, @function
|
||
|
f2:
|
||
|
lla a5,.LANCHOR0
|
||
|
lw a4,8(a5)
|
||
|
lw a2,4(a5)
|
||
|
lw a3,0(a5)
|
||
|
addw a2,a2,a4
|
||
|
addiw a3,a3,1
|
||
|
addw a4,a4,a2
|
||
|
sw a3,0(a5)
|
||
|
sw a4,4(a5)
|
||
|
ret
|
||
|
.size f2, .-f2
|
||
|
.align 1
|
||
|
.globl f3
|
||
|
.type f3, @function
|
||
|
f3:
|
||
|
lla a3,.LANCHOR0
|
||
|
lw a4,0(a3)
|
||
|
lw a1,4(a3)
|
||
|
addiw a5,a4,1
|
||
|
addiw a2,a4,2
|
||
|
addw a5,a5,a1
|
||
|
addw a5,a5,a2
|
||
|
addiw a4,a4,3
|
||
|
addw a5,a5,a2
|
||
|
sw a4,0(a3)
|
||
|
sw a5,4(a3)
|
||
|
ret
|
||
|
.size f3, .-f3
|
||
|
.section .text.startup,"ax",@progbits
|
||
|
.align 1
|
||
|
.globl main
|
||
|
.type main, @function
|
||
|
main:
|
||
|
lla a3,.LANCHOR0
|
||
|
lw a5,0(a3)
|
||
|
addi sp,sp,-16
|
||
|
sd ra,8(sp)
|
||
|
addiw a1,a5,1
|
||
|
addiw a6,a5,2
|
||
|
addiw a7,a5,3
|
||
|
addw a0,a6,a1
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,4
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a1
|
||
|
addiw t1,a5,6
|
||
|
addw a0,a0,a1
|
||
|
addiw a7,a5,7
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a6
|
||
|
addiw a7,a5,9
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,10
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a1
|
||
|
addiw t1,a5,12
|
||
|
addw a0,a0,a1
|
||
|
addiw a7,a5,13
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a6
|
||
|
addiw a7,a5,16
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,17
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a1
|
||
|
addiw t1,a5,19
|
||
|
addw a0,a0,a1
|
||
|
addiw a7,a5,20
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,23
|
||
|
addiw a7,a5,24
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,25
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a1
|
||
|
addiw t1,a5,27
|
||
|
addw a0,a0,a1
|
||
|
addiw a7,a5,28
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,30
|
||
|
addiw a7,a5,31
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,32
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a1
|
||
|
addiw t1,a5,34
|
||
|
addw a0,a0,a1
|
||
|
addiw a7,a5,35
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,37
|
||
|
addiw a7,a5,38
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,39
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a1
|
||
|
addiw t1,a5,41
|
||
|
addw a0,a0,a1
|
||
|
addiw a7,a5,42
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a6
|
||
|
addiw a7,a5,44
|
||
|
addw a0,a0,a7
|
||
|
addiw t1,a5,45
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,a1
|
||
|
addiw a7,a5,47
|
||
|
addw a0,a0,a1
|
||
|
addiw t1,a5,48
|
||
|
addw a0,a0,a7
|
||
|
addw a0,a0,t1
|
||
|
addw a0,a0,t1
|
||
|
li a4,0
|
||
|
li a2,1
|
||
|
sext.w a7,a1
|
||
|
sw a1,8(a3)
|
||
|
addiw t1,a5,62
|
||
|
li t3,2
|
||
|
.L10:
|
||
|
addiw a1,t1,-12
|
||
|
addw a5,a0,a6
|
||
|
addw a5,a5,a1
|
||
|
addiw a0,t1,-11
|
||
|
addw a5,a5,a0
|
||
|
addw a5,a5,a1
|
||
|
addw a5,a5,a1
|
||
|
addw a5,a5,a7
|
||
|
addiw a0,t1,-9
|
||
|
addw a5,a5,a7
|
||
|
addiw a1,t1,-8
|
||
|
addw a5,a5,a0
|
||
|
addw a5,a5,a1
|
||
|
addw a5,a5,a1
|
||
|
addiw a0,t1,-6
|
||
|
addw a1,a5,a6
|
||
|
addiw t6,t1,-5
|
||
|
addw a1,a1,a0
|
||
|
addw a1,a1,t6
|
||
|
addw a1,a1,a0
|
||
|
addw a1,a1,a0
|
||
|
addw a1,a1,a7
|
||
|
addiw t5,t1,-3
|
||
|
addw a1,a1,a7
|
||
|
addiw t4,t1,-2
|
||
|
addw a1,a1,t5
|
||
|
addw a1,a1,t4
|
||
|
sext.w t0,t1
|
||
|
addw a1,a1,t4
|
||
|
beq a4,a2,.L12
|
||
|
sext.w a0,a1
|
||
|
addiw t1,t1,13
|
||
|
beq a4,t3,.L9
|
||
|
li a4,1
|
||
|
mv a6,t0
|
||
|
j .L10
|
||
|
.L9:
|
||
|
sw a1,4(a3)
|
||
|
sw t0,0(a3)
|
||
|
call putint@plt
|
||
|
ld ra,8(sp)
|
||
|
li a0,0
|
||
|
addi sp,sp,16
|
||
|
jr ra
|
||
|
.L12:
|
||
|
addw a5,a0,a5
|
||
|
addiw a4,t1,-4
|
||
|
addw a5,a5,t6
|
||
|
addw a5,a5,a4
|
||
|
addw a5,a5,t6
|
||
|
addw a5,a5,t6
|
||
|
addw a5,a5,a7
|
||
|
addw a5,a5,a7
|
||
|
addiw a0,t1,-1
|
||
|
addw a5,a5,t4
|
||
|
addw a5,a5,a0
|
||
|
mv t0,a6
|
||
|
addw a0,a5,a0
|
||
|
addiw t1,t1,13
|
||
|
li a4,2
|
||
|
mv a6,t0
|
||
|
j .L10
|
||
|
.size main, .-main
|
||
|
.globl count
|
||
|
.globl sum
|
||
|
.globl a
|
||
|
.globl _sysy_idx
|
||
|
.globl _sysy_us
|
||
|
.globl _sysy_s
|
||
|
.globl _sysy_m
|
||
|
.globl _sysy_h
|
||
|
.globl _sysy_l2
|
||
|
.globl _sysy_l1
|
||
|
.globl _sysy_end
|
||
|
.globl _sysy_start
|
||
|
.bss
|
||
|
.align 3
|
||
|
.set .LANCHOR0,. + 0
|
||
|
.type count, @object
|
||
|
.size count, 4
|
||
|
count:
|
||
|
.zero 4
|
||
|
.type sum, @object
|
||
|
.size sum, 4
|
||
|
sum:
|
||
|
.zero 4
|
||
|
.type a, @object
|
||
|
.size a, 4
|
||
|
a:
|
||
|
.zero 4
|
||
|
.type _sysy_idx, @object
|
||
|
.size _sysy_idx, 4
|
||
|
_sysy_idx:
|
||
|
.zero 4
|
||
|
.type _sysy_us, @object
|
||
|
.size _sysy_us, 4096
|
||
|
_sysy_us:
|
||
|
.zero 4096
|
||
|
.type _sysy_s, @object
|
||
|
.size _sysy_s, 4096
|
||
|
_sysy_s:
|
||
|
.zero 4096
|
||
|
.type _sysy_m, @object
|
||
|
.size _sysy_m, 4096
|
||
|
_sysy_m:
|
||
|
.zero 4096
|
||
|
.type _sysy_h, @object
|
||
|
.size _sysy_h, 4096
|
||
|
_sysy_h:
|
||
|
.zero 4096
|
||
|
.type _sysy_l2, @object
|
||
|
.size _sysy_l2, 4096
|
||
|
_sysy_l2:
|
||
|
.zero 4096
|
||
|
.type _sysy_l1, @object
|
||
|
.size _sysy_l1, 4096
|
||
|
_sysy_l1:
|
||
|
.zero 4096
|
||
|
.type _sysy_end, @object
|
||
|
.size _sysy_end, 16
|
||
|
_sysy_end:
|
||
|
.zero 16
|
||
|
.type _sysy_start, @object
|
||
|
.size _sysy_start, 16
|
||
|
_sysy_start:
|
||
|
.zero 16
|
||
|
.ident "GCC: (Debian 12.2.0-13) 12.2.0"
|
||
|
.section .note.GNU-stack,"",@progbits
|