forked from NUDT-compiler/nudt-compiler-cpp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
617 B
42 lines
617 B
.data
|
|
.globl arr
|
|
.p2align 2
|
|
arr:
|
|
.word 1
|
|
.word 2
|
|
.word 33
|
|
.word 4
|
|
.word 5
|
|
.word 6
|
|
|
|
.text
|
|
.globl main
|
|
.p2align 2
|
|
main:
|
|
.L.main.0:
|
|
stp x29, x30, [sp, #-16]!
|
|
mov x29, sp
|
|
mov w9, #0
|
|
mov w8, w9
|
|
b .L.main.1
|
|
.L.main.1:
|
|
mov w10, #6
|
|
cmp w9, w10
|
|
b.lt .L.main.2
|
|
b .L.main.3
|
|
.L.main.2:
|
|
adrp x10, arr
|
|
add x10, x10, :lo12:arr
|
|
sxtw x11, w9
|
|
lsl x11, x11, #2
|
|
add x10, x10, x11
|
|
ldr w10, [x10]
|
|
add w8, w8, w10
|
|
mov w10, #1
|
|
add w9, w9, w10
|
|
b .L.main.1
|
|
.L.main.3:
|
|
mov w0, w8
|
|
ldp x29, x30, [sp], #16
|
|
ret
|