-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstruct_gas_arm.S
107 lines (97 loc) · 2.27 KB
/
struct_gas_arm.S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* ;;; Structured asm macros for gnu assembler */
/*
* This section contains cpu-specific definitions that are dependent on the
* particular format of the conditional and unconditional branch instructions
* for the CPU. Change this part for other architectures!
*/
/* This is support for the
* ------------------------
* | ARM Cortex |
* ------------------------
*/
.macro _st_jmp_always target, dir
b.n \target\dir
.endm
/*
* define all of our conditional branches, "true" logic
* EQual, NotEqual, CarrySet, HigherorSame, CarryClear, LOwer, MInus, PLus,
* HIgher, LowerorSame, GreaterorEqual, LessThan, GreaterThan, LessorEqual,
* Overflow, NoOverflow
*/
.irp cond, eq, ne, cs, hs, cc, lo, mi, pl, hi, ls, ge, lt, gt, le, vs, vc
.macro _st_jmp_\cond target
b\cond\().n \target
.endm
.endr
/*
* Additional positive logic branches
* (Zero, Equal, NotZero)
*/
.macro _st_jmp_z target
beq.n \target
.endm
.macro _st_jmp_e target
beq.n \target
.endm
.macro _st_jmp_nz target
bne.n \target
.endm
/*
* for each possible branch condition "x", create a macro _st_jmp_not_x
* that does a jump for "NOT x".
*/
.macro _st_jmp_not_z target, dir
bne.n \target\dir
.endm
.macro _st_jmp_not_nz target, dir
beq.n \target\dir
.endm
.macro _st_jmp_not_e target, dir
bne.n \target\dir
.endm
.macro _st_jmp_not_eq target, dir
bne.n \target\dir
.endm
.macro _st_jmp_not_ne target, dir
beq.n \target\dir
.endm
.macro _st_jmp_not_cs target, dir
bcc.n \target\dir
.endm
.macro _st_jmp_not_cc target, dir
bcs.n \target\dir
.endm
.macro _st_jmp_not_hs target, dir
blo.n \target\dir
.endm
.macro _st_jmp_not_lo target, dir
bhs.n \target\dir
.endm
.macro _st_jmp_not_mi target, dir
bpl.n \target\dir
.endm
.macro _st_jmp_not_pl target, dir
bmi.n \target\dir
.endm
.macro _st_jmp_not_ge target, dir
blt.n \target\dir
.endm
.macro _st_jmp_not_lt target, dir
bge.n \target\dir
.endm
.macro _st_jmp_not_vs target, dir
bvc.n \target\dir
.endm
.macro _st_jmp_not_vc target, dir
bvs.n \target\dir
.endm
/*
* ;;; allow _if skp after an instruction that might have skipped.
* ;;; this assembles to an unconditional jump
*/
.macro _st_jump_not_skp target, dir
b.n \target\dir
.endm
/*
* This is supposed to be the end of CPU-specific support.
*/