sysy-data/performance_c/asm/00_bitset3.s

434 lines
6.4 KiB
ArmAsm
Raw Permalink Normal View History

2024-06-14 13:34:46 +08:00
.text
.attribute 4, 16
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
.file "00_bitset3.sy"
.globl set
.p2align 1
.type set,@function
set:
addi sp, sp, -128
sw zero, 124(sp)
li a3, 1
sw a3, 4(sp)
li a3, 2
sw a3, 8(sp)
li a3, 4
sw a3, 12(sp)
li a3, 8
sw a3, 16(sp)
li a3, 16
sw a3, 20(sp)
li a3, 32
sw a3, 24(sp)
li a3, 64
sw a3, 28(sp)
li a3, 128
sw a3, 32(sp)
li a3, 256
sw a3, 36(sp)
li a3, 512
sw a3, 40(sp)
li a3, 1024
sw a3, 44(sp)
lui a3, 1
addiw a4, a3, -2048
sw a4, 48(sp)
sw a3, 52(sp)
lui a3, 2
sw a3, 56(sp)
lui a3, 4
sw a3, 60(sp)
lui a3, 8
sw a3, 64(sp)
lui a3, 16
sw a3, 68(sp)
lui a3, 32
sw a3, 72(sp)
lui a3, 64
sw a3, 76(sp)
lui a3, 128
sw a3, 80(sp)
lui a3, 256
sw a3, 84(sp)
lui a3, 512
sw a3, 88(sp)
lui a3, 1024
sw a3, 92(sp)
lui a3, 2048
sw a3, 96(sp)
lui a3, 4096
sw a3, 100(sp)
lui a3, 8192
sw a3, 104(sp)
lui a3, 16384
sw a3, 108(sp)
lui a3, 32768
sw a3, 112(sp)
lui a3, 65536
sw a3, 116(sp)
lui a3, 131072
lui a4, 73
addiw a4, a4, 991
sw a3, 120(sp)
blt a4, a1, .LBB0_8
lui a3, 559241
addiw a3, a3, -1911
mul a3, a1, a3
srli a3, a3, 32
addw a3, a3, a1
srliw a4, a3, 31
sraiw a3, a3, 4
add a4, a4, a3
slli a3, a4, 2
add a0, a0, a3
lw a3, 0(a0)
li a5, 30
mulw a4, a4, a5
subw a1, a1, a4
slli a1, a1, 2
addi a4, sp, 4
add a1, a1, a4
lw a1, 0(a1)
divw a4, a3, a1
srliw a5, a4, 31
add a5, a5, a4
andi a5, a5, -2
subw a5, a4, a5
bne a5, a2, .LBB0_3
li a4, 0
j .LBB0_7
.LBB0_3:
xori a4, a2, 1
or a6, a4, a5
mv a4, a1
beqz a6, .LBB0_5
li a4, 0
.LBB0_5:
xori a5, a5, 1
or a2, a2, a5
bnez a2, .LBB0_7
subw a4, a4, a1
.LBB0_7:
addw a1, a4, a3
sw a1, 0(a0)
.LBB0_8:
li a0, 0
addi sp, sp, 128
ret
.Lfunc_end0:
.size set, .Lfunc_end0-set
.globl rand
.p2align 1
.type rand,@function
rand:
lui a1, %hi(staticvalue)
lw a0, %lo(staticvalue)(a1)
lui a2, %hi(seed)
lw a3, %lo(seed)(a2)
addi a2, a2, %lo(seed)
lw a4, 4(a2)
lw a2, 8(a2)
mulw a0, a3, a0
addw a0, a0, a4
remw a0, a0, a2
bgez a0, .LBB1_2
addw a0, a0, a2
.LBB1_2:
sw a0, %lo(staticvalue)(a1)
ret
.Lfunc_end1:
.size rand, .Lfunc_end1-rand
.globl main
.p2align 1
.type main,@function
main:
addi sp, sp, -240
sd ra, 232(sp)
sd s0, 224(sp)
sd s1, 216(sp)
sd s2, 208(sp)
sd s3, 200(sp)
sd s4, 192(sp)
sd s5, 184(sp)
sd s6, 176(sp)
sd s7, 168(sp)
sd s8, 160(sp)
sd s9, 152(sp)
sd s10, 144(sp)
sd s11, 136(sp)
call getint
mv s0, a0
call getint
lui s1, %hi(staticvalue)
sw a0, %lo(staticvalue)(s1)
li a0, 57
call _sysy_starttime
blez s0, .LBB2_13
lw s1, %lo(staticvalue)(s1)
lui a0, %hi(seed)
lw t0, %lo(seed)(a0)
addi a0, a0, %lo(seed)
lw t1, 4(a0)
lw a2, 8(a0)
lui a0, 458130
addiw s4, a0, -635
lui a0, 73
addiw s10, a0, 992
li ra, 1
lui a0, 1
addiw s11, a0, -2048
lui a0, 559241
addiw a7, a0, -1911
lui a0, %hi(a)
addi a6, a0, %lo(a)
lui t2, 2048
lui t3, 4096
lui t4, 8192
lui t5, 16384
lui t6, 32768
lui s2, 65536
lui s5, 131072
li s6, 30
addi s7, sp, 12
j .LBB2_3
.LBB2_2:
sext.w a0, s0
addiw s0, s0, -1
addw a1, a4, s9
sw a1, 0(s3)
bgeu ra, a0, .LBB2_12
.LBB2_3:
mulw a0, t0, s1
addw a0, a0, t1
remw a3, a0, a2
bgez a3, .LBB2_5
addw a3, a3, a2
.LBB2_5:
mul a0, a3, s4
srli a4, a0, 63
srai a0, a0, 32
srli a0, a0, 17
addw a0, a0, a4
mulw a0, a0, s10
mulw a4, a3, t0
addw a4, a4, t1
remw s1, a4, a2
subw s8, a3, a0
bgez s1, .LBB2_7
addw s1, s1, a2
.LBB2_7:
srliw a0, s1, 31
sw zero, 132(sp)
sw ra, 12(sp)
li a1, 2
sw a1, 16(sp)
li a1, 4
sw a1, 20(sp)
li a1, 8
sw a1, 24(sp)
li a1, 16
sw a1, 28(sp)
li a1, 32
sw a1, 32(sp)
li a1, 64
sw a1, 36(sp)
li a1, 128
sw a1, 40(sp)
li a1, 256
sw a1, 44(sp)
li a1, 512
sw a1, 48(sp)
li a1, 1024
sw a1, 52(sp)
sw s11, 56(sp)
lui a1, 1
sw a1, 60(sp)
lui a1, 2
sw a1, 64(sp)
lui a1, 4
sw a1, 68(sp)
lui a1, 8
sw a1, 72(sp)
lui a1, 16
sw a1, 76(sp)
lui a1, 32
sw a1, 80(sp)
lui a1, 64
sw a1, 84(sp)
lui a1, 128
sw a1, 88(sp)
lui a1, 256
sw a1, 92(sp)
lui a1, 512
sw a1, 96(sp)
lui a1, 1024
sw a1, 100(sp)
sw t2, 104(sp)
sw t3, 108(sp)
sw t4, 112(sp)
sw t5, 116(sp)
sw t6, 120(sp)
sw s2, 124(sp)
sw s5, 128(sp)
mul a3, s8, a7
srli a3, a3, 32
addw a3, a3, s8
srliw a4, a3, 31
sraiw a3, a3, 4
add a3, a3, a4
slli a4, a3, 2
add s3, a4, a6
lw s9, 0(s3)
mulw a3, a3, s6
subw a3, s8, a3
slli a3, a3, 2
add a3, a3, s7
lw a3, 0(a3)
add a0, a0, s1
andi a0, a0, -2
subw a5, s1, a0
divw a0, s9, a3
srliw a4, a0, 31
add a4, a4, a0
andi a4, a4, -2
subw a0, a0, a4
li a4, 0
beq a0, a5, .LBB2_2
xori a4, a5, 1
or a1, a4, a0
mv a4, a3
beqz a1, .LBB2_10
li a4, 0
.LBB2_10:
xori a0, a0, 1
or a0, a0, a5
bnez a0, .LBB2_2
subw a4, a4, a3
j .LBB2_2
.LBB2_12:
lui a0, %hi(staticvalue)
sw s1, %lo(staticvalue)(a0)
.LBB2_13:
li a0, 65
call _sysy_stoptime
lui a0, %hi(a)
addi a1, a0, %lo(a)
lui a0, 2
addiw a0, a0, 1808
call putarray
li a0, 0
ld ra, 232(sp)
ld s0, 224(sp)
ld s1, 216(sp)
ld s2, 208(sp)
ld s3, 200(sp)
ld s4, 192(sp)
ld s5, 184(sp)
ld s6, 176(sp)
ld s7, 168(sp)
ld s8, 160(sp)
ld s9, 152(sp)
ld s10, 144(sp)
ld s11, 136(sp)
addi sp, sp, 240
ret
.Lfunc_end2:
.size main, .Lfunc_end2-main
.type seed,@object
.data
.globl seed
.p2align 2
seed:
.word 19971231
.word 19981013
.word 1000000007
.size seed, 12
.type staticvalue,@object
.section .sbss,"aw",@nobits
.globl staticvalue
.p2align 2
staticvalue:
.word 0
.size staticvalue, 4
.type a,@object
.bss
.globl a
.p2align 2
a:
.zero 40000
.size a, 40000
.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 a