353 lines
5.2 KiB
ArmAsm
353 lines
5.2 KiB
ArmAsm
.text
|
|
.attribute 4, 16
|
|
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
|
|
.file "78_side_effect.sy"
|
|
.globl inc_a
|
|
.p2align 1
|
|
.type inc_a,@function
|
|
inc_a:
|
|
lui a1, %hi(a)
|
|
lw a0, %lo(a)(a1)
|
|
addiw a0, a0, 1
|
|
sw a0, %lo(a)(a1)
|
|
ret
|
|
.Lfunc_end0:
|
|
.size inc_a, .Lfunc_end0-inc_a
|
|
|
|
.globl main
|
|
.p2align 1
|
|
.type main,@function
|
|
main:
|
|
addi sp, sp, -16
|
|
sd ra, 8(sp)
|
|
sd s0, 0(sp)
|
|
lui a1, %hi(a)
|
|
lw a0, %lo(a)(a1)
|
|
li a2, -3
|
|
bltu a2, a0, .LBB1_4
|
|
addiw a0, a0, 3
|
|
sw a0, %lo(a)(a1)
|
|
beqz a0, .LBB1_4
|
|
call putint
|
|
li a0, 32
|
|
call putch
|
|
lui a0, %hi(b)
|
|
lw a0, %lo(b)(a0)
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lui a2, %hi(a)
|
|
lw a1, %lo(a)(a2)
|
|
addiw a0, a1, 1
|
|
li a3, 12
|
|
sw a0, %lo(a)(a2)
|
|
bge a3, a1, .LBB1_5
|
|
addiw a0, a1, 5
|
|
li a1, -3
|
|
bgeu a1, a0, .LBB1_6
|
|
j .LBB1_9
|
|
.LBB1_4:
|
|
li a0, 1
|
|
sw a0, %lo(a)(a1)
|
|
.LBB1_5:
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lui a1, %hi(b)
|
|
lw a2, %lo(b)(a1)
|
|
lui a0, %hi(a)
|
|
lw a0, %lo(a)(a0)
|
|
slliw a2, a2, 1
|
|
sw a2, %lo(b)(a1)
|
|
li a1, -3
|
|
bltu a1, a0, .LBB1_9
|
|
.LBB1_6:
|
|
addiw a0, a0, 3
|
|
lui s0, %hi(a)
|
|
sw a0, %lo(a)(s0)
|
|
beqz a0, .LBB1_9
|
|
call putint
|
|
li a0, 32
|
|
call putch
|
|
lui a0, %hi(b)
|
|
lw a0, %lo(b)(a0)
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lw a1, %lo(a)(s0)
|
|
addiw a0, a1, 1
|
|
li a2, 13
|
|
sw a0, %lo(a)(s0)
|
|
blt a1, a2, .LBB1_10
|
|
addiw a0, a1, 5
|
|
li a1, -3
|
|
bgeu a1, a0, .LBB1_11
|
|
j .LBB1_14
|
|
.LBB1_9:
|
|
lui a1, %hi(a)
|
|
li a0, 1
|
|
sw a0, %lo(a)(a1)
|
|
.LBB1_10:
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lui a1, %hi(b)
|
|
lw a2, %lo(b)(a1)
|
|
lui a0, %hi(a)
|
|
lw a0, %lo(a)(a0)
|
|
slliw a2, a2, 1
|
|
sw a2, %lo(b)(a1)
|
|
li a1, -3
|
|
bltu a1, a0, .LBB1_14
|
|
.LBB1_11:
|
|
addiw a0, a0, 3
|
|
lui s0, %hi(a)
|
|
sw a0, %lo(a)(s0)
|
|
beqz a0, .LBB1_14
|
|
call putint
|
|
li a0, 32
|
|
call putch
|
|
lui a0, %hi(b)
|
|
lw a0, %lo(b)(a0)
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lw a1, %lo(a)(s0)
|
|
addiw a0, a1, 1
|
|
li a2, 13
|
|
sw a0, %lo(a)(s0)
|
|
blt a1, a2, .LBB1_15
|
|
addiw a0, a1, 5
|
|
li a1, -3
|
|
bgeu a1, a0, .LBB1_16
|
|
j .LBB1_19
|
|
.LBB1_14:
|
|
lui a1, %hi(a)
|
|
li a0, 1
|
|
sw a0, %lo(a)(a1)
|
|
.LBB1_15:
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lui a1, %hi(b)
|
|
lw a2, %lo(b)(a1)
|
|
lui a0, %hi(a)
|
|
lw a0, %lo(a)(a0)
|
|
slliw a2, a2, 1
|
|
sw a2, %lo(b)(a1)
|
|
li a1, -3
|
|
bltu a1, a0, .LBB1_19
|
|
.LBB1_16:
|
|
addiw a0, a0, 3
|
|
lui s0, %hi(a)
|
|
sw a0, %lo(a)(s0)
|
|
beqz a0, .LBB1_19
|
|
call putint
|
|
li a0, 32
|
|
call putch
|
|
lui a0, %hi(b)
|
|
lw a0, %lo(b)(a0)
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lw a1, %lo(a)(s0)
|
|
addiw a0, a1, 1
|
|
li a2, 13
|
|
sw a0, %lo(a)(s0)
|
|
blt a1, a2, .LBB1_20
|
|
addiw a0, a1, 5
|
|
li a1, -3
|
|
bgeu a1, a0, .LBB1_21
|
|
j .LBB1_24
|
|
.LBB1_19:
|
|
lui a1, %hi(a)
|
|
li a0, 1
|
|
sw a0, %lo(a)(a1)
|
|
.LBB1_20:
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lui a1, %hi(b)
|
|
lw a2, %lo(b)(a1)
|
|
lui a0, %hi(a)
|
|
lw a0, %lo(a)(a0)
|
|
slliw a2, a2, 1
|
|
sw a2, %lo(b)(a1)
|
|
li a1, -3
|
|
bltu a1, a0, .LBB1_24
|
|
.LBB1_21:
|
|
addiw a0, a0, 3
|
|
lui s0, %hi(a)
|
|
sw a0, %lo(a)(s0)
|
|
beqz a0, .LBB1_24
|
|
call putint
|
|
li a0, 32
|
|
call putch
|
|
lui a0, %hi(b)
|
|
lw a0, %lo(b)(a0)
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lw a1, %lo(a)(s0)
|
|
addiw a0, a1, 1
|
|
li a2, 13
|
|
sw a0, %lo(a)(s0)
|
|
blt a1, a2, .LBB1_25
|
|
addiw a0, a1, 5
|
|
li a1, -3
|
|
bgeu a1, a0, .LBB1_26
|
|
j .LBB1_29
|
|
.LBB1_24:
|
|
lui a1, %hi(a)
|
|
li a0, 1
|
|
sw a0, %lo(a)(a1)
|
|
.LBB1_25:
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lui a1, %hi(b)
|
|
lw a2, %lo(b)(a1)
|
|
lui a0, %hi(a)
|
|
lw a0, %lo(a)(a0)
|
|
slliw a2, a2, 1
|
|
sw a2, %lo(b)(a1)
|
|
li a1, -3
|
|
bltu a1, a0, .LBB1_29
|
|
.LBB1_26:
|
|
addiw a0, a0, 3
|
|
lui s0, %hi(a)
|
|
sw a0, %lo(a)(s0)
|
|
beqz a0, .LBB1_29
|
|
call putint
|
|
li a0, 32
|
|
call putch
|
|
lui a0, %hi(b)
|
|
lw a0, %lo(b)(a0)
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lw a1, %lo(a)(s0)
|
|
addiw a0, a1, 1
|
|
li a2, 13
|
|
sw a0, %lo(a)(s0)
|
|
blt a1, a2, .LBB1_30
|
|
addiw a0, a1, 5
|
|
lui a1, %hi(a)
|
|
sw a0, %lo(a)(a1)
|
|
j .LBB1_31
|
|
.LBB1_29:
|
|
lui a1, %hi(a)
|
|
li a0, 1
|
|
sw a0, %lo(a)(a1)
|
|
.LBB1_30:
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lui a1, %hi(b)
|
|
lw a2, %lo(b)(a1)
|
|
lui a0, %hi(a)
|
|
lw a0, %lo(a)(a0)
|
|
slliw a2, a2, 1
|
|
sw a2, %lo(b)(a1)
|
|
.LBB1_31:
|
|
call putint
|
|
li a0, 32
|
|
call putch
|
|
lui a0, %hi(b)
|
|
lw a0, %lo(b)(a0)
|
|
call putint
|
|
li a0, 10
|
|
call putch
|
|
lui a0, %hi(a)
|
|
lw a0, %lo(a)(a0)
|
|
ld ra, 8(sp)
|
|
ld s0, 0(sp)
|
|
addi sp, sp, 16
|
|
ret
|
|
.Lfunc_end1:
|
|
.size main, .Lfunc_end1-main
|
|
|
|
.type a,@object
|
|
.section .sdata,"aw",@progbits
|
|
.globl a
|
|
.p2align 2
|
|
a:
|
|
.word 4294967295
|
|
.size a, 4
|
|
|
|
.type b,@object
|
|
.globl b
|
|
.p2align 2
|
|
b:
|
|
.word 1
|
|
.size b, 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
|