GNU Binutils with patches for OS216
Revisión | 4ec521f238627f7682306d699c8826390a2cc9e7 (tree) |
---|---|
Tiempo | 2017-09-11 14:46:27 |
Autor | Kuan-Lin Chen <kuanlinchentw@gmai...> |
Commiter | Kuan-Lin Chen |
nds32: Rename BIT() to N32_BIT().
@@ -1,3 +1,7 @@ | ||
1 | +2017-09-09 Kamil Rytarowski <n54@gmx.com> | |
2 | + | |
3 | + * elf32-nds32.c: Rename __BIT() to N32_BIT(). | |
4 | + | |
1 | 5 | 2017-09-09 Alan Modra <amodra@gmail.com> |
2 | 6 | |
3 | 7 | * elf64-ppp.c (plt_stub_pad): Handle positive and negative |
@@ -7343,7 +7343,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, | ||
7343 | 7343 | if (!IS_WITHIN_S (N32_IMM14S (insn), 8)) |
7344 | 7344 | goto done; |
7345 | 7345 | |
7346 | - if ((insn & __BIT (14)) == 0) | |
7346 | + if ((insn & N32_BIT (14)) == 0) | |
7347 | 7347 | { |
7348 | 7348 | /* N32_BR1_BEQ */ |
7349 | 7349 | if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5 |
@@ -7411,7 +7411,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, | ||
7411 | 7411 | break; |
7412 | 7412 | |
7413 | 7413 | case N32_OP6_JI: |
7414 | - if ((insn & __BIT (24)) == 0) | |
7414 | + if ((insn & N32_BIT (24)) == 0) | |
7415 | 7415 | { |
7416 | 7416 | /* N32_JI_J */ |
7417 | 7417 | if (IS_WITHIN_S (N32_IMM24S (insn), 8)) |
@@ -7647,7 +7647,7 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) | ||
7647 | 7647 | insn = N32_TYPE2 (SLTI, REG_TA, N16_RT4 (insn16), N16_IMM5U (insn16)); |
7648 | 7648 | goto done; |
7649 | 7649 | case 0x34: /* beqzs8, bnezs8 */ |
7650 | - if (insn16 & __BIT (8)) | |
7650 | + if (insn16 & N32_BIT (8)) | |
7651 | 7651 | insn = N32_BR2 (BNEZ, REG_TA, N16_IMM8S (insn16)); |
7652 | 7652 | else |
7653 | 7653 | insn = N32_BR2 (BEQZ, REG_TA, N16_IMM8S (insn16)); |
@@ -7747,7 +7747,7 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) | ||
7747 | 7747 | switch (__GF (insn16, 11, 4)) |
7748 | 7748 | { |
7749 | 7749 | case 0x7: /* lwi37.fp/swi37.fp */ |
7750 | - if (insn16 & __BIT (7)) /* swi37.fp */ | |
7750 | + if (insn16 & N32_BIT (7)) /* swi37.fp */ | |
7751 | 7751 | insn = N32_TYPE2 (SWI, N16_RT38 (insn16), REG_FP, N16_IMM7U (insn16)); |
7752 | 7752 | else /* lwi37.fp */ |
7753 | 7753 | insn = N32_TYPE2 (LWI, N16_RT38 (insn16), REG_FP, N16_IMM7U (insn16)); |
@@ -7850,7 +7850,7 @@ turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn) | ||
7850 | 7850 | break; |
7851 | 7851 | case N32_OP6_LBSI: |
7852 | 7852 | /* lbsi.gp */ |
7853 | - oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), __BIT (19)); | |
7853 | + oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), N32_BIT (19)); | |
7854 | 7854 | break; |
7855 | 7855 | case N32_OP6_SBI: |
7856 | 7856 | /* sbi.gp */ |
@@ -7858,7 +7858,7 @@ turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn) | ||
7858 | 7858 | break; |
7859 | 7859 | case N32_OP6_ORI: |
7860 | 7860 | /* addi.gp */ |
7861 | - oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); | |
7861 | + oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), N32_BIT (19)); | |
7862 | 7862 | break; |
7863 | 7863 | } |
7864 | 7864 | break; |
@@ -7872,11 +7872,11 @@ turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn) | ||
7872 | 7872 | break; |
7873 | 7873 | case N32_OP6_LHSI: |
7874 | 7874 | /* lhsi.gp */ |
7875 | - oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (18)); | |
7875 | + oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), N32_BIT (18)); | |
7876 | 7876 | break; |
7877 | 7877 | case N32_OP6_SHI: |
7878 | 7878 | /* shi.gp */ |
7879 | - oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (19)); | |
7879 | + oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), N32_BIT (19)); | |
7880 | 7880 | break; |
7881 | 7881 | } |
7882 | 7882 | break; |
@@ -11319,7 +11319,7 @@ nds32_elf_relax_pltgot_suff (struct bfd_link_info *link_info, bfd *abfd, | ||
11319 | 11319 | irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), |
11320 | 11320 | R_NDS32_PLT_GOTREL_LO19); |
11321 | 11321 | /* addi.gp */ |
11322 | - insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); | |
11322 | + insn = N32_TYPE1 (SBGP, N32_RT5 (insn), N32_BIT (19)); | |
11323 | 11323 | } |
11324 | 11324 | else if (N32_OP6 (insn) == N32_OP6_JREG |
11325 | 11325 | && N32_SUB5 (insn) == N32_JREG_JRAL) |
@@ -11452,12 +11452,12 @@ nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd, | ||
11452 | 11452 | ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); |
11453 | 11453 | break; |
11454 | 11454 | case (N32_OP6_MEM << 8) | N32_MEM_LHS: |
11455 | - insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (18)); | |
11455 | + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), N32_BIT (18)); | |
11456 | 11456 | irel->r_info = |
11457 | 11457 | ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); |
11458 | 11458 | break; |
11459 | 11459 | case (N32_OP6_MEM << 8) | N32_MEM_SH: |
11460 | - insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (19)); | |
11460 | + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), N32_BIT (19)); | |
11461 | 11461 | irel->r_info = |
11462 | 11462 | ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); |
11463 | 11463 | break; |
@@ -11468,7 +11468,7 @@ nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd, | ||
11468 | 11468 | ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); |
11469 | 11469 | break; |
11470 | 11470 | case (N32_OP6_MEM << 8) | N32_MEM_LBS: |
11471 | - insn = N32_TYPE1 (LBGP, N32_RT5 (insn), __BIT (19)); | |
11471 | + insn = N32_TYPE1 (LBGP, N32_RT5 (insn), N32_BIT (19)); | |
11472 | 11472 | irel->r_info = |
11473 | 11473 | ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); |
11474 | 11474 | break; |
@@ -11478,7 +11478,7 @@ nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd, | ||
11478 | 11478 | ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); |
11479 | 11479 | break; |
11480 | 11480 | case (N32_OP6_ALU1 << 8) | N32_ALU1_ADD: |
11481 | - insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); | |
11481 | + insn = N32_TYPE1 (SBGP, N32_RT5 (insn), N32_BIT (19)); | |
11482 | 11482 | irel->r_info = |
11483 | 11483 | ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); |
11484 | 11484 | break; |
@@ -1,3 +1,7 @@ | ||
1 | +2017-09-06 Kamil Rytarowski <n54@gmx.com> | |
2 | + | |
3 | + * opcode/nds32.h: Rename __BIT() to N32_BIT(). | |
4 | + | |
1 | 5 | 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com> |
2 | 6 | Edmar Wienskoski <edmar.wienskoski@nxp.com |
3 | 7 |
@@ -50,8 +50,8 @@ static const int nds32_r54map[] ATTRIBUTE_UNUSED = | ||
50 | 50 | -1, -1, -1, -1, -1, -1, -1, -1 |
51 | 51 | }; |
52 | 52 | |
53 | -#define __BIT(n) (1 << (n)) | |
54 | -#define __MASK(n) (__BIT (n) - 1) | |
53 | +#define N32_BIT(n) (1 << (n)) | |
54 | +#define __MASK(n) (N32_BIT (n) - 1) | |
55 | 55 | #define __MF(v, off, bs) (((v) & __MASK (bs)) << (off)) |
56 | 56 | #define __GF(v, off, bs) (((v) >> off) & __MASK (bs)) |
57 | 57 | #define __SEXT(v, bs) ((((v) & ((1 << (bs)) - 1)) ^ (1 << ((bs) - 1))) - (1 << ((bs) - 1))) |
@@ -1,3 +1,9 @@ | ||
1 | +2017-09-09 Kamil Rytarowski <n54@gmx.com> | |
2 | + | |
3 | + * nds32-asm.c: Rename __BIT() to N32_BIT(). | |
4 | + * nds32-asm.h: Likewise. | |
5 | + * nds32-dis.c: Likewise. | |
6 | + | |
1 | 7 | 2017-09-09 H.J. Lu <hongjiu.lu@intel.com> |
2 | 8 | |
3 | 9 | * i386-dis.c (last_active_prefix): Removed. |
@@ -212,8 +212,8 @@ const field_t operand_fields[] = | ||
212 | 212 | {NULL, 0, 0, 0, 0, NULL} |
213 | 213 | }; |
214 | 214 | |
215 | -#define DEF_REG(r) (__BIT (r)) | |
216 | -#define USE_REG(r) (__BIT (r)) | |
215 | +#define DEF_REG(r) (N32_BIT (r)) | |
216 | +#define USE_REG(r) (N32_BIT (r)) | |
217 | 217 | #define RT(r) (r << 20) |
218 | 218 | #define RA(r) (r << 15) |
219 | 219 | #define RB(r) (r << 10) |
@@ -252,29 +252,29 @@ struct nds32_opcode nds32_opcodes[] = | ||
252 | 252 | |
253 | 253 | /* seg-DPREFI. */ |
254 | 254 | {"dprefi.w", "%dpref_st,[%ra{+%i15s2}]", OP6 (DPREFI), 4, ATTR_V3MEX_V1, 0, NULL, 0, NULL}, |
255 | - {"dprefi.d", "%dpref_st,[%ra{+%i15s3}]", OP6 (DPREFI) | __BIT (24), 4, ATTR_V3MEX_V1, 0, NULL, 0, NULL}, | |
255 | + {"dprefi.d", "%dpref_st,[%ra{+%i15s3}]", OP6 (DPREFI) | N32_BIT (24), 4, ATTR_V3MEX_V1, 0, NULL, 0, NULL}, | |
256 | 256 | /* seg-LBGP. */ |
257 | 257 | {"lbi.gp", "=rt,[+%i19s]", OP6 (LBGP), 4, ATTR (GPREL) | ATTR_V2UP, USE_REG (29), NULL, 0, NULL}, |
258 | - {"lbsi.gp", "=rt,[+%i19s]", OP6 (LBGP) | __BIT (19), 4, ATTR (GPREL) | ATTR_V2UP, USE_REG (29), NULL, 0, NULL}, | |
258 | + {"lbsi.gp", "=rt,[+%i19s]", OP6 (LBGP) | N32_BIT (19), 4, ATTR (GPREL) | ATTR_V2UP, USE_REG (29), NULL, 0, NULL}, | |
259 | 259 | /* seg-LWC/0. */ |
260 | 260 | {"cplwi", "%cp,=cprt,[%ra{+%i12s2}]", OP6 (LWC), 4, 0, 0, NULL, 0, NULL}, |
261 | - {"cplwi.bi", "%cp,=cprt,[%ra],%i12s2", OP6 (LWC) | __BIT (12), 4, 0, 0, NULL, 0, NULL}, | |
261 | + {"cplwi.bi", "%cp,=cprt,[%ra],%i12s2", OP6 (LWC) | N32_BIT (12), 4, 0, 0, NULL, 0, NULL}, | |
262 | 262 | /* seg-SWC/0. */ |
263 | 263 | {"cpswi", "%cp,=cprt,[%ra{+%i12s2}]", OP6 (SWC), 4, 0, 0, NULL, 0, NULL}, |
264 | - {"cpswi.bi", "%cp,=cprt,[%ra],%i12s2", OP6 (SWC) | __BIT (12), 4, 0, 0, NULL, 0, NULL}, | |
264 | + {"cpswi.bi", "%cp,=cprt,[%ra],%i12s2", OP6 (SWC) | N32_BIT (12), 4, 0, 0, NULL, 0, NULL}, | |
265 | 265 | /* seg-LDC/0. */ |
266 | 266 | {"cpldi", "%cp,%cprt,[%ra{+%i12s2}]", OP6 (LDC), 4, 0, 0, NULL, 0, NULL}, |
267 | - {"cpldi.bi", "%cp,%cprt,[%ra],%i12s2", OP6 (LDC) | __BIT (12), 4, 0, 0, NULL, 0, NULL}, | |
267 | + {"cpldi.bi", "%cp,%cprt,[%ra],%i12s2", OP6 (LDC) | N32_BIT (12), 4, 0, 0, NULL, 0, NULL}, | |
268 | 268 | /* seg-SDC/0. */ |
269 | 269 | {"cpsdi", "%cp,%cprt,[%ra{+%i12s2}]", OP6 (SDC), 4, 0, 0, NULL, 0, NULL}, |
270 | - {"cpsdi.bi", "%cp,%cprt,[%ra],%i12s2", OP6 (SDC) | __BIT (12), 4, 0, 0, NULL, 0, NULL}, | |
270 | + {"cpsdi.bi", "%cp,%cprt,[%ra],%i12s2", OP6 (SDC) | N32_BIT (12), 4, 0, 0, NULL, 0, NULL}, | |
271 | 271 | /* seg-LSMW. */ |
272 | 272 | {"lmw", "%abdim %rt,[%ra],%re{,%enb4}", LSMW (LSMW), 4, ATTR_ALL, 0, NULL, 0, NULL}, |
273 | 273 | {"lmwa", "%abdim %rt,[%ra],%re{,%enb4}", LSMW (LSMWA), 4, ATTR_V3MEX_V2, 0, NULL, 0, NULL}, |
274 | 274 | {"lmwzb", "%abm %rt,[%ra],%re{,%enb4}", LSMW (LSMWZB), 4, ATTR (STR_EXT), 0, NULL, 0, NULL}, |
275 | - {"smw", "%abdim %rt,[%ra],%re{,%enb4}", LSMW (LSMW) | __BIT (5), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
276 | - {"smwa", "%abdim %rt,[%ra],%re{,%enb4}", LSMW (LSMWA) | __BIT (5), 4, ATTR_V3MEX_V2, 0, NULL, 0, NULL}, | |
277 | - {"smwzb", "%abm %rt,[%ra],%re{,%enb4}", LSMW (LSMWZB) | __BIT (5), 4, ATTR (STR_EXT), 0, NULL, 0, NULL}, | |
275 | + {"smw", "%abdim %rt,[%ra],%re{,%enb4}", LSMW (LSMW) | N32_BIT (5), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
276 | + {"smwa", "%abdim %rt,[%ra],%re{,%enb4}", LSMW (LSMWA) | N32_BIT (5), 4, ATTR_V3MEX_V2, 0, NULL, 0, NULL}, | |
277 | + {"smwzb", "%abm %rt,[%ra],%re{,%enb4}", LSMW (LSMWZB) | N32_BIT (5), 4, ATTR (STR_EXT), 0, NULL, 0, NULL}, | |
278 | 278 | /* seg-HWGP. */ |
279 | 279 | {"lhi.gp", "=rt,[+%i18s1]", OP6 (HWGP), 4, ATTR (GPREL) | ATTR_V2UP, USE_REG (29), NULL, 0, NULL}, |
280 | 280 | {"lhsi.gp", "=rt,[+%i18s1]", OP6 (HWGP) | (2 << 17), 4, ATTR (GPREL) | ATTR_V2UP, USE_REG (29), NULL, 0, NULL}, |
@@ -284,10 +284,10 @@ struct nds32_opcode nds32_opcodes[] = | ||
284 | 284 | |
285 | 285 | /* seg-SBGP. */ |
286 | 286 | {"sbi.gp", "%rt,[+%i19s]", OP6 (SBGP), 4, ATTR (GPREL) | ATTR_V2UP, USE_REG (29), NULL, 0, NULL}, |
287 | - {"addi.gp", "=rt,%i19s", OP6 (SBGP) | __BIT (19), 4, ATTR (GPREL) | ATTR_V2UP, USE_REG (29), NULL, 0, NULL}, | |
287 | + {"addi.gp", "=rt,%i19s", OP6 (SBGP) | N32_BIT (19), 4, ATTR (GPREL) | ATTR_V2UP, USE_REG (29), NULL, 0, NULL}, | |
288 | 288 | /* seg-JI. */ |
289 | 289 | {"j", "%i24s1", OP6 (JI), 4, ATTR_PCREL | ATTR_ALL, 0, NULL, 0, NULL}, |
290 | - {"jal", "%i24s1", OP6 (JI) | __BIT (24), 4, ATTR_PCREL | ATTR_ALL, 0, NULL, 0, NULL}, | |
290 | + {"jal", "%i24s1", OP6 (JI) | N32_BIT (24), 4, ATTR_PCREL | ATTR_ALL, 0, NULL, 0, NULL}, | |
291 | 291 | /* seg-JREG. */ |
292 | 292 | {"jr", "%rb", JREG (JR), 4, ATTR (BRANCH) | ATTR_ALL, 0, NULL, 0, NULL}, |
293 | 293 | {"jral", "%rt,%rb", JREG (JRAL), 4, ATTR (BRANCH) | ATTR_ALL, 0, NULL, 0, NULL}, |
@@ -304,7 +304,7 @@ struct nds32_opcode nds32_opcodes[] = | ||
304 | 304 | {"jral", "%dtiton %rb", JREG (JRAL) | RT (30), 4, ATTR (BRANCH) | ATTR_ALL, 0, NULL, 0, NULL}, |
305 | 305 | /* seg-BR1. */ |
306 | 306 | {"beq", "%rt,%ra,%i14s1", OP6 (BR1), 4, ATTR_PCREL | ATTR_ALL, 0, NULL, 0, NULL}, |
307 | - {"bne", "%rt,%ra,%i14s1", OP6 (BR1) | __BIT (14), 4, ATTR_PCREL | ATTR_ALL, 0, NULL, 0, NULL}, | |
307 | + {"bne", "%rt,%ra,%i14s1", OP6 (BR1) | N32_BIT (14), 4, ATTR_PCREL | ATTR_ALL, 0, NULL, 0, NULL}, | |
308 | 308 | /* seg-BR2. */ |
309 | 309 | #define BR2(sub) (OP6 (BR2) | (N32_BR2_ ## sub << 16)) |
310 | 310 | {"ifcall", "%i16s1", BR2 (IFCALL), 4, ATTR (IFC_EXT), 0, NULL, 0, NULL}, |
@@ -318,7 +318,7 @@ struct nds32_opcode nds32_opcodes[] = | ||
318 | 318 | {"bltzal", "%rt,%i16s1", BR2 (BLTZAL), 4, ATTR_PCREL | ATTR_ALL, 0, NULL, 0, NULL}, |
319 | 319 | /* seg-BR3. */ |
320 | 320 | {"beqc", "%rt,%i11br3,%i8s1", OP6 (BR3), 4, ATTR_PCREL | ATTR_V3MUP, 0, NULL, 0, NULL}, |
321 | - {"bnec", "%rt,%i11br3,%i8s1", OP6 (BR3) | __BIT (19), 4, ATTR_PCREL | ATTR_V3MUP, 0, NULL, 0, NULL}, | |
321 | + {"bnec", "%rt,%i11br3,%i8s1", OP6 (BR3) | N32_BIT (19), 4, ATTR_PCREL | ATTR_V3MUP, 0, NULL, 0, NULL}, | |
322 | 322 | /* seg-SIMD. */ |
323 | 323 | {"pbsad", "%rt,%ra,%rb", SIMD (PBSAD), 4, ATTR (PERF2_EXT), 0, NULL, 0, NULL}, |
324 | 324 | {"pbsada", "%rt,%ra,%rb", SIMD (PBSADA), 4, ATTR (PERF2_EXT), 0, NULL, 0, NULL}, |
@@ -392,22 +392,22 @@ struct nds32_opcode nds32_opcodes[] = | ||
392 | 392 | |
393 | 393 | /* seg-ALU2_FFBI. */ |
394 | 394 | {"ffb", "=rt,%ra,%rb", ALU2 (FFB), 4, ATTR (STR_EXT), 0, NULL, 0, NULL}, |
395 | - {"ffbi", "=rt,%ra,%ib8u", ALU2 (FFBI) | __BIT (6), 4, ATTR (STR_EXT), 0, NULL, 0, NULL}, | |
395 | + {"ffbi", "=rt,%ra,%ib8u", ALU2 (FFBI) | N32_BIT (6), 4, ATTR (STR_EXT), 0, NULL, 0, NULL}, | |
396 | 396 | /* seg-ALU2_FLMISM. */ |
397 | 397 | {"ffmism", "=rt,%ra,%rb", ALU2 (FFMISM), 4, ATTR (STR_EXT), 0, NULL, 0, NULL}, |
398 | - {"flmism", "=rt,%ra,%rb", ALU2 (FLMISM) | __BIT (6), 4, ATTR (STR_EXT), 0, NULL, 0, NULL}, | |
398 | + {"flmism", "=rt,%ra,%rb", ALU2 (FLMISM) | N32_BIT (6), 4, ATTR (STR_EXT), 0, NULL, 0, NULL}, | |
399 | 399 | /* seg-ALU2_MULSR64. */ |
400 | 400 | {"mults64", "=dt,%ra,%rb", ALU2 (MULTS64), 4, ATTR_ALL, 0, NULL, 0, NULL}, |
401 | - {"mulsr64", "=rt,%ra,%rb", ALU2 (MULSR64)| __BIT (6), 4, ATTR_V3MEX_V2, 0, NULL, 0, NULL}, | |
401 | + {"mulsr64", "=rt,%ra,%rb", ALU2 (MULSR64)| N32_BIT (6), 4, ATTR_V3MEX_V2, 0, NULL, 0, NULL}, | |
402 | 402 | /* seg-ALU2_MULR64. */ |
403 | 403 | {"mult64", "=dt,%ra,%rb", ALU2 (MULT64), 4, ATTR_ALL, 0, NULL, 0, NULL}, |
404 | - {"mulr64", "=rt,%ra,%rb", ALU2 (MULR64) | __BIT (6), 4, ATTR_V3MEX_V2, 0, NULL, 0, NULL}, | |
404 | + {"mulr64", "=rt,%ra,%rb", ALU2 (MULR64) | N32_BIT (6), 4, ATTR_V3MEX_V2, 0, NULL, 0, NULL}, | |
405 | 405 | /* seg-ALU2_MADDR32. */ |
406 | 406 | {"madd32", "=dt,%ra,%rb", ALU2 (MADD32), 4, ATTR (MAC) | ATTR (DXREG) | ATTR_ALL, 0, NULL, 0, NULL}, |
407 | - {"maddr32", "=rt,%ra,%rb", ALU2 (MADDR32) | __BIT (6), 4, ATTR (MAC) | ATTR_V2UP, 0, NULL, 0, NULL}, | |
407 | + {"maddr32", "=rt,%ra,%rb", ALU2 (MADDR32) | N32_BIT (6), 4, ATTR (MAC) | ATTR_V2UP, 0, NULL, 0, NULL}, | |
408 | 408 | /* seg-ALU2_MSUBR32. */ |
409 | 409 | {"msub32", "=dt,%ra,%rb", ALU2 (MSUB32), 4, ATTR (MAC) | ATTR (DXREG) | ATTR_ALL, 0, NULL, 0, NULL}, |
410 | - {"msubr32", "=rt,%ra,%rb", ALU2 (MSUBR32) | __BIT (6), 4, ATTR (MAC) | ATTR_V2UP, 0, NULL, 0, NULL}, | |
410 | + {"msubr32", "=rt,%ra,%rb", ALU2 (MSUBR32) | N32_BIT (6), 4, ATTR (MAC) | ATTR_V2UP, 0, NULL, 0, NULL}, | |
411 | 411 | |
412 | 412 | /* seg-MISC. */ |
413 | 413 | {"standby", "%stdby_st", MISC (STANDBY), 4, ATTR_ALL, 0, NULL, 0, NULL}, |
@@ -425,11 +425,11 @@ struct nds32_opcode nds32_opcodes[] = | ||
425 | 425 | /* seg-MISC_MTSR. */ |
426 | 426 | {"mtsr", "%rt,%sr", MISC (MTSR), 4, ATTR_ALL, 0, NULL, 0, NULL}, |
427 | 427 | /* seg-MISC_SETEND. */ |
428 | - {"setend.l", "", MISC (MTSR) | (SRIDX (1, 0, 0) << 10) | __BIT (5), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
429 | - {"setend.b", "", MISC (MTSR) | (SRIDX (1, 0, 0) << 10) | __BIT (5) | __BIT (20), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
428 | + {"setend.l", "", MISC (MTSR) | (SRIDX (1, 0, 0) << 10) | N32_BIT (5), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
429 | + {"setend.b", "", MISC (MTSR) | (SRIDX (1, 0, 0) << 10) | N32_BIT (5) | N32_BIT (20), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
430 | 430 | /* seg-MISC_SETGIE. */ |
431 | - {"setgie.d", "", MISC (MTSR) | (SRIDX (1, 0, 0) << 10) | __BIT (6), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
432 | - {"setgie.e", "", MISC (MTSR) | (SRIDX (1, 0, 0) << 10) | __BIT (6) | __BIT (20), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
431 | + {"setgie.d", "", MISC (MTSR) | (SRIDX (1, 0, 0) << 10) | N32_BIT (6), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
432 | + {"setgie.e", "", MISC (MTSR) | (SRIDX (1, 0, 0) << 10) | N32_BIT (6) | N32_BIT (20), 4, ATTR_ALL, 0, NULL, 0, NULL}, | |
433 | 433 | {"mfsr", "=rt,%ridx", MISC (MFSR), 4, ATTR_ALL, 0, NULL, 0, NULL}, |
434 | 434 | {"mtsr", "%rt,%ridx", MISC (MTSR), 4, ATTR_ALL, 0, NULL, 0, NULL}, |
435 | 435 | {"trap", "", MISC (TRAP), 4, ATTR_V3MEX_V1, 0, NULL, 0, NULL}, |
@@ -764,19 +764,19 @@ struct nds32_opcode nds32_opcodes[] = | ||
764 | 764 | /* Saturation ext ISA. */ |
765 | 765 | {"kaddw", "=rt,%ra,%rb", ALU2 (KADD), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, |
766 | 766 | {"ksubw", "=rt,%ra,%rb", ALU2 (KSUB), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, |
767 | - {"kaddh", "=rt,%ra,%rb", ALU2 (KADD) | __BIT (6), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
768 | - {"ksubh", "=rt,%ra,%rb", ALU2 (KSUB) | __BIT (6), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
767 | + {"kaddh", "=rt,%ra,%rb", ALU2 (KADD) | N32_BIT (6), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
768 | + {"ksubh", "=rt,%ra,%rb", ALU2 (KSUB) | N32_BIT (6), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
769 | 769 | {"kdmbb", "=rt,%ra,%rb", ALU2 (KMxy), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, |
770 | - {"kdmbt", "=rt,%ra,%rb", ALU2 (KMxy) | __BIT (6), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
771 | - {"kdmtb", "=rt,%ra,%rb", ALU2 (KMxy) | __BIT (7), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
772 | - {"kdmtt", "=rt,%ra,%rb", ALU2 (KMxy) | __BIT (6) | __BIT (7), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
773 | - {"khmbb", "=rt,%ra,%rb", ALU2 (KMxy) | __BIT (8), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
774 | - {"khmbt", "=rt,%ra,%rb", ALU2 (KMxy) | __BIT (8) | __BIT (6), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
775 | - {"khmtb", "=rt,%ra,%rb", ALU2 (KMxy) | __BIT (8) | __BIT (7), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
776 | - {"khmtt", "=rt,%ra,%rb", ALU2 (KMxy) | __BIT (8) | __BIT (6) | __BIT (7), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
770 | + {"kdmbt", "=rt,%ra,%rb", ALU2 (KMxy) | N32_BIT (6), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
771 | + {"kdmtb", "=rt,%ra,%rb", ALU2 (KMxy) | N32_BIT (7), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
772 | + {"kdmtt", "=rt,%ra,%rb", ALU2 (KMxy) | N32_BIT (6) | N32_BIT (7), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
773 | + {"khmbb", "=rt,%ra,%rb", ALU2 (KMxy) | N32_BIT (8), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
774 | + {"khmbt", "=rt,%ra,%rb", ALU2 (KMxy) | N32_BIT (8) | N32_BIT (6), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
775 | + {"khmtb", "=rt,%ra,%rb", ALU2 (KMxy) | N32_BIT (8) | N32_BIT (7), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
776 | + {"khmtt", "=rt,%ra,%rb", ALU2 (KMxy) | N32_BIT (8) | N32_BIT (6) | N32_BIT (7), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
777 | 777 | {"kslraw", "=rt,%ra,%rb", ALU2 (KSLRA), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, |
778 | - {"rdov", "=rt", ALU2 (MFUSR) | __BIT (6) | ( 0x1e << 15), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
779 | - {"clrov", "", ALU2 (MTUSR) | __BIT (6) | ( 0x1e << 15), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
778 | + {"rdov", "=rt", ALU2 (MFUSR) | N32_BIT (6) | ( 0x1e << 15), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
779 | + {"clrov", "", ALU2 (MTUSR) | N32_BIT (6) | ( 0x1e << 15), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL}, | |
780 | 780 | |
781 | 781 | /* Audio ext. instructions. */ |
782 | 782 |
@@ -279,7 +279,7 @@ extern void nds32_asm_init (nds32_asm_desc_t *, int); | ||
279 | 279 | #define ALU2(sub) (OP6 (ALU2) | N32_ALU2_ ## sub) |
280 | 280 | #define MISC(sub) (OP6 (MISC) | N32_MISC_ ## sub) |
281 | 281 | #define MEM(sub) (OP6 (MEM) | N32_MEM_ ## sub) |
282 | -#define FPU_RA_IMMBI(sub) (OP6 (sub) | __BIT (12)) | |
282 | +#define FPU_RA_IMMBI(sub) (OP6 (sub) | N32_BIT (12)) | |
283 | 283 | #define FS1(sub) (OP6 (COP) | N32_FPU_FS1 | (N32_FPU_FS1_ ## sub << 6)) |
284 | 284 | #define FS1_F2OP(sub) (OP6 (COP) | N32_FPU_FS1 | (N32_FPU_FS1_F2OP << 6) \ |
285 | 285 | | (N32_FPU_FS1_F2OP_ ## sub << 10)) |
@@ -759,10 +759,10 @@ nds32_mask_opcode (uint32_t insn) | ||
759 | 759 | return MASK_OP (insn, 0); |
760 | 760 | case N32_OP6_ALU2: |
761 | 761 | /* FFBI */ |
762 | - if (__GF (insn, 0, 7) == (N32_ALU2_FFBI | __BIT (6))) | |
762 | + if (__GF (insn, 0, 7) == (N32_ALU2_FFBI | N32_BIT (6))) | |
763 | 763 | return MASK_OP (insn, 0x7f); |
764 | - else if (__GF (insn, 0, 7) == (N32_ALU2_MFUSR | __BIT (6)) | |
765 | - || __GF (insn, 0, 7) == (N32_ALU2_MTUSR | __BIT (6))) | |
764 | + else if (__GF (insn, 0, 7) == (N32_ALU2_MFUSR | N32_BIT (6)) | |
765 | + || __GF (insn, 0, 7) == (N32_ALU2_MTUSR | N32_BIT (6))) | |
766 | 766 | /* RDOV CLROV */ |
767 | 767 | return MASK_OP (insn, 0xf81ff); |
768 | 768 | return MASK_OP (insn, 0x1ff); |