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
108
109
110
|
.syntax unified
.arch armv7
.thumb
main:
@These branches are to see the labels in the generated file
bl .L888
bl .L111
bl .L777
@No IT block here:
bne .L4
@The following groups should be an IT block each.
@it ne
addne.n pc, r0
@it ne
tbbne [r0, r1]
@it eq
tbheq [r1, r0]
@The following group should be left as is:
itet eq
.L111: moveq r0, #2
movne r0, #3
moveq r0, #4
@Same, reverted condition:
itet ne
movne r0, #2
moveq r0, #3
movne r0, #4
@Two groups shall be generated, due to the label:
movne r0, #1
@ second group, the label should be at the IT insn
.L777: moveq r0, #2
ldrne pc, [r1]
@it ne
blne .L4
@it lt
bllt .L9
@itett ne
.L888: movne r0, #45
moveq r0, #5
movne r0, #6
addne.n pc, r0
@iteet eq
moveq r0, #7
movne r0, #8
movne r0, #3
moveq r0, #4
@itete eq
moveq r0, #5
movne r0, #6
moveq r0, #7
movne r0, #8
@ite eq - this group finishes due to the mov.n pc, rn
moveq r0, #5
movne r0, #6
mov.n pc, r0
@itete eq
moveq r0, #7
movne r0, #8
moveq r0, #5
movne r0, #6
@this shall not generate an IT block
add.n pc, r0
@ite eq - testing condition change (eq -> gt)
moveq r0, #7
movne r0, #8
@ite gt (group shall finish due to another condition change)
movgt r0, #9
movle r0, #10
@it eq
moveq r0, #11
@it le
movle r0, #12
@it ne
movne r0, #13
bl f
.L4:
pop {r4, pc}
.L9:
bl f
@Only the movlt shall be enclosed in the IT block
movlt r0, #0
muls r0, r0, r1
@Same here:
movlt r0, #0
muls r0, r0, r1
|