sysy-data/performance_c/asm/hoist-3.s

196 lines
2.9 KiB
ArmAsm

.text
.attribute 4, 16
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
.file "hoist-3.sy"
.globl func
.p2align 1
.type func,@function
func:
addi sp, sp, -16
sd s0, 8(sp)
lui t0, %hi(loopCount)
lw t1, %lo(loopCount)(t0)
blez t1, .LBB0_4
li t0, 0
li t2, 0
ld t3, 64(sp)
ld t4, 56(sp)
ld t5, 48(sp)
ld t6, 40(sp)
ld s0, 32(sp)
addw a0, a0, a1
ld a1, 24(sp)
addw a0, a0, a2
ld a2, 16(sp)
addw a0, a0, a3
addw a0, a0, a4
addw a0, a0, a5
addw a0, a0, a6
addw a0, a0, a7
addw a0, a0, a2
addw a0, a0, a1
addw a0, a0, s0
addw a0, a0, t6
addw a0, a0, t5
addw a0, a0, t4
addw a0, a0, t3
li a1, 100
mulw a0, a0, a1
lui a1, 335544
addiw a1, a1, 1311
mul a0, a0, a1
srli a1, a0, 63
srai a0, a0, 37
add a0, a0, a1
lui a1, 2932
addiw a1, a1, 127
lui a2, 366211
addiw a2, a2, -255
.LBB0_2:
addw a3, t0, a0
mul a4, a3, a1
srli a5, a4, 63
srai a4, a4, 54
addw a4, a4, a5
mulw a4, a4, a2
addiw t2, t2, 1
subw t0, a3, a4
blt t2, t1, .LBB0_2
mv a0, t0
ld s0, 8(sp)
addi sp, sp, 16
ret
.LBB0_4:
li t0, 0
mv a0, t0
ld s0, 8(sp)
addi sp, sp, 16
ret
.Lfunc_end0:
.size func, .Lfunc_end0-func
.globl main
.p2align 1
.type main,@function
main:
addi sp, sp, -16
sd ra, 8(sp)
sd s0, 0(sp)
call getint
lui s0, %hi(loopCount)
sw a0, %lo(loopCount)(s0)
li a0, 122
call _sysy_starttime
lw a0, %lo(loopCount)(s0)
blez a0, .LBB1_3
li s0, 0
li a1, 0
lui a2, 2932
addiw a2, a2, 127
lui a3, 366211
addiw a3, a3, -255
.LBB1_2:
addiw a4, s0, 15
mul a5, a4, a2
srli s0, a5, 63
srai a5, a5, 54
addw a5, a5, s0
mulw a5, a5, a3
addiw a1, a1, 1
subw s0, a4, a5
blt a1, a0, .LBB1_2
j .LBB1_4
.LBB1_3:
li s0, 0
.LBB1_4:
li a0, 124
call _sysy_stoptime
mv a0, s0
call putint
li a0, 10
call putch
li a0, 0
ld ra, 8(sp)
ld s0, 0(sp)
addi sp, sp, 16
ret
.Lfunc_end1:
.size main, .Lfunc_end1-main
.type loopCount,@object
.section .sbss,"aw",@nobits
.globl loopCount
.p2align 2
loopCount:
.word 0
.size loopCount, 4
.type _sysy_start,@object
.bss
.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