Add an AArch64 simulator to GDB.
[deliverable/binutils-gdb.git] / sim / testsuite / sim / aarch64 / testutils.inc
1 # MACRO: exit
2 # Terminates execution.
3 .macro exit nr
4
5 stp x29, x30, [sp,#-32]!
6 mov x4, #0x26
7 mov x7, #\nr
8 mov x29, sp
9 movk x4, #0x2, lsl #16
10 add x1, x29, #0x10
11 str x4, [x29,#16]
12 str x7, [x29,#24]
13 mov w0, #0x18
14 hlt #0xf000
15
16 .endm
17
18 # MACRO: swiwrite
19 # Writes the string in X1 to stdout
20 .macro swiwrite len
21
22 stp x29, x30, [sp,#-48]!
23 mov x0, #1
24 mov x2, #\len
25 mov x29, sp
26 str x0, [x29,#24]
27 str x1, [x29,#32]
28 str x2, [x29,#40]
29 mov w0, #0x5
30 add x1, x29, #0x18
31 hlt #0xf000
32 ldp x29, x30, [sp],#48
33 ret
34
35 .endm
36
37 # MACRO: pass
38 # Write 'pass' to stdout and quit
39 .macro pass
40
41 adrp x1, .Lpass
42 add x1, x1, :lo12:.Lpass
43
44 swiwrite 5
45 exit 0
46
47 .data
48 .Lpass:
49 .asciz "pass\n"
50 .endm
51
52 # MACRO: fail
53 # Write 'fail' to stdout and quit
54 .macro fail
55
56 adrp x1, .Lfail
57 add x1, x1, :lo12:.Lfail
58 swiwrite 5
59 exit 0
60
61 .data
62 .Lfail:
63 .asciz "fail\n"
64 .endm
65
66 # MACRO: start
67 # All assembler tests should start with a call to "start"
68 .macro start
69 .text
70 .global _start
71 _start:
72 .endm
This page took 0.033179 seconds and 4 git commands to generate.