[ARM] Add ARMv8.2 FP16 vmul/vmla/vmls (by scalar)
[deliverable/binutils-gdb.git] / include / opcode / arc-func.h
CommitLineData
886a2506 1/* Replace functions for the ARC relocs.
6f2750fe 2 Copyright (C) 2015-2016 Free Software Foundation, Inc.
886a2506
NC
3
4 This file is part of GAS, the GNU Assembler, GDB, the GNU debugger, and
5 the GNU Binutils.
6
7 GAS/GDB is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 GAS/GDB is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GAS or GDB; see the file COPYING3. If not, write to
19 the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
21
22/* mask = 00000000000000000000000000000000. */
23#ifndef REPLACE_none
24#define REPLACE_none
25ATTRIBUTE_UNUSED static unsigned
26replace_none (unsigned insn, int value ATTRIBUTE_UNUSED)
27{
34e967a5 28 insn = insn & ~0x00;
886a2506
NC
29
30 return insn;
31}
32
33#endif /* REPLACE_none */
34
35/* mask = 11111111. */
36#ifndef REPLACE_bits8
37#define REPLACE_bits8
38ATTRIBUTE_UNUSED static unsigned
39replace_bits8 (unsigned insn, int value ATTRIBUTE_UNUSED)
40{
34e967a5 41 insn = insn & ~0xff;
886a2506
NC
42 insn |= ((value >> 0) & 0x00ff) << 0;
43
44 return insn;
45}
46
47#endif /* REPLACE_bits8 */
48
49/* mask = 1111111111111111. */
50#ifndef REPLACE_bits16
51#define REPLACE_bits16
52ATTRIBUTE_UNUSED static unsigned
53replace_bits16 (unsigned insn, int value ATTRIBUTE_UNUSED)
54{
34e967a5 55 insn = insn & ~0xffff;
886a2506
NC
56 insn |= ((value >> 0) & 0xffff) << 0;
57
58 return insn;
59}
60
61#endif /* REPLACE_bits16 */
62
63/* mask = 111111111111111111111111. */
64#ifndef REPLACE_bits24
65#define REPLACE_bits24
66ATTRIBUTE_UNUSED static unsigned
67replace_bits24 (unsigned insn, int value ATTRIBUTE_UNUSED)
68{
72f3b6aa
CZ
69 insn = insn & ~0xffffff00;
70 insn |= ((value >> 0) & 0xffffff) << 8;
886a2506
NC
71
72 return insn;
73}
74
75#endif /* REPLACE_bits24 */
76
77/* mask = 11111111111111111111111111111111. */
78#ifndef REPLACE_word32
79#define REPLACE_word32
80ATTRIBUTE_UNUSED static unsigned
81replace_word32 (unsigned insn, int value ATTRIBUTE_UNUSED)
82{
34e967a5 83 insn = insn & ~0xffffffff;
886a2506
NC
84 insn |= ((value >> 0) & 0xffffffff) << 0;
85
86 return insn;
87}
88
89#endif /* REPLACE_word32 */
90
91/* mask = 0000000000000000000000000000000011111111111111111111111111111111. */
92#ifndef REPLACE_limm
93#define REPLACE_limm
94ATTRIBUTE_UNUSED static unsigned
95replace_limm (unsigned insn, int value ATTRIBUTE_UNUSED)
96{
34e967a5 97 insn = insn & ~0xffffffff;
886a2506
NC
98 insn |= ((value >> 0) & 0xffffffff) << 0;
99
100 return insn;
101}
102
103#endif /* REPLACE_limm */
104
105/* mask = 000000000000000011111111111111111111111111111111. */
106#ifndef REPLACE_limms
107#define REPLACE_limms
108ATTRIBUTE_UNUSED static unsigned
109replace_limms (unsigned insn, int value ATTRIBUTE_UNUSED)
110{
34e967a5 111 insn = insn & ~0xffffffff;
886a2506
NC
112 insn |= ((value >> 0) & 0xffffffff) << 0;
113
114 return insn;
115}
116
117#endif /* REPLACE_limms */
118
119/* mask = 00000111111111102222222222000000. */
120#ifndef REPLACE_disp21h
121#define REPLACE_disp21h
122ATTRIBUTE_UNUSED static unsigned
123replace_disp21h (unsigned insn, int value ATTRIBUTE_UNUSED)
124{
34e967a5 125 insn = insn & ~0x7feffc0;
886a2506
NC
126 insn |= ((value >> 0) & 0x03ff) << 17;
127 insn |= ((value >> 10) & 0x03ff) << 6;
128
129 return insn;
130}
131
132#endif /* REPLACE_disp21h */
133
134/* mask = 00000111111111002222222222000000. */
135#ifndef REPLACE_disp21w
136#define REPLACE_disp21w
137ATTRIBUTE_UNUSED static unsigned
138replace_disp21w (unsigned insn, int value ATTRIBUTE_UNUSED)
139{
34e967a5 140 insn = insn & ~0x7fcffc0;
886a2506
NC
141 insn |= ((value >> 0) & 0x01ff) << 18;
142 insn |= ((value >> 9) & 0x03ff) << 6;
143
144 return insn;
145}
146
147#endif /* REPLACE_disp21w */
148
149/* mask = 00000111111111102222222222003333. */
150#ifndef REPLACE_disp25h
151#define REPLACE_disp25h
152ATTRIBUTE_UNUSED static unsigned
153replace_disp25h (unsigned insn, int value ATTRIBUTE_UNUSED)
154{
34e967a5 155 insn = insn & ~0x7feffcf;
886a2506
NC
156 insn |= ((value >> 0) & 0x03ff) << 17;
157 insn |= ((value >> 10) & 0x03ff) << 6;
158 insn |= ((value >> 20) & 0x000f) << 0;
159
160 return insn;
161}
162
163#endif /* REPLACE_disp25h */
164
165/* mask = 00000111111111002222222222003333. */
166#ifndef REPLACE_disp25w
167#define REPLACE_disp25w
168ATTRIBUTE_UNUSED static unsigned
169replace_disp25w (unsigned insn, int value ATTRIBUTE_UNUSED)
170{
34e967a5 171 insn = insn & ~0x7fcffcf;
886a2506
NC
172 insn |= ((value >> 0) & 0x01ff) << 18;
173 insn |= ((value >> 9) & 0x03ff) << 6;
174 insn |= ((value >> 19) & 0x000f) << 0;
175
176 return insn;
177}
178
179#endif /* REPLACE_disp25w */
180
181/* mask = 00000000000000000000000111111111. */
182#ifndef REPLACE_disp9
183#define REPLACE_disp9
184ATTRIBUTE_UNUSED static unsigned
185replace_disp9 (unsigned insn, int value ATTRIBUTE_UNUSED)
186{
34e967a5 187 insn = insn & ~0x1ff;
886a2506
NC
188 insn |= ((value >> 0) & 0x01ff) << 0;
189
190 return insn;
191}
192
193#endif /* REPLACE_disp9 */
194
195/* mask = 00000000111111112000000000000000. */
196#ifndef REPLACE_disp9ls
197#define REPLACE_disp9ls
198ATTRIBUTE_UNUSED static unsigned
199replace_disp9ls (unsigned insn, int value ATTRIBUTE_UNUSED)
200{
34e967a5 201 insn = insn & ~0xff8000;
886a2506
NC
202 insn |= ((value >> 0) & 0x00ff) << 16;
203 insn |= ((value >> 8) & 0x0001) << 15;
204
205 return insn;
206}
207
208#endif /* REPLACE_disp9ls */
209
210/* mask = 0000000111111111. */
211#ifndef REPLACE_disp9s
212#define REPLACE_disp9s
213ATTRIBUTE_UNUSED static unsigned
214replace_disp9s (unsigned insn, int value ATTRIBUTE_UNUSED)
215{
34e967a5 216 insn = insn & ~0x1ff;
886a2506
NC
217 insn |= ((value >> 0) & 0x01ff) << 0;
218
219 return insn;
220}
221
222#endif /* REPLACE_disp9s */
223
224/* mask = 0000011111111111. */
225#ifndef REPLACE_disp13s
226#define REPLACE_disp13s
227ATTRIBUTE_UNUSED static unsigned
228replace_disp13s (unsigned insn, int value ATTRIBUTE_UNUSED)
229{
34e967a5 230 insn = insn & ~0x7ff;
886a2506
NC
231 insn |= ((value >> 0) & 0x07ff) << 0;
232
233 return insn;
234}
235
236#endif /* REPLACE_disp13s */
237
238/* mask = 0000022222200111. */
239#ifndef REPLACE_disp9s1
240#define REPLACE_disp9s1
241ATTRIBUTE_UNUSED static unsigned
242replace_disp9s1 (unsigned insn, int value ATTRIBUTE_UNUSED)
243{
34e967a5 244 insn = insn & ~0x7e7;
886a2506
NC
245 insn |= ((value >> 0) & 0x0007) << 0;
246 insn |= ((value >> 3) & 0x003f) << 5;
247
248 return insn;
249}
250
251#endif /* REPLACE_disp9s1 */
This page took 0.05629 seconds and 4 git commands to generate.