sysy-data/functional_c/asm/28_while_test3.s

542 lines
7.6 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 "28_while_test3.sy"
.globl EightWhile
.p2align 1
.type EightWhile,@function
EightWhile:
addi sp, sp, -64
sd s0, 56(sp)
sd s1, 48(sp)
sd s2, 40(sp)
sd s3, 32(sp)
sd s4, 24(sp)
sd s5, 16(sp)
sd s6, 8(sp)
lui a6, %hi(e)
lw t5, %lo(e)(a6)
lui a7, %hi(f)
lw s5, %lo(f)(a7)
lui t0, %hi(g)
lw a2, %lo(g)(t0)
lui t4, %hi(h)
lw a0, %lo(h)(t4)
li a1, 6
li t2, 10
li t1, 19
li s1, 2
li t3, 3
li a4, 9
li s0, -7
li t6, 4
li s3, 17
li a5, 2
j .LBB0_3
.LBB0_1:
addi a1, a6, %lo(e)
sw t5, 0(a1)
.LBB0_2:
addiw a1, s2, 1
addiw t2, t2, -1
bgeu s2, a4, .LBB0_20
.LBB0_3:
mv s2, a1
bge t1, t2, .LBB0_6
j .LBB0_2
.LBB0_4:
addiw t5, t2, -1
sw s5, %lo(f)(a7)
.LBB0_5:
addiw t2, s4, 3
addiw t5, t5, 1
bge s4, s3, .LBB0_1
.LBB0_6:
mv s4, t2
blt t5, s1, .LBB0_5
li a1, 2
mv t2, t5
blt t5, a1, .LBB0_11
li t2, 2
j .LBB0_11
.LBB0_9:
addi a1, t0, %lo(g)
sw a2, 0(a1)
.LBB0_10:
addiw t5, s6, -1
addiw s5, s5, 1
bge s1, s6, .LBB0_4
.LBB0_11:
mv s6, t5
bge s5, t3, .LBB0_14
j .LBB0_10
.LBB0_12:
addi a1, t4, %lo(h)
sw a0, 0(a1)
.LBB0_13:
addiw s5, a3, -2
addiw a2, a2, -8
bge t6, a3, .LBB0_9
.LBB0_14:
mv a3, s5
bge s1, a2, .LBB0_17
j .LBB0_13
.LBB0_15:
sub a2, a2, a0
addi a2, a2, 7
andi a2, a2, -8
addw a0, a0, a2
addiw a0, a0, 8
.LBB0_16:
addiw a2, a1, 10
addiw a0, a0, -1
bge a1, s0, .LBB0_12
.LBB0_17:
mv a1, a2
blt a4, a0, .LBB0_16
mv a2, a0
blt a5, a0, .LBB0_15
li a2, 2
j .LBB0_15
.LBB0_20:
li a4, 8
li a6, 19
li a3, 2
li a7, 3
li a1, 9
li s0, -7
lui t0, %hi(h)
li t1, 4
lui s3, %hi(g)
lui t3, %hi(f)
li t4, 17
lui t6, %hi(e)
li a5, 2
j .LBB0_23
.LBB0_21:
sw t5, %lo(e)(t6)
.LBB0_22:
addiw a4, s2, 1
addiw t2, t2, -1
bgeu s2, a1, .LBB0_40
.LBB0_23:
mv s2, a4
bge a6, t2, .LBB0_26
j .LBB0_22
.LBB0_24:
addiw t5, t2, -1
sw s5, %lo(f)(t3)
.LBB0_25:
addiw t2, s4, 3
addiw t5, t5, 1
bge s4, t4, .LBB0_21
.LBB0_26:
mv s4, t2
blt t5, a3, .LBB0_25
li a4, 2
mv t2, t5
blt t5, a4, .LBB0_31
li t2, 2
j .LBB0_31
.LBB0_29:
sw a2, %lo(g)(s3)
.LBB0_30:
addiw t5, s6, -1
addiw s5, s5, 1
bge a3, s6, .LBB0_24
.LBB0_31:
mv s6, t5
bge s5, a7, .LBB0_34
j .LBB0_30
.LBB0_32:
sw a0, %lo(h)(t0)
.LBB0_33:
addiw s5, s1, -2
addiw a2, a2, -8
bge t1, s1, .LBB0_29
.LBB0_34:
mv s1, s5
bge a3, a2, .LBB0_37
j .LBB0_33
.LBB0_35:
sub a2, a2, a0
addi a2, a2, 7
andi a2, a2, -8
addw a0, a0, a2
addiw a0, a0, 8
.LBB0_36:
addiw a2, a4, 10
addiw a0, a0, -1
bge a4, s0, .LBB0_32
.LBB0_37:
mv a4, a2
blt a1, a0, .LBB0_36
mv a2, a0
blt a5, a0, .LBB0_35
li a2, 2
j .LBB0_35
.LBB0_40:
li a3, 8
li a6, 19
li a4, 2
li a7, 3
li a1, 9
li s0, -7
lui t0, %hi(h)
li t1, 4
lui s3, %hi(g)
lui t3, %hi(f)
li t4, 17
lui t6, %hi(e)
j .LBB0_43
.LBB0_41:
sw t5, %lo(e)(t6)
.LBB0_42:
addiw a3, s2, 1
addiw t2, t2, -1
bgeu s2, a1, .LBB0_60
.LBB0_43:
mv s2, a3
bge a6, t2, .LBB0_46
j .LBB0_42
.LBB0_44:
addiw t5, t2, -1
sw s5, %lo(f)(t3)
.LBB0_45:
addiw t2, s4, 3
addiw t5, t5, 1
bge s4, t4, .LBB0_41
.LBB0_46:
mv s4, t2
blt t5, a4, .LBB0_45
li a3, 2
mv t2, t5
blt t5, a3, .LBB0_51
li t2, 2
j .LBB0_51
.LBB0_49:
sw a2, %lo(g)(s3)
.LBB0_50:
addiw t5, s6, -1
addiw s5, s5, 1
bge a4, s6, .LBB0_44
.LBB0_51:
mv s6, t5
bge s5, a7, .LBB0_54
j .LBB0_50
.LBB0_52:
sw a0, %lo(h)(t0)
.LBB0_53:
addiw s5, s1, -2
addiw a2, a2, -8
bge t1, s1, .LBB0_49
.LBB0_54:
mv s1, s5
bge a4, a2, .LBB0_57
j .LBB0_53
.LBB0_55:
sub a2, a2, a0
addi a2, a2, 7
andi a2, a2, -8
addw a0, a0, a2
addiw a0, a0, 8
.LBB0_56:
addiw a2, a5, 10
addiw a0, a0, -1
bge a5, s0, .LBB0_52
.LBB0_57:
mv a5, a2
blt a1, a0, .LBB0_56
li a3, 2
mv a2, a0
blt a3, a0, .LBB0_55
li a2, 2
j .LBB0_55
.LBB0_60:
li a5, 8
li a6, 19
li a4, 2
li a7, 3
li a1, 9
li a3, -7
lui t0, %hi(h)
li t1, 4
lui s3, %hi(g)
lui t3, %hi(f)
li t4, 17
lui t6, %hi(e)
j .LBB0_63
.LBB0_61:
sw t5, %lo(e)(t6)
.LBB0_62:
addiw a5, s2, 1
addiw t2, t2, -1
bgeu s2, a1, .LBB0_80
.LBB0_63:
mv s2, a5
bge a6, t2, .LBB0_66
j .LBB0_62
.LBB0_64:
addiw t5, t2, -1
sw s5, %lo(f)(t3)
.LBB0_65:
addiw t2, s4, 3
addiw t5, t5, 1
bge s4, t4, .LBB0_61
.LBB0_66:
mv s4, t2
blt t5, a4, .LBB0_65
li a5, 2
mv t2, t5
blt t5, a5, .LBB0_71
li t2, 2
j .LBB0_71
.LBB0_69:
sw a2, %lo(g)(s3)
.LBB0_70:
addiw t5, s6, -1
addiw s5, s5, 1
bge a4, s6, .LBB0_64
.LBB0_71:
mv s6, t5
bge s5, a7, .LBB0_74
j .LBB0_70
.LBB0_72:
sw a0, %lo(h)(t0)
.LBB0_73:
addiw s5, s1, -2
addiw a2, a2, -8
bge t1, s1, .LBB0_69
.LBB0_74:
mv s1, s5
bge a4, a2, .LBB0_77
j .LBB0_73
.LBB0_75:
sub a2, a2, a0
addi a2, a2, 7
andi a2, a2, -8
addw a0, a0, a2
addiw a0, a0, 8
.LBB0_76:
addiw a2, s0, 10
addiw a0, a0, -1
bge s0, a3, .LBB0_72
.LBB0_77:
mv s0, a2
blt a1, a0, .LBB0_76
li a5, 2
mv a2, a0
blt a5, a0, .LBB0_75
li a2, 2
j .LBB0_75
.LBB0_80:
li a3, 8
li a6, 19
li a1, 2
li a7, 3
li a5, 9
li s0, -7
lui t0, %hi(h)
li s6, 4
lui t1, %hi(g)
lui t3, %hi(f)
li t4, 17
lui t6, %hi(e)
li a4, 2
j .LBB0_83
.LBB0_81:
sw t5, %lo(e)(t6)
.LBB0_82:
addiw a3, s2, 1
addiw t2, t2, -1
bgeu s2, a5, .LBB0_100
.LBB0_83:
mv s2, a3
bge a6, t2, .LBB0_86
j .LBB0_82
.LBB0_84:
addiw t5, t2, -1
sw s5, %lo(f)(t3)
.LBB0_85:
addiw t2, s3, 3
addiw t5, t5, 1
bge s3, t4, .LBB0_81
.LBB0_86:
mv s3, t2
blt t5, a1, .LBB0_85
li a3, 2
mv t2, t5
blt t5, a3, .LBB0_91
li t2, 2
j .LBB0_91
.LBB0_89:
sw a2, %lo(g)(t1)
.LBB0_90:
addiw t5, s4, -1
addiw s5, s5, 1
bge a1, s4, .LBB0_84
.LBB0_91:
mv s4, t5
bge s5, a7, .LBB0_94
j .LBB0_90
.LBB0_92:
sw a0, %lo(h)(t0)
.LBB0_93:
addiw s5, s1, -2
addiw a2, a2, -8
bge s6, s1, .LBB0_89
.LBB0_94:
mv s1, s5
bge a1, a2, .LBB0_97
j .LBB0_93
.LBB0_95:
sub a2, a2, a0
addi a2, a2, 7
andi a2, a2, -8
addw a0, a0, a2
addiw a0, a0, 8
.LBB0_96:
addiw a2, a3, 10
addiw a0, a0, -1
bge a3, s0, .LBB0_92
.LBB0_97:
mv a3, a2
blt a5, a0, .LBB0_96
mv a2, a0
blt a4, a0, .LBB0_95
li a2, 2
j .LBB0_95
.LBB0_100:
addw a0, t5, a0
subw a0, a2, a0
addiw a0, a0, 35
ld s0, 56(sp)
ld s1, 48(sp)
ld s2, 40(sp)
ld s3, 32(sp)
ld s4, 24(sp)
ld s5, 16(sp)
ld s6, 8(sp)
addi sp, sp, 64
ret
.Lfunc_end0:
.size EightWhile, .Lfunc_end0-EightWhile
.globl main
.p2align 1
.type main,@function
main:
lui a0, %hi(h)
li a1, 13
sw a1, %lo(h)(a0)
lui a0, %hi(g)
li a1, 3
sw a1, %lo(g)(a0)
lui a0, %hi(f)
sw a1, %lo(f)(a0)
lui a1, %hi(e)
li a2, 2
li a0, 23
sw a2, %lo(e)(a1)
ret
.Lfunc_end1:
.size main, .Lfunc_end1-main
.type e,@object
.section .sbss,"aw",@nobits
.globl e
.p2align 2
e:
.word 0
.size e, 4
.type f,@object
.globl f
.p2align 2
f:
.word 0
.size f, 4
.type g,@object
.globl g
.p2align 2
g:
.word 0
.size g, 4
.type h,@object
.globl h
.p2align 2
h:
.word 0
.size h, 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