509 lines
7.9 KiB
ArmAsm
509 lines
7.9 KiB
ArmAsm
.text
|
|
.attribute 4, 16
|
|
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
|
|
.file "shuffle0.sy"
|
|
.globl hash
|
|
.p2align 1
|
|
.type hash,@function
|
|
hash:
|
|
lui a1, %hi(hashmod)
|
|
lw a1, %lo(hashmod)(a1)
|
|
remw a0, a0, a1
|
|
ret
|
|
.Lfunc_end0:
|
|
.size hash, .Lfunc_end0-hash
|
|
|
|
.globl insert
|
|
.p2align 1
|
|
.type insert,@function
|
|
insert:
|
|
lui a2, %hi(hashmod)
|
|
lw a2, %lo(hashmod)(a2)
|
|
remw a2, a0, a2
|
|
slli a2, a2, 2
|
|
lui a3, %hi(head)
|
|
addi a3, a3, %lo(head)
|
|
add a6, a2, a3
|
|
lw a7, 0(a6)
|
|
beqz a7, .LBB1_5
|
|
lui a2, %hi(key)
|
|
addi a2, a2, %lo(key)
|
|
lui a4, %hi(next)
|
|
addi a5, a4, %lo(next)
|
|
mv a4, a7
|
|
.LBB1_2:
|
|
slli a4, a4, 2
|
|
add a3, a4, a2
|
|
lw a3, 0(a3)
|
|
beq a3, a0, .LBB1_6
|
|
add a3, a4, a5
|
|
lw a4, 0(a3)
|
|
bnez a4, .LBB1_2
|
|
lui t0, %hi(cnt)
|
|
lw a4, %lo(cnt)(t0)
|
|
li a2, 0
|
|
addiw a4, a4, 1
|
|
lui a5, %hi(next)
|
|
addi a5, a5, %lo(next)
|
|
slli a3, a4, 2
|
|
add a5, a5, a3
|
|
sw a7, 0(a5)
|
|
sw a4, %lo(cnt)(t0)
|
|
sw a4, 0(a6)
|
|
lui a4, %hi(key)
|
|
addi a4, a4, %lo(key)
|
|
add a4, a4, a3
|
|
sw a0, 0(a4)
|
|
lui a0, %hi(value)
|
|
addi a0, a0, %lo(value)
|
|
add a0, a0, a3
|
|
sw a1, 0(a0)
|
|
lui a0, %hi(nextvalue)
|
|
addi a0, a0, %lo(nextvalue)
|
|
add a0, a0, a3
|
|
sw zero, 0(a0)
|
|
mv a0, a2
|
|
ret
|
|
.LBB1_5:
|
|
lui a3, %hi(cnt)
|
|
lw a4, %lo(cnt)(a3)
|
|
li a2, 0
|
|
addiw a4, a4, 1
|
|
sw a4, %lo(cnt)(a3)
|
|
sw a4, 0(a6)
|
|
lui a3, %hi(key)
|
|
addi a3, a3, %lo(key)
|
|
slli a4, a4, 2
|
|
add a3, a3, a4
|
|
sw a0, 0(a3)
|
|
lui a0, %hi(value)
|
|
addi a0, a0, %lo(value)
|
|
add a0, a0, a4
|
|
sw a1, 0(a0)
|
|
lui a0, %hi(next)
|
|
addi a0, a0, %lo(next)
|
|
add a0, a0, a4
|
|
sw zero, 0(a0)
|
|
lui a0, %hi(nextvalue)
|
|
addi a0, a0, %lo(nextvalue)
|
|
add a0, a0, a4
|
|
sw zero, 0(a0)
|
|
mv a0, a2
|
|
ret
|
|
.LBB1_6:
|
|
lui a0, %hi(cnt)
|
|
lw a2, %lo(cnt)(a0)
|
|
addiw a2, a2, 1
|
|
lui a3, %hi(nextvalue)
|
|
addi a3, a3, %lo(nextvalue)
|
|
add a4, a4, a3
|
|
lw a5, 0(a4)
|
|
sw a2, %lo(cnt)(a0)
|
|
slli a0, a2, 2
|
|
add a3, a3, a0
|
|
sw a5, 0(a3)
|
|
sw a2, 0(a4)
|
|
lui a2, %hi(value)
|
|
addi a2, a2, %lo(value)
|
|
add a0, a0, a2
|
|
sw a1, 0(a0)
|
|
li a0, 1
|
|
ret
|
|
.Lfunc_end1:
|
|
.size insert, .Lfunc_end1-insert
|
|
|
|
.globl reduce
|
|
.p2align 1
|
|
.type reduce,@function
|
|
reduce:
|
|
lui a1, %hi(hashmod)
|
|
lw a1, %lo(hashmod)(a1)
|
|
remw a1, a0, a1
|
|
slli a1, a1, 2
|
|
lui a2, %hi(head)
|
|
addi a2, a2, %lo(head)
|
|
add a1, a1, a2
|
|
lw a1, 0(a1)
|
|
beqz a1, .LBB2_4
|
|
lui a2, %hi(key)
|
|
addi a2, a2, %lo(key)
|
|
lui a3, %hi(next)
|
|
addi a3, a3, %lo(next)
|
|
.LBB2_2:
|
|
slli a4, a1, 2
|
|
add a5, a4, a2
|
|
lw a5, 0(a5)
|
|
beq a5, a0, .LBB2_5
|
|
add a1, a4, a3
|
|
lw a1, 0(a1)
|
|
bnez a1, .LBB2_2
|
|
.LBB2_4:
|
|
li a0, 0
|
|
j .LBB2_7
|
|
.LBB2_5:
|
|
li a0, 0
|
|
lui a2, %hi(value)
|
|
addi a2, a2, %lo(value)
|
|
lui a3, %hi(nextvalue)
|
|
addi a3, a3, %lo(nextvalue)
|
|
.LBB2_6:
|
|
slli a1, a1, 2
|
|
add a4, a1, a2
|
|
lw a4, 0(a4)
|
|
add a1, a1, a3
|
|
lw a1, 0(a1)
|
|
addw a0, a0, a4
|
|
bnez a1, .LBB2_6
|
|
.LBB2_7:
|
|
ret
|
|
.Lfunc_end2:
|
|
.size reduce, .Lfunc_end2-reduce
|
|
|
|
.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)
|
|
call getint
|
|
lui s0, %hi(hashmod)
|
|
sw a0, %lo(hashmod)(s0)
|
|
lui a0, %hi(keys)
|
|
addi s4, a0, %lo(keys)
|
|
mv a0, s4
|
|
call getarray
|
|
mv s3, a0
|
|
lui a0, %hi(values)
|
|
addi s5, a0, %lo(values)
|
|
mv a0, s5
|
|
call getarray
|
|
lui a0, %hi(requests)
|
|
addi a0, a0, %lo(requests)
|
|
call getarray
|
|
mv s2, a0
|
|
li a0, 79
|
|
call _sysy_starttime
|
|
blez s3, .LBB3_9
|
|
li a0, 0
|
|
lui a6, %hi(cnt)
|
|
lw t5, %lo(cnt)(a6)
|
|
lw a7, %lo(hashmod)(s0)
|
|
slli a1, s3, 32
|
|
srli t0, a1, 32
|
|
lui a1, %hi(head)
|
|
addi t1, a1, %lo(head)
|
|
lui a1, %hi(key)
|
|
addi a1, a1, %lo(key)
|
|
lui a3, %hi(value)
|
|
addi t2, a3, %lo(value)
|
|
lui a3, %hi(next)
|
|
addi s0, a3, %lo(next)
|
|
lui a3, %hi(nextvalue)
|
|
addi t3, a3, %lo(nextvalue)
|
|
j .LBB3_4
|
|
.LBB3_2:
|
|
addiw t5, t5, 1
|
|
sw t5, %lo(cnt)(a6)
|
|
sw t5, 0(s1)
|
|
slli a3, t5, 2
|
|
add a4, a3, a1
|
|
sw a5, 0(a4)
|
|
add a4, a3, t2
|
|
sw t4, 0(a4)
|
|
add a4, a3, s0
|
|
sw zero, 0(a4)
|
|
add a3, a3, t3
|
|
sw zero, 0(a3)
|
|
.LBB3_3:
|
|
addi a0, a0, 1
|
|
beq a0, t0, .LBB3_9
|
|
.LBB3_4:
|
|
slli a3, a0, 2
|
|
add a4, a3, s4
|
|
lw a5, 0(a4)
|
|
add a4, a3, s5
|
|
remw a3, a5, a7
|
|
slli a3, a3, 2
|
|
add s1, a3, t1
|
|
lw a3, 0(s1)
|
|
lw t4, 0(a4)
|
|
mv a4, a3
|
|
beqz a3, .LBB3_2
|
|
.LBB3_5:
|
|
slli a4, a4, 2
|
|
add a2, a4, a1
|
|
lw a2, 0(a2)
|
|
beq a2, a5, .LBB3_8
|
|
add a2, a4, s0
|
|
lw a4, 0(a2)
|
|
bnez a4, .LBB3_5
|
|
addiw t5, t5, 1
|
|
sw t5, %lo(cnt)(a6)
|
|
slli a2, t5, 2
|
|
add a4, a2, s0
|
|
sw a3, 0(a4)
|
|
sw t5, 0(s1)
|
|
add a3, a2, a1
|
|
sw a5, 0(a3)
|
|
add a3, a2, t2
|
|
sw t4, 0(a3)
|
|
add a2, a2, t3
|
|
sw zero, 0(a2)
|
|
j .LBB3_3
|
|
.LBB3_8:
|
|
addiw t5, t5, 1
|
|
add a2, a4, t3
|
|
lw a3, 0(a2)
|
|
sw t5, %lo(cnt)(a6)
|
|
slli a4, t5, 2
|
|
add a5, a4, t3
|
|
sw a3, 0(a5)
|
|
sw t5, 0(a2)
|
|
add a2, a4, t2
|
|
sw t4, 0(a2)
|
|
j .LBB3_3
|
|
.LBB3_9:
|
|
blez s2, .LBB3_18
|
|
li t4, 0
|
|
lui a1, %hi(hashmod)
|
|
lw a6, %lo(hashmod)(a1)
|
|
slli a1, s2, 32
|
|
srli a7, a1, 32
|
|
lui a1, %hi(requests)
|
|
addi t0, a1, %lo(requests)
|
|
lui a1, %hi(head)
|
|
addi t1, a1, %lo(head)
|
|
lui a1, %hi(ans)
|
|
addi t2, a1, %lo(ans)
|
|
lui a1, %hi(key)
|
|
addi s1, a1, %lo(key)
|
|
lui a1, %hi(value)
|
|
addi s0, a1, %lo(value)
|
|
lui a1, %hi(nextvalue)
|
|
addi a1, a1, %lo(nextvalue)
|
|
lui a2, %hi(next)
|
|
addi a2, a2, %lo(next)
|
|
j .LBB3_13
|
|
.LBB3_11:
|
|
li a5, 0
|
|
.LBB3_12:
|
|
add a0, t3, t2
|
|
addi t4, t4, 1
|
|
sw a5, 0(a0)
|
|
beq t4, a7, .LBB3_18
|
|
.LBB3_13:
|
|
slli t3, t4, 2
|
|
add a3, t3, t0
|
|
lw a5, 0(a3)
|
|
remw a3, a5, a6
|
|
slli a3, a3, 2
|
|
add a3, a3, t1
|
|
lw a4, 0(a3)
|
|
beqz a4, .LBB3_11
|
|
.LBB3_14:
|
|
slli a3, a4, 2
|
|
add a0, a3, s1
|
|
lw a0, 0(a0)
|
|
beq a0, a5, .LBB3_16
|
|
add a0, a3, a2
|
|
lw a4, 0(a0)
|
|
bnez a4, .LBB3_14
|
|
j .LBB3_11
|
|
.LBB3_16:
|
|
li a5, 0
|
|
.LBB3_17:
|
|
slli a0, a4, 2
|
|
add a3, a0, s0
|
|
lw a3, 0(a3)
|
|
add a0, a0, a1
|
|
lw a4, 0(a0)
|
|
addw a5, a5, a3
|
|
bnez a4, .LBB3_17
|
|
j .LBB3_12
|
|
.LBB3_18:
|
|
li a0, 91
|
|
call _sysy_stoptime
|
|
lui a0, %hi(ans)
|
|
addi a1, a0, %lo(ans)
|
|
mv a0, s2
|
|
call putarray
|
|
li a0, 0
|
|
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_end3:
|
|
.size main, .Lfunc_end3-main
|
|
|
|
.type hashmod,@object
|
|
.section .sbss,"aw",@nobits
|
|
.globl hashmod
|
|
.p2align 2
|
|
hashmod:
|
|
.word 0
|
|
.size hashmod, 4
|
|
|
|
.type head,@object
|
|
.bss
|
|
.globl head
|
|
.p2align 2
|
|
head:
|
|
.zero 40000000
|
|
.size head, 40000000
|
|
|
|
.type cnt,@object
|
|
.section .sbss,"aw",@nobits
|
|
.globl cnt
|
|
.p2align 2
|
|
cnt:
|
|
.word 0
|
|
.size cnt, 4
|
|
|
|
.type key,@object
|
|
.bss
|
|
.globl key
|
|
.p2align 2
|
|
key:
|
|
.zero 40000000
|
|
.size key, 40000000
|
|
|
|
.type value,@object
|
|
.globl value
|
|
.p2align 2
|
|
value:
|
|
.zero 40000000
|
|
.size value, 40000000
|
|
|
|
.type next,@object
|
|
.globl next
|
|
.p2align 2
|
|
next:
|
|
.zero 40000000
|
|
.size next, 40000000
|
|
|
|
.type nextvalue,@object
|
|
.globl nextvalue
|
|
.p2align 2
|
|
nextvalue:
|
|
.zero 40000000
|
|
.size nextvalue, 40000000
|
|
|
|
.type keys,@object
|
|
.globl keys
|
|
.p2align 2
|
|
keys:
|
|
.zero 40000000
|
|
.size keys, 40000000
|
|
|
|
.type values,@object
|
|
.globl values
|
|
.p2align 2
|
|
values:
|
|
.zero 40000000
|
|
.size values, 40000000
|
|
|
|
.type requests,@object
|
|
.globl requests
|
|
.p2align 2
|
|
requests:
|
|
.zero 40000000
|
|
.size requests, 40000000
|
|
|
|
.type ans,@object
|
|
.globl ans
|
|
.p2align 2
|
|
ans:
|
|
.zero 40000000
|
|
.size ans, 40000000
|
|
|
|
.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 bucket,@object
|
|
.bss
|
|
.globl bucket
|
|
.p2align 2
|
|
bucket:
|
|
.zero 40000000
|
|
.size bucket, 40000000
|
|
|
|
.ident "Debian clang version 14.0.6"
|
|
.section ".note.GNU-stack","",@progbits
|
|
.addrsig
|
|
.addrsig_sym keys
|
|
.addrsig_sym values
|
|
.addrsig_sym requests
|
|
.addrsig_sym ans
|