215 lines
3.1 KiB
ArmAsm
215 lines
3.1 KiB
ArmAsm
|
.text
|
||
|
.attribute 4, 16
|
||
|
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
|
||
|
.file "14_dp.sy"
|
||
|
.globl main
|
||
|
.p2align 1
|
||
|
.type main,@function
|
||
|
main:
|
||
|
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)
|
||
|
sd s6, 0(sp)
|
||
|
call getint
|
||
|
mv s3, a0
|
||
|
call getint
|
||
|
mv s2, a0
|
||
|
blez s3, .LBB0_4
|
||
|
addiw a0, s3, 1
|
||
|
slli a0, a0, 32
|
||
|
srli s4, a0, 32
|
||
|
lui a0, %hi(dp)
|
||
|
addi s6, a0, %lo(dp)
|
||
|
addi s0, s4, -1
|
||
|
lui a0, %hi(t+8)
|
||
|
addi s1, a0, %lo(t+8)
|
||
|
li s5, 1
|
||
|
.LBB0_2:
|
||
|
call getint
|
||
|
srliw a1, a0, 31
|
||
|
add a1, a1, a0
|
||
|
andi a1, a1, -2
|
||
|
subw a0, a0, a1
|
||
|
slli a0, a0, 2
|
||
|
add a0, a0, s1
|
||
|
sw s5, 0(a0)
|
||
|
lw a0, 0(s6)
|
||
|
lw a1, 4(s1)
|
||
|
addw a0, a0, a1
|
||
|
sw a0, 140(s6)
|
||
|
addi s6, s6, 140
|
||
|
addi s0, s0, -1
|
||
|
addi s1, s1, 8
|
||
|
bnez s0, .LBB0_2
|
||
|
slti a0, s3, 1
|
||
|
slti a1, s2, 1
|
||
|
or a0, a0, a1
|
||
|
beqz a0, .LBB0_11
|
||
|
.LBB0_4:
|
||
|
bltz s2, .LBB0_9
|
||
|
li a3, 0
|
||
|
li a0, 140
|
||
|
mul a0, s3, a0
|
||
|
lui a1, %hi(dp)
|
||
|
addi a1, a1, %lo(dp)
|
||
|
add a1, a1, a0
|
||
|
addiw a0, s2, 1
|
||
|
slli a0, a0, 32
|
||
|
srli a2, a0, 32
|
||
|
j .LBB0_7
|
||
|
.LBB0_6:
|
||
|
addi a2, a2, -1
|
||
|
addi a1, a1, 4
|
||
|
mv a3, a0
|
||
|
beqz a2, .LBB0_10
|
||
|
.LBB0_7:
|
||
|
lw a0, 0(a1)
|
||
|
blt a3, a0, .LBB0_6
|
||
|
mv a0, a3
|
||
|
j .LBB0_6
|
||
|
.LBB0_9:
|
||
|
li a0, 0
|
||
|
.LBB0_10:
|
||
|
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)
|
||
|
ld s6, 0(sp)
|
||
|
addi sp, sp, 64
|
||
|
ret
|
||
|
.LBB0_11:
|
||
|
addiw a0, s2, 1
|
||
|
slli a0, a0, 32
|
||
|
srli t1, a0, 32
|
||
|
li a1, 1
|
||
|
lui a2, %hi(dp)
|
||
|
addi a7, a2, %lo(dp)
|
||
|
addi t0, a7, 144
|
||
|
li a6, 140
|
||
|
lui a2, %hi(t)
|
||
|
addi a5, a2, %lo(t)
|
||
|
j .LBB0_13
|
||
|
.LBB0_12:
|
||
|
addi a1, a1, 1
|
||
|
addi t0, t0, 140
|
||
|
beq a1, s4, .LBB0_4
|
||
|
.LBB0_13:
|
||
|
mul a2, a1, a6
|
||
|
add a2, a2, a7
|
||
|
lw a4, -140(a2)
|
||
|
mv a3, t0
|
||
|
li s0, 1
|
||
|
j .LBB0_15
|
||
|
.LBB0_14:
|
||
|
addi s0, s0, 1
|
||
|
andi a4, s0, 1
|
||
|
slli a0, a1, 3
|
||
|
slli a4, a4, 2
|
||
|
or a0, a0, a4
|
||
|
add a0, a0, a5
|
||
|
lw a0, 0(a0)
|
||
|
addw a0, a0, s1
|
||
|
sw a0, 0(a3)
|
||
|
addi a3, a3, 4
|
||
|
mv a4, a2
|
||
|
beq t1, s0, .LBB0_12
|
||
|
.LBB0_15:
|
||
|
lw a2, -140(a3)
|
||
|
mv s1, a2
|
||
|
blt a4, a2, .LBB0_14
|
||
|
mv s1, a4
|
||
|
j .LBB0_14
|
||
|
.Lfunc_end0:
|
||
|
.size main, .Lfunc_end0-main
|
||
|
|
||
|
.type t,@object
|
||
|
.bss
|
||
|
.globl t
|
||
|
.p2align 2
|
||
|
t:
|
||
|
.zero 8040
|
||
|
.size t, 8040
|
||
|
|
||
|
.type dp,@object
|
||
|
.globl dp
|
||
|
.p2align 2
|
||
|
dp:
|
||
|
.zero 140700
|
||
|
.size dp, 140700
|
||
|
|
||
|
.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
|
||
|
|
||
|
.ident "Debian clang version 14.0.6"
|
||
|
.section ".note.GNU-stack","",@progbits
|
||
|
.addrsig
|