• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisión4ec521f238627f7682306d699c8826390a2cc9e7 (tree)
Tiempo2017-09-11 14:46:27
AutorKuan-Lin Chen <kuanlinchentw@gmai...>
CommiterKuan-Lin Chen

Log Message

nds32: Rename BIT() to N32_BIT().

Cambiar Resumen

Diferencia incremental

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
1+2017-09-09 Kamil Rytarowski <n54@gmx.com>
2+
3+ * elf32-nds32.c: Rename __BIT() to N32_BIT().
4+
15 2017-09-09 Alan Modra <amodra@gmail.com>
26
37 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -7343,7 +7343,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16,
73437343 if (!IS_WITHIN_S (N32_IMM14S (insn), 8))
73447344 goto done;
73457345
7346- if ((insn & __BIT (14)) == 0)
7346+ if ((insn & N32_BIT (14)) == 0)
73477347 {
73487348 /* N32_BR1_BEQ */
73497349 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,
74117411 break;
74127412
74137413 case N32_OP6_JI:
7414- if ((insn & __BIT (24)) == 0)
7414+ if ((insn & N32_BIT (24)) == 0)
74157415 {
74167416 /* N32_JI_J */
74177417 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)
76477647 insn = N32_TYPE2 (SLTI, REG_TA, N16_RT4 (insn16), N16_IMM5U (insn16));
76487648 goto done;
76497649 case 0x34: /* beqzs8, bnezs8 */
7650- if (insn16 & __BIT (8))
7650+ if (insn16 & N32_BIT (8))
76517651 insn = N32_BR2 (BNEZ, REG_TA, N16_IMM8S (insn16));
76527652 else
76537653 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)
77477747 switch (__GF (insn16, 11, 4))
77487748 {
77497749 case 0x7: /* lwi37.fp/swi37.fp */
7750- if (insn16 & __BIT (7)) /* swi37.fp */
7750+ if (insn16 & N32_BIT (7)) /* swi37.fp */
77517751 insn = N32_TYPE2 (SWI, N16_RT38 (insn16), REG_FP, N16_IMM7U (insn16));
77527752 else /* lwi37.fp */
77537753 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)
78507850 break;
78517851 case N32_OP6_LBSI:
78527852 /* lbsi.gp */
7853- oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), __BIT (19));
7853+ oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), N32_BIT (19));
78547854 break;
78557855 case N32_OP6_SBI:
78567856 /* sbi.gp */
@@ -7858,7 +7858,7 @@ turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn)
78587858 break;
78597859 case N32_OP6_ORI:
78607860 /* addi.gp */
7861- oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19));
7861+ oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), N32_BIT (19));
78627862 break;
78637863 }
78647864 break;
@@ -7872,11 +7872,11 @@ turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn)
78727872 break;
78737873 case N32_OP6_LHSI:
78747874 /* lhsi.gp */
7875- oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (18));
7875+ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), N32_BIT (18));
78767876 break;
78777877 case N32_OP6_SHI:
78787878 /* shi.gp */
7879- oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (19));
7879+ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), N32_BIT (19));
78807880 break;
78817881 }
78827882 break;
@@ -11319,7 +11319,7 @@ nds32_elf_relax_pltgot_suff (struct bfd_link_info *link_info, bfd *abfd,
1131911319 irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
1132011320 R_NDS32_PLT_GOTREL_LO19);
1132111321 /* addi.gp */
11322- insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19));
11322+ insn = N32_TYPE1 (SBGP, N32_RT5 (insn), N32_BIT (19));
1132311323 }
1132411324 else if (N32_OP6 (insn) == N32_OP6_JREG
1132511325 && N32_SUB5 (insn) == N32_JREG_JRAL)
@@ -11452,12 +11452,12 @@ nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd,
1145211452 ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA);
1145311453 break;
1145411454 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));
1145611456 irel->r_info =
1145711457 ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA);
1145811458 break;
1145911459 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));
1146111461 irel->r_info =
1146211462 ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA);
1146311463 break;
@@ -11468,7 +11468,7 @@ nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd,
1146811468 ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA);
1146911469 break;
1147011470 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));
1147211472 irel->r_info =
1147311473 ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA);
1147411474 break;
@@ -11478,7 +11478,7 @@ nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd,
1147811478 ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA);
1147911479 break;
1148011480 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));
1148211482 irel->r_info =
1148311483 ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA);
1148411484 break;
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
1+2017-09-06 Kamil Rytarowski <n54@gmx.com>
2+
3+ * opcode/nds32.h: Rename __BIT() to N32_BIT().
4+
15 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
26 Edmar Wienskoski <edmar.wienskoski@nxp.com
37
--- a/include/opcode/nds32.h
+++ b/include/opcode/nds32.h
@@ -50,8 +50,8 @@ static const int nds32_r54map[] ATTRIBUTE_UNUSED =
5050 -1, -1, -1, -1, -1, -1, -1, -1
5151 };
5252
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)
5555 #define __MF(v, off, bs) (((v) & __MASK (bs)) << (off))
5656 #define __GF(v, off, bs) (((v) >> off) & __MASK (bs))
5757 #define __SEXT(v, bs) ((((v) & ((1 << (bs)) - 1)) ^ (1 << ((bs) - 1))) - (1 << ((bs) - 1)))
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -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+
17 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
28
39 * i386-dis.c (last_active_prefix): Removed.
--- a/opcodes/nds32-asm.c
+++ b/opcodes/nds32-asm.c
@@ -212,8 +212,8 @@ const field_t operand_fields[] =
212212 {NULL, 0, 0, 0, 0, NULL}
213213 };
214214
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))
217217 #define RT(r) (r << 20)
218218 #define RA(r) (r << 15)
219219 #define RB(r) (r << 10)
@@ -252,29 +252,29 @@ struct nds32_opcode nds32_opcodes[] =
252252
253253 /* seg-DPREFI. */
254254 {"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},
256256 /* seg-LBGP. */
257257 {"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},
259259 /* seg-LWC/0. */
260260 {"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},
262262 /* seg-SWC/0. */
263263 {"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},
265265 /* seg-LDC/0. */
266266 {"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},
268268 /* seg-SDC/0. */
269269 {"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},
271271 /* seg-LSMW. */
272272 {"lmw", "%abdim %rt,[%ra],%re{,%enb4}", LSMW (LSMW), 4, ATTR_ALL, 0, NULL, 0, NULL},
273273 {"lmwa", "%abdim %rt,[%ra],%re{,%enb4}", LSMW (LSMWA), 4, ATTR_V3MEX_V2, 0, NULL, 0, NULL},
274274 {"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},
278278 /* seg-HWGP. */
279279 {"lhi.gp", "=rt,[+%i18s1]", OP6 (HWGP), 4, ATTR (GPREL) | ATTR_V2UP, USE_REG (29), NULL, 0, NULL},
280280 {"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[] =
284284
285285 /* seg-SBGP. */
286286 {"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},
288288 /* seg-JI. */
289289 {"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},
291291 /* seg-JREG. */
292292 {"jr", "%rb", JREG (JR), 4, ATTR (BRANCH) | ATTR_ALL, 0, NULL, 0, NULL},
293293 {"jral", "%rt,%rb", JREG (JRAL), 4, ATTR (BRANCH) | ATTR_ALL, 0, NULL, 0, NULL},
@@ -304,7 +304,7 @@ struct nds32_opcode nds32_opcodes[] =
304304 {"jral", "%dtiton %rb", JREG (JRAL) | RT (30), 4, ATTR (BRANCH) | ATTR_ALL, 0, NULL, 0, NULL},
305305 /* seg-BR1. */
306306 {"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},
308308 /* seg-BR2. */
309309 #define BR2(sub) (OP6 (BR2) | (N32_BR2_ ## sub << 16))
310310 {"ifcall", "%i16s1", BR2 (IFCALL), 4, ATTR (IFC_EXT), 0, NULL, 0, NULL},
@@ -318,7 +318,7 @@ struct nds32_opcode nds32_opcodes[] =
318318 {"bltzal", "%rt,%i16s1", BR2 (BLTZAL), 4, ATTR_PCREL | ATTR_ALL, 0, NULL, 0, NULL},
319319 /* seg-BR3. */
320320 {"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},
322322 /* seg-SIMD. */
323323 {"pbsad", "%rt,%ra,%rb", SIMD (PBSAD), 4, ATTR (PERF2_EXT), 0, NULL, 0, NULL},
324324 {"pbsada", "%rt,%ra,%rb", SIMD (PBSADA), 4, ATTR (PERF2_EXT), 0, NULL, 0, NULL},
@@ -392,22 +392,22 @@ struct nds32_opcode nds32_opcodes[] =
392392
393393 /* seg-ALU2_FFBI. */
394394 {"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},
396396 /* seg-ALU2_FLMISM. */
397397 {"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},
399399 /* seg-ALU2_MULSR64. */
400400 {"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},
402402 /* seg-ALU2_MULR64. */
403403 {"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},
405405 /* seg-ALU2_MADDR32. */
406406 {"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},
408408 /* seg-ALU2_MSUBR32. */
409409 {"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},
411411
412412 /* seg-MISC. */
413413 {"standby", "%stdby_st", MISC (STANDBY), 4, ATTR_ALL, 0, NULL, 0, NULL},
@@ -425,11 +425,11 @@ struct nds32_opcode nds32_opcodes[] =
425425 /* seg-MISC_MTSR. */
426426 {"mtsr", "%rt,%sr", MISC (MTSR), 4, ATTR_ALL, 0, NULL, 0, NULL},
427427 /* 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},
430430 /* 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},
433433 {"mfsr", "=rt,%ridx", MISC (MFSR), 4, ATTR_ALL, 0, NULL, 0, NULL},
434434 {"mtsr", "%rt,%ridx", MISC (MTSR), 4, ATTR_ALL, 0, NULL, 0, NULL},
435435 {"trap", "", MISC (TRAP), 4, ATTR_V3MEX_V1, 0, NULL, 0, NULL},
@@ -764,19 +764,19 @@ struct nds32_opcode nds32_opcodes[] =
764764 /* Saturation ext ISA. */
765765 {"kaddw", "=rt,%ra,%rb", ALU2 (KADD), 4, ATTR (SATURATION_EXT), 0, NULL, 0, NULL},
766766 {"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},
769769 {"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},
777777 {"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},
780780
781781 /* Audio ext. instructions. */
782782
--- a/opcodes/nds32-asm.h
+++ b/opcodes/nds32-asm.h
@@ -279,7 +279,7 @@ extern void nds32_asm_init (nds32_asm_desc_t *, int);
279279 #define ALU2(sub) (OP6 (ALU2) | N32_ALU2_ ## sub)
280280 #define MISC(sub) (OP6 (MISC) | N32_MISC_ ## sub)
281281 #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))
283283 #define FS1(sub) (OP6 (COP) | N32_FPU_FS1 | (N32_FPU_FS1_ ## sub << 6))
284284 #define FS1_F2OP(sub) (OP6 (COP) | N32_FPU_FS1 | (N32_FPU_FS1_F2OP << 6) \
285285 | (N32_FPU_FS1_F2OP_ ## sub << 10))
--- a/opcodes/nds32-dis.c
+++ b/opcodes/nds32-dis.c
@@ -759,10 +759,10 @@ nds32_mask_opcode (uint32_t insn)
759759 return MASK_OP (insn, 0);
760760 case N32_OP6_ALU2:
761761 /* FFBI */
762- if (__GF (insn, 0, 7) == (N32_ALU2_FFBI | __BIT (6)))
762+ if (__GF (insn, 0, 7) == (N32_ALU2_FFBI | N32_BIT (6)))
763763 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)))
766766 /* RDOV CLROV */
767767 return MASK_OP (insn, 0xf81ff);
768768 return MASK_OP (insn, 0x1ff);