summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/gas/testsuite/gas/epiphany/sample.s
blob: 91f394060dc2f2e6331d10ad39903bce19719a27 (plain)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
 .data
foodata: .hword 42
 .text
footext:
	.text

	.macro test nm:req, args:vararg
\nm:	\nm \args
	.global \nm
	.endm

;;; Basic Instruction Tests
1:				; All branches
        test beq,1b
        test bne,1b
        test bgtu,1b
	test bgteu,1b
	test blteu,1b
        test bltu,1b
	test bgt,1b
	test bgte,1b
	test blt,1b
	test blte,1b

	test bbeq,1b
	test bbne,1b
	test bblt,1b
	test b,1b
	test bl,1b

;;; jumps
	test jr,r1
	jr	r31

	test jalr,r1
	jalr r31


	.macro test3i nm:req
	test \nm,r1,r2,r3
	\nm	r32,r33,r34
	\nm	r1,r2,#3
	\nm	r11,r2,#16
	.endm
	test3i add
	test3i sub
	test3i asr
	test3i lsr
	test3i lsl

	.macro test3 nm:req
	test \nm,r1,r2,r3
	\nm	r11,r12,r13
	.endm

	test3 orr
	test3 and
	test3 eor

	.macro testmem  nm:req
        \nm	r0,[r1,#3]
	\nm	r10,[r1,#255]
	\nm	r0,[r1,r2]
	\nm	r0,[r1,r11]
	\nm	r0,[r3],r2
	\nm	r10,[r12],r13
	.endm

	testmem ldrb
	testmem ldrh
	testmem ldr
	testmem	ldrd


	testmem strb
	testmem strh
	testmem str
	testmem	strd

	test mov,r6,#255
	mov	r31,#65535
	mov	r0,#4098

	.macro testmov cond:req
	mov\cond r1,r2
	mov\cond r11,r12
	.endm

	testmov eq
	testmov	ne
	testmov	gtu
	testmov gteu
	testmov lteu
	testmov ltu
	testmov	gt
	testmov gte
	testmov	lt
	testmov	lte
	testmov beq
	testmov bne
	testmov blt
	testmov blte
	mov	r1,r2
	mov	r11,r12

	test	nop
	test	idle
	test	bkpt

	test3	fadd
	test3	fsub
	test3	fmul
	test3	fmadd
	test3	fmsub

	movts	config,r1
	movts	status,r31

	movfs	r1,imask
	movfs	r31,pc

	test trap,#0		; write syscall for simulator.
        rti     		; dummy instruction