sysy-data/performance_c/asm/sl2.s

286 lines
4.2 KiB
ArmAsm

.text
.attribute 4, 16
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
.file "sl2.sy"
.globl main
.p2align 1
.type main,@function
main:
addi sp, sp, -144
sd ra, 136(sp)
sd s0, 128(sp)
sd s1, 120(sp)
sd s2, 112(sp)
sd s3, 104(sp)
sd s4, 96(sp)
sd s5, 88(sp)
sd s6, 80(sp)
sd s7, 72(sp)
sd s8, 64(sp)
sd s9, 56(sp)
sd s10, 48(sp)
sd s11, 40(sp)
call getint
mv s11, a0
call getint
mv s2, a0
li a0, 14
call _sysy_starttime
blez s11, .LBB0_15
li s4, 0
slli a0, s11, 32
srli s9, a0, 32
lui a1, %hi(x)
addi s5, a1, %lo(x)
srli s3, a0, 30
lui a0, 1
addiw s6, a0, -1696
lui a0, 352
addiw s7, a0, -1792
lui a0, %hi(y)
addi s8, a0, %lo(y)
li s0, 1
.LBB0_2:
li s1, 0
mv s10, s5
.LBB0_3:
mul a0, s1, s6
mul a1, s4, s7
add a0, a0, a1
add a0, a0, s8
li a1, 0
mv a2, s3
call memset@plt
mv a0, s9
mv a1, s10
.LBB0_4:
sw s0, 0(a1)
addi a0, a0, -1
addi a1, a1, 4
bnez a0, .LBB0_4
addi s1, s1, 1
addi a0, s10, 1200
addi s10, a0, 1200
bne s1, s9, .LBB0_3
addi s4, s4, 1
add s5, s5, s7
bne s4, s9, .LBB0_2
li a0, 3
blt s11, a0, .LBB0_15
sd s11, 8(sp)
addiw a0, s11, -1
slli a0, a0, 32
srli t5, a0, 32
addi t4, t5, -1
li s3, 1
lui a0, 704
addiw a0, a0, -1180
lui a1, %hi(x)
addi t6, a1, %lo(x)
add s10, t6, a0
lui a0, 352
addiw a1, a0, -1788
add s9, t6, a1
lui a1, 353
addiw a1, a1, -1084
add t0, t6, a1
addiw a1, a0, 612
add t1, t6, a1
addi a1, t6, 1202
addi t3, a1, 1202
lui a1, 1
addiw s6, a1, -1696
addiw s4, a0, -1792
.LBB0_9:
addi a0, s3, 1
sd a0, 16(sp)
mv s7, t1
mv s8, t0
sd s9, 24(sp)
sd s10, 32(sp)
mv s11, t3
li s5, 1
.LBB0_10:
mul a0, s5, s6
mul a1, s3, s4
add a0, a0, a1
add a0, a0, t6
lw a5, 0(a0)
addi s5, s5, 1
mv a3, t4
mv a4, s7
mv a1, s8
mv a0, s9
mv a2, s10
mv s0, s11
.LBB0_11:
lw ra, 0(s0)
lw s1, 0(a2)
lw t2, 0(a0)
lw a6, 0(a1)
addw ra, s1, ra
lw a7, 4(a4)
addw s1, ra, t2
addw s1, s1, a6
addw a5, a5, s1
addw a5, a5, a7
divw a5, a5, s2
sw a5, 0(a4)
addi a4, a4, 4
addi s0, s0, 4
addi a2, a2, 4
addi a0, a0, 4
addi a3, a3, -1
addi a1, a1, 4
bnez a3, .LBB0_11
add s11, s11, s6
add s10, s10, s6
add s9, s9, s6
add s8, s8, s6
add s7, s7, s6
bne s5, t5, .LBB0_10
add t3, t3, s4
ld s10, 32(sp)
add s10, s10, s4
ld s9, 24(sp)
add s9, s9, s4
add t0, t0, s4
add t1, t1, s4
ld a0, 16(sp)
mv s3, a0
bne a0, t5, .LBB0_9
ld s11, 8(sp)
addiw s2, s11, -2
j .LBB0_16
.LBB0_15:
li s2, 0
.LBB0_16:
li a0, 54
call _sysy_stoptime
lui a0, %hi(x)
addi s0, a0, %lo(x)
mv a0, s11
mv a1, s0
call putarray
srliw a0, s11, 31
addw a0, s11, a0
sraiw a0, a0, 1
lui a1, 1
addiw s3, a1, -1696
mul a1, a0, s3
lui a2, 352
addiw s1, a2, -1792
mul a0, a0, s1
add a0, a0, a1
add a1, a0, s0
mv a0, s11
call putarray
mul a0, s2, s3
mul a1, s2, s1
add a0, a0, a1
add a1, a0, s0
mv a0, s11
call putarray
li a0, 0
ld ra, 136(sp)
ld s0, 128(sp)
ld s1, 120(sp)
ld s2, 112(sp)
ld s3, 104(sp)
ld s4, 96(sp)
ld s5, 88(sp)
ld s6, 80(sp)
ld s7, 72(sp)
ld s8, 64(sp)
ld s9, 56(sp)
ld s10, 48(sp)
ld s11, 40(sp)
addi sp, sp, 144
ret
.Lfunc_end0:
.size main, .Lfunc_end0-main
.type x,@object
.bss
.globl x
.p2align 2
x:
.zero 864000000
.size x, 864000000
.type y,@object
.globl y
.p2align 2
y:
.zero 864000000
.size y, 864000000
.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
.addrsig_sym x