]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - include/opcode/arc-func.h
1 /* Replace functions for the ARC relocs.
2 Copyright (C) 2015-2016 Free Software Foundation, Inc.
4 This file is part of GAS, the GNU Assembler, GDB, the GNU debugger, and
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)
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.
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. */
22 /* mask = 00000000000000000000000000000000. */
25 ATTRIBUTE_UNUSED
static unsigned
26 replace_none (unsigned insn
, int value ATTRIBUTE_UNUSED
)
32 #endif /* REPLACE_none */
34 /* mask = 11111111. */
37 ATTRIBUTE_UNUSED
static unsigned
38 replace_bits8 (unsigned insn
, int value ATTRIBUTE_UNUSED
)
40 insn
|= ((value
>> 0) & 0x00ff) << 0;
45 #endif /* REPLACE_bits8 */
47 /* mask = 1111111111111111. */
48 #ifndef REPLACE_bits16
49 #define REPLACE_bits16
50 ATTRIBUTE_UNUSED
static unsigned
51 replace_bits16 (unsigned insn
, int value ATTRIBUTE_UNUSED
)
53 insn
|= ((value
>> 0) & 0xffff) << 0;
58 #endif /* REPLACE_bits16 */
60 /* mask = 111111111111111111111111. */
61 #ifndef REPLACE_bits24
62 #define REPLACE_bits24
63 ATTRIBUTE_UNUSED
static unsigned
64 replace_bits24 (unsigned insn
, int value ATTRIBUTE_UNUSED
)
66 insn
|= ((value
>> 0) & 0xffffff) << 0;
71 #endif /* REPLACE_bits24 */
73 /* mask = 11111111111111111111111111111111. */
74 #ifndef REPLACE_word32
75 #define REPLACE_word32
76 ATTRIBUTE_UNUSED
static unsigned
77 replace_word32 (unsigned insn
, int value ATTRIBUTE_UNUSED
)
79 insn
|= ((value
>> 0) & 0xffffffff) << 0;
84 #endif /* REPLACE_word32 */
86 /* mask = 0000000000000000000000000000000011111111111111111111111111111111. */
89 ATTRIBUTE_UNUSED
static unsigned
90 replace_limm (unsigned insn
, int value ATTRIBUTE_UNUSED
)
92 insn
|= ((value
>> 0) & 0xffffffff) << 0;
97 #endif /* REPLACE_limm */
99 /* mask = 000000000000000011111111111111111111111111111111. */
100 #ifndef REPLACE_limms
101 #define REPLACE_limms
102 ATTRIBUTE_UNUSED
static unsigned
103 replace_limms (unsigned insn
, int value ATTRIBUTE_UNUSED
)
105 insn
|= ((value
>> 0) & 0xffffffff) << 0;
110 #endif /* REPLACE_limms */
112 /* mask = 00000111111111102222222222000000. */
113 #ifndef REPLACE_disp21h
114 #define REPLACE_disp21h
115 ATTRIBUTE_UNUSED
static unsigned
116 replace_disp21h (unsigned insn
, int value ATTRIBUTE_UNUSED
)
118 insn
|= ((value
>> 0) & 0x03ff) << 17;
119 insn
|= ((value
>> 10) & 0x03ff) << 6;
124 #endif /* REPLACE_disp21h */
126 /* mask = 00000111111111002222222222000000. */
127 #ifndef REPLACE_disp21w
128 #define REPLACE_disp21w
129 ATTRIBUTE_UNUSED
static unsigned
130 replace_disp21w (unsigned insn
, int value ATTRIBUTE_UNUSED
)
132 insn
|= ((value
>> 0) & 0x01ff) << 18;
133 insn
|= ((value
>> 9) & 0x03ff) << 6;
138 #endif /* REPLACE_disp21w */
140 /* mask = 00000111111111102222222222003333. */
141 #ifndef REPLACE_disp25h
142 #define REPLACE_disp25h
143 ATTRIBUTE_UNUSED
static unsigned
144 replace_disp25h (unsigned insn
, int value ATTRIBUTE_UNUSED
)
146 insn
|= ((value
>> 0) & 0x03ff) << 17;
147 insn
|= ((value
>> 10) & 0x03ff) << 6;
148 insn
|= ((value
>> 20) & 0x000f) << 0;
153 #endif /* REPLACE_disp25h */
155 /* mask = 00000111111111002222222222003333. */
156 #ifndef REPLACE_disp25w
157 #define REPLACE_disp25w
158 ATTRIBUTE_UNUSED
static unsigned
159 replace_disp25w (unsigned insn
, int value ATTRIBUTE_UNUSED
)
161 insn
|= ((value
>> 0) & 0x01ff) << 18;
162 insn
|= ((value
>> 9) & 0x03ff) << 6;
163 insn
|= ((value
>> 19) & 0x000f) << 0;
168 #endif /* REPLACE_disp25w */
170 /* mask = 00000000000000000000000111111111. */
171 #ifndef REPLACE_disp9
172 #define REPLACE_disp9
173 ATTRIBUTE_UNUSED
static unsigned
174 replace_disp9 (unsigned insn
, int value ATTRIBUTE_UNUSED
)
176 insn
|= ((value
>> 0) & 0x01ff) << 0;
181 #endif /* REPLACE_disp9 */
183 /* mask = 00000000111111112000000000000000. */
184 #ifndef REPLACE_disp9ls
185 #define REPLACE_disp9ls
186 ATTRIBUTE_UNUSED
static unsigned
187 replace_disp9ls (unsigned insn
, int value ATTRIBUTE_UNUSED
)
189 insn
|= ((value
>> 0) & 0x00ff) << 16;
190 insn
|= ((value
>> 8) & 0x0001) << 15;
195 #endif /* REPLACE_disp9ls */
197 /* mask = 0000000111111111. */
198 #ifndef REPLACE_disp9s
199 #define REPLACE_disp9s
200 ATTRIBUTE_UNUSED
static unsigned
201 replace_disp9s (unsigned insn
, int value ATTRIBUTE_UNUSED
)
203 insn
|= ((value
>> 0) & 0x01ff) << 0;
208 #endif /* REPLACE_disp9s */
210 /* mask = 0000011111111111. */
211 #ifndef REPLACE_disp13s
212 #define REPLACE_disp13s
213 ATTRIBUTE_UNUSED
static unsigned
214 replace_disp13s (unsigned insn
, int value ATTRIBUTE_UNUSED
)
216 insn
|= ((value
>> 0) & 0x07ff) << 0;
221 #endif /* REPLACE_disp13s */
223 /* mask = 0000022222200111. */
224 #ifndef REPLACE_disp9s1
225 #define REPLACE_disp9s1
226 ATTRIBUTE_UNUSED
static unsigned
227 replace_disp9s1 (unsigned insn
, int value ATTRIBUTE_UNUSED
)
229 insn
|= ((value
>> 0) & 0x0007) << 0;
230 insn
|= ((value
>> 3) & 0x003f) << 5;
235 #endif /* REPLACE_disp9s1 */