File: bundle-lock.s

package info (click to toggle)
binutils 2.31.1-11
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 307,644 kB
  • sloc: ansic: 1,161,122; asm: 638,494; cpp: 128,815; exp: 68,557; makefile: 55,816; sh: 22,360; yacc: 14,238; lisp: 13,272; perl: 2,111; ada: 1,681; lex: 1,652; pascal: 1,446; cs: 879; sed: 195; python: 154; xml: 95; awk: 25
file content (64 lines) | stat: -rw-r--r-- 1,225 bytes parent folder | download | duplicates (29)
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
	.syntax unified
	.bundle_align_mode 4

# We use these macros to test each pattern at every offset from
# bundle alignment, i.e. [0,16) by 2 or 4.

	size_arm = 4
	size_thumb = 2

.macro offset_sequence which, size, offset
	.p2align 4
\which\()_sequence_\size\()_offset_\offset\():
	.rept \offset / size_\which
	bkpt
	.endr
	test_sequence \size
.endm

.macro test_offsets_arm size
	.arm
	offset_sequence arm, \size, 0
	offset_sequence arm, \size, 4
	offset_sequence arm, \size, 8
	offset_sequence arm, \size, 12
.endm

.macro test_offsets_thumb size
	.thumb
	offset_sequence thumb, \size, 0
	offset_sequence thumb, \size, 2
	offset_sequence thumb, \size, 4
	offset_sequence thumb, \size, 6
	offset_sequence thumb, \size, 8
	offset_sequence thumb, \size, 10
	offset_sequence thumb, \size, 12
	offset_sequence thumb, \size, 14
.endm

.macro test_sequence size
	.bundle_lock
	adds r0, r1
	.rept \size - 1
	subs r0, r1
	.endr
	.bundle_unlock
.endm

	test_offsets_arm 1
	test_offsets_arm 2
	test_offsets_arm 3
	test_offsets_arm 4

	test_offsets_thumb 1
	test_offsets_thumb 2
	test_offsets_thumb 3
	test_offsets_thumb 4
	test_offsets_thumb 5
	test_offsets_thumb 6
	test_offsets_thumb 7
	test_offsets_thumb 8

	.arm
.p2align 4
	bkpt