summaryrefslogtreecommitdiff
path: root/gas/testsuite/gas/aarch64/shifted.s
blob: e5063a4c51999c73c474633489706d8681061936 (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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/* shifted.s Test file for AArch64 add-substract (extended reg.) and
   add-substract (shifted reg.) instructions.

   Copyright (C) 2011-2015 Free Software Foundation, Inc.
   Contributed by ARM Ltd.

   This file is part of GAS.

   GAS is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the license, or
   (at your option) any later version.

   GAS is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING3. If not,
   see <http://www.gnu.org/licenses/>.  */

	.macro	op3_64 op, shift
	\op	x1, x2, x3, \shift #0
	\op	x1, x2, x3, \shift #1
	\op	x1, x2, x3, \shift #3
	\op	x1, x2, x3, \shift #7
	\op	x1, x2, x3, \shift #15
	\op	x1, x2, x3, \shift #31
	\op	x1, x2, x3, \shift #63
	.endm	
	
	.macro	op3_32 op, shift
	\op	w1, w2, w3, \shift #0
	\op	w1, w2, w3, \shift #1
	\op	w1, w2, w3, \shift #3
	\op	w1, w2, w3, \shift #7
	\op	w1, w2, w3, \shift #15
	\op	w1, w2, w3, \shift #31
	.endm	

	.macro	op3_64x op, shift
	\op	x1, x2, w3, \shift
	\op	x1, x2, w3, \shift #1
	\op	x1, x2, w3, \shift #2
	\op	x1, x2, w3, \shift #3
	\op	x1, x2, w3, \shift #4
	.endm
	
	.macro	op3_64x_more op, shift
	\op	x1, x2, x3, \shift
	\op	x1, x2, x3, \shift #1
	\op	x1, x2, x3, \shift #2
	\op	x1, x2, x3, \shift #3
	\op	x1, x2, x3, \shift #4
	.endm

	.macro	op3_32x op, shift
	\op	w1, w2, w3, \shift
	\op	w1, w2, w3, \shift #1
	\op	w1, w2, w3, \shift #2
	\op	w1, w2, w3, \shift #3
	\op	w1, w2, w3, \shift #4
	.endm	
	
	.macro	op2_64 op, shift
	\op	x2, x3, \shift #0
	\op	x2, x3, \shift #1
	\op	x2, x3, \shift #3
	\op	x2, x3, \shift #7
	\op	x2, x3, \shift #15
	\op	x2, x3, \shift #31
	\op	x2, x3, \shift #63
	.endm	
	
	.macro	op2_32 op, shift
	\op	w2, w3, \shift #0
	\op	w2, w3, \shift #1
	\op	w2, w3, \shift #3
	\op	w2, w3, \shift #7
	\op	w2, w3, \shift #15
	\op	w2, w3, \shift #31
	.endm	

	.macro	op2_64x op, shift
	\op	x2, w3, \shift
	\op	x2, w3, \shift #1
	\op	x2, w3, \shift #2
	\op	x2, w3, \shift #3
	\op	x2, w3, \shift #4
	.endm	
	
	.macro	op2_32x op, shift
	\op	w2, w3, \shift
	\op	w2, w3, \shift #1
	\op	w2, w3, \shift #2
	\op	w2, w3, \shift #3
	\op	w2, w3, \shift #4
	.endm	
	
	.macro logical op
	op3_64	\op, lsl
	op3_64	\op, lsr
	op3_64	\op, asr
	op3_64	\op, ror
	op3_32	\op, lsl
	op3_32	\op, lsr
	op3_32	\op, asr
	op3_32	\op, ror
	.endm
	
	.macro arith3 op
	op3_64	\op, lsl
	op3_64	\op, lsr
	op3_64	\op, asr
	op3_64x	\op, uxtb
	op3_64x	\op, uxth
	op3_64x	\op, uxtw
	op3_64x_more	\op, uxtx
	op3_64x	\op, sxtb
	op3_64x	\op, sxth
	op3_64x	\op, sxtw
	op3_64x_more	\op, sxtx
	op3_32	\op, lsl
	op3_32	\op, lsr
	op3_32	\op, asr
	op3_32x	\op, uxtb
	op3_32x	\op, uxth
	op3_32x	\op, sxtb
	op3_32x	\op, sxth
	.endm
	
	.macro arith2 op, if_ext=1
	op2_64	\op, lsl
	op2_64	\op, lsr
	op2_64	\op, asr
	.if \if_ext
	op2_64x	\op, uxtb
	op2_64x	\op, uxth
	op2_64x	\op, uxtw
	op2_64x	\op, sxtb
	op2_64x	\op, sxth
	op2_64x	\op, sxtw
	.endif
	op2_32	\op, lsl
	op2_32	\op, lsr
	op2_32	\op, asr
	.if \if_ext
	op2_32x	\op, uxtb
	op2_32x	\op, uxth
	op2_32x	\op, sxtb
	op2_32x	\op, sxth
	.endif
	.endm
	
func:	
	logical	orr
	logical	and
	logical	eor
	
	logical	bic
	logical	orn
	logical	eon
	
	arith3	add	
	arith3	sub
	
	arith2	neg, 0
	arith2	cmp
	arith2	cmn