273 lines
3.8 KiB
ArmAsm
273 lines
3.8 KiB
ArmAsm
.file "02_mv2.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 mv
|
|
.type mv, @function
|
|
mv:
|
|
ble a0,zero,.L11
|
|
addi sp,sp,-32
|
|
slli a5,a0,32
|
|
sd s0,16(sp)
|
|
sd s1,8(sp)
|
|
sd s2,0(sp)
|
|
mv s1,a0
|
|
mv s0,a1
|
|
mv a0,a3
|
|
mv s2,a2
|
|
li a1,0
|
|
srli a2,a5,30
|
|
sd ra,24(sp)
|
|
call memset@plt
|
|
mv a3,a0
|
|
slli t1,s1,2
|
|
li a2,8192
|
|
add a0,s0,t1
|
|
add t3,a3,t1
|
|
addi a2,a2,-152
|
|
.L3:
|
|
sub a5,a0,t1
|
|
mv a1,s2
|
|
.L5:
|
|
lw a6,0(a5)
|
|
addi a5,a5,4
|
|
beq a6,zero,.L4
|
|
lw a4,0(a1)
|
|
lw a7,0(a3)
|
|
mulw a4,a4,a6
|
|
addw a4,a4,a7
|
|
sw a4,0(a3)
|
|
.L4:
|
|
addi a1,a1,4
|
|
bne a0,a5,.L5
|
|
addi a3,a3,4
|
|
add a0,a0,a2
|
|
bne a3,t3,.L3
|
|
ld ra,24(sp)
|
|
ld s0,16(sp)
|
|
ld s1,8(sp)
|
|
ld s2,0(sp)
|
|
addi sp,sp,32
|
|
jr ra
|
|
.L11:
|
|
ret
|
|
.size mv, .-mv
|
|
.section .text.startup,"ax",@progbits
|
|
.align 1
|
|
.globl main
|
|
.type main, @function
|
|
main:
|
|
addi sp,sp,-112
|
|
sd s1,88(sp)
|
|
sd s5,56(sp)
|
|
sd s6,48(sp)
|
|
sd s8,32(sp)
|
|
sd ra,104(sp)
|
|
sd s0,96(sp)
|
|
sd s2,80(sp)
|
|
sd s3,72(sp)
|
|
sd s4,64(sp)
|
|
sd s7,40(sp)
|
|
sd s9,24(sp)
|
|
sd s10,16(sp)
|
|
sd s11,8(sp)
|
|
call getint@plt
|
|
mv s5,a0
|
|
slli s6,a0,2
|
|
lla s1,A
|
|
lla s8,B
|
|
ble a0,zero,.L16
|
|
li s4,8192
|
|
addi s3,s4,-148
|
|
mul s3,a0,s3
|
|
lla s1,A
|
|
slli s6,a0,2
|
|
add s2,s1,s6
|
|
addi s4,s4,-152
|
|
add s3,s1,s3
|
|
.L17:
|
|
sub s0,s2,s6
|
|
.L18:
|
|
call getint@plt
|
|
sw a0,0(s0)
|
|
addi s0,s0,4
|
|
bne s0,s2,.L18
|
|
add s2,s0,s4
|
|
bne s2,s3,.L17
|
|
lla s8,B
|
|
mv s0,s8
|
|
add s2,s8,s6
|
|
.L20:
|
|
call getint@plt
|
|
sw a0,0(s0)
|
|
addi s0,s0,4
|
|
bne s0,s2,.L20
|
|
.L16:
|
|
li a0,61
|
|
addiw s2,s5,-1
|
|
call _sysy_starttime@plt
|
|
slli a5,s2,32
|
|
srli s2,a5,30
|
|
lla s9,C
|
|
addi s2,s2,4
|
|
add s1,s1,s6
|
|
add s11,s9,s6
|
|
add s10,s8,s6
|
|
li s0,50
|
|
.L21:
|
|
ble s5,zero,.L50
|
|
li s7,8192
|
|
lla s4,C
|
|
addi s7,s7,-152
|
|
lla s3,B
|
|
.L30:
|
|
li a1,0
|
|
mv a2,s2
|
|
mv a0,s4
|
|
call memset@plt
|
|
mv a1,s9
|
|
mv a0,s1
|
|
.L22:
|
|
sub a5,a0,s6
|
|
mv a3,s8
|
|
.L24:
|
|
lw a2,0(a5)
|
|
addi a5,a5,4
|
|
beq a2,zero,.L23
|
|
lw a4,0(a3)
|
|
lw a6,0(a1)
|
|
mulw a4,a4,a2
|
|
addw a4,a4,a6
|
|
sw a4,0(a1)
|
|
.L23:
|
|
addi a3,a3,4
|
|
bne a5,a0,.L24
|
|
addi a1,a1,4
|
|
add a0,a5,s7
|
|
bne a1,s11,.L22
|
|
li a1,0
|
|
mv a2,s2
|
|
mv a0,s3
|
|
call memset@plt
|
|
mv a1,s8
|
|
mv a0,s1
|
|
.L26:
|
|
sub a5,a0,s6
|
|
mv a3,s9
|
|
.L28:
|
|
lw a2,0(a5)
|
|
addi a5,a5,4
|
|
beq a2,zero,.L27
|
|
lw a4,0(a3)
|
|
lw a6,0(a1)
|
|
mulw a4,a4,a2
|
|
addw a4,a4,a6
|
|
sw a4,0(a1)
|
|
.L27:
|
|
addi a3,a3,4
|
|
bne a5,a0,.L28
|
|
addi a1,a1,4
|
|
add a0,a5,s7
|
|
bne s10,a1,.L26
|
|
addiw s0,s0,-1
|
|
bne s0,zero,.L30
|
|
.L31:
|
|
li a0,69
|
|
call _sysy_stoptime@plt
|
|
mv a0,s5
|
|
lla a1,C
|
|
call putarray@plt
|
|
ld ra,104(sp)
|
|
ld s0,96(sp)
|
|
ld s1,88(sp)
|
|
ld s2,80(sp)
|
|
ld s3,72(sp)
|
|
ld s4,64(sp)
|
|
ld s5,56(sp)
|
|
ld s6,48(sp)
|
|
ld s7,40(sp)
|
|
ld s8,32(sp)
|
|
ld s9,24(sp)
|
|
ld s10,16(sp)
|
|
ld s11,8(sp)
|
|
li a0,0
|
|
addi sp,sp,112
|
|
jr ra
|
|
.L50:
|
|
addiw s0,s0,-1
|
|
bne s0,zero,.L21
|
|
j .L31
|
|
.size main, .-main
|
|
.globl C
|
|
.globl B
|
|
.globl A
|
|
.globl x
|
|
.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
|
|
.type C, @object
|
|
.size C, 8040
|
|
C:
|
|
.zero 8040
|
|
.type B, @object
|
|
.size B, 8040
|
|
B:
|
|
.zero 8040
|
|
.type A, @object
|
|
.size A, 16160400
|
|
A:
|
|
.zero 16160400
|
|
.type x, @object
|
|
.size x, 4
|
|
x:
|
|
.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
|