sysy-data/performance_c/asm/02_mv3.s

329 lines
4.5 KiB
ArmAsm

.text
.attribute 4, 16
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
.file "02_mv3.sy"
.globl mv
.p2align 1
.type mv,@function
mv:
addi sp, sp, -64
sd ra, 56(sp)
sd s0, 48(sp)
sd s1, 40(sp)
sd s2, 32(sp)
sd s3, 24(sp)
sd s4, 16(sp)
sd s5, 8(sp)
blez a0, .LBB0_7
mv s3, a3
mv s2, a2
mv s5, a1
slli a0, a0, 32
srli s4, a0, 32
srli a2, a0, 30
mv a0, a3
li a1, 0
call memset@plt
li a0, 0
lui a1, 2
addiw a6, a1, -152
j .LBB0_3
.LBB0_2:
addi a0, a0, 1
add s5, s5, a6
beq a0, s4, .LBB0_7
.LBB0_3:
slli a1, a0, 2
add a2, s3, a1
mv a3, s4
mv a4, s2
mv a5, s5
j .LBB0_5
.LBB0_4:
addi a5, a5, 4
addi a3, a3, -1
addi a4, a4, 4
beqz a3, .LBB0_2
.LBB0_5:
lw a1, 0(a5)
beqz a1, .LBB0_4
lw s0, 0(a4)
lw s1, 0(a2)
mulw a1, s0, a1
addw a1, a1, s1
sw a1, 0(a2)
j .LBB0_4
.LBB0_7:
ld ra, 56(sp)
ld s0, 48(sp)
ld s1, 40(sp)
ld s2, 32(sp)
ld s3, 24(sp)
ld s4, 16(sp)
ld s5, 8(sp)
addi sp, sp, 64
ret
.Lfunc_end0:
.size mv, .Lfunc_end0-mv
.globl main
.p2align 1
.type main,@function
main:
addi sp, sp, -96
sd ra, 88(sp)
sd s0, 80(sp)
sd s1, 72(sp)
sd s2, 64(sp)
sd s3, 56(sp)
sd s4, 48(sp)
sd s5, 40(sp)
sd s6, 32(sp)
sd s7, 24(sp)
sd s8, 16(sp)
sd s9, 8(sp)
sd s10, 0(sp)
call getint
mv s2, a0
blez a0, .LBB1_23
li s6, 0
lui a0, %hi(A)
addi s7, a0, %lo(A)
slli s3, s2, 32
srli s4, s3, 32
lui a0, 2
addiw s5, a0, -152
.LBB1_2:
mv s1, s4
mv s0, s7
.LBB1_3:
call getint
sw a0, 0(s0)
addi s1, s1, -1
addi s0, s0, 4
bnez s1, .LBB1_3
addi s6, s6, 1
add s7, s7, s5
bne s6, s4, .LBB1_2
blez s2, .LBB1_23
lui a0, %hi(B)
srli s10, s3, 32
addi s3, a0, %lo(B)
mv s1, s10
.LBB1_7:
call getint
sw a0, 0(s3)
addi s1, s1, -1
addi s3, s3, 4
bnez s1, .LBB1_7
li a0, 60
call _sysy_starttime
blez s2, .LBB1_24
li a0, 0
slli s3, s10, 2
lui a1, %hi(C)
addi s4, a1, %lo(C)
lui a1, %hi(A)
addi s5, a1, %lo(A)
lui a1, %hi(B)
addi s9, a1, %lo(B)
lui a1, 2
addiw s6, a1, -152
li s7, 49
j .LBB1_11
.LBB1_10:
addiw a0, s8, 1
bgeu s8, s7, .LBB1_24
.LBB1_11:
mv s8, a0
mv a0, s4
li a1, 0
mv a2, s3
call memset@plt
li a0, 0
mv a6, s5
j .LBB1_13
.LBB1_12:
addi a0, a0, 1
add a6, a6, s6
beq a0, s10, .LBB1_17
.LBB1_13:
slli a2, a0, 2
add a2, a2, s4
mv a3, a6
mv a4, s9
mv a5, s10
j .LBB1_15
.LBB1_14:
addi a5, a5, -1
addi a4, a4, 4
addi a3, a3, 4
beqz a5, .LBB1_12
.LBB1_15:
lw s1, 0(a3)
beqz s1, .LBB1_14
lw s0, 0(a4)
lw a1, 0(a2)
mulw s1, s0, s1
addw a1, a1, s1
sw a1, 0(a2)
j .LBB1_14
.LBB1_17:
mv a0, s9
li a1, 0
mv a2, s3
call memset@plt
li a0, 0
mv a6, s5
j .LBB1_19
.LBB1_18:
addi a0, a0, 1
add a6, a6, s6
beq a0, s10, .LBB1_10
.LBB1_19:
slli a2, a0, 2
add a2, a2, s9
mv a3, a6
mv a4, s4
mv a5, s10
j .LBB1_21
.LBB1_20:
addi a5, a5, -1
addi a4, a4, 4
addi a3, a3, 4
beqz a5, .LBB1_18
.LBB1_21:
lw s1, 0(a3)
beqz s1, .LBB1_20
lw s0, 0(a4)
lw a1, 0(a2)
mulw s1, s0, s1
addw a1, a1, s1
sw a1, 0(a2)
j .LBB1_20
.LBB1_23:
li a0, 60
call _sysy_starttime
.LBB1_24:
li a0, 68
call _sysy_stoptime
lui a0, %hi(C)
addi a1, a0, %lo(C)
mv a0, s2
call putarray
li a0, 0
ld ra, 88(sp)
ld s0, 80(sp)
ld s1, 72(sp)
ld s2, 64(sp)
ld s3, 56(sp)
ld s4, 48(sp)
ld s5, 40(sp)
ld s6, 32(sp)
ld s7, 24(sp)
ld s8, 16(sp)
ld s9, 8(sp)
ld s10, 0(sp)
addi sp, sp, 96
ret
.Lfunc_end1:
.size main, .Lfunc_end1-main
.type A,@object
.bss
.globl A
.p2align 2
A:
.zero 16160400
.size A, 16160400
.type B,@object
.globl B
.p2align 2
B:
.zero 8040
.size B, 8040
.type C,@object
.globl C
.p2align 2
C:
.zero 8040
.size C, 8040
.type _sysy_start,@object
.globl _sysy_start
.p2align 3
_sysy_start:
.zero 16
.size _sysy_start, 16
.type _sysy_end,@object
.globl _sysy_end
.p2align 3
_sysy_end:
.zero 16
.size _sysy_end, 16
.type _sysy_l1,@object
.globl _sysy_l1
.p2align 2
_sysy_l1:
.zero 4096
.size _sysy_l1, 4096
.type _sysy_l2,@object
.globl _sysy_l2
.p2align 2
_sysy_l2:
.zero 4096
.size _sysy_l2, 4096
.type _sysy_h,@object
.globl _sysy_h
.p2align 2
_sysy_h:
.zero 4096
.size _sysy_h, 4096
.type _sysy_m,@object
.globl _sysy_m
.p2align 2
_sysy_m:
.zero 4096
.size _sysy_m, 4096
.type _sysy_s,@object
.globl _sysy_s
.p2align 2
_sysy_s:
.zero 4096
.size _sysy_s, 4096
.type _sysy_us,@object
.globl _sysy_us
.p2align 2
_sysy_us:
.zero 4096
.size _sysy_us, 4096
.type _sysy_idx,@object
.section .sbss,"aw",@nobits
.globl _sysy_idx
.p2align 2
_sysy_idx:
.word 0
.size _sysy_idx, 4
.type x,@object
.globl x
.p2align 2
x:
.word 0
.size x, 4
.ident "Debian clang version 14.0.6"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym C