* [committed 0/2] MIPS/opcodes: INSN_* flag clean-ups
@ 2024-06-13 13:03 Maciej W. Rozycki
2024-06-13 13:03 ` [committed 1/2] MIPS/opcodes: Update INSN_CHIP_MASK for INSN_ALLEGREX Maciej W. Rozycki
2024-06-13 13:03 ` [committed 2/2] MIPS/opcodes: Rework INSN_* flags into a consistent block Maciej W. Rozycki
0 siblings, 2 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2024-06-13 13:03 UTC (permalink / raw)
To: binutils
Hi,
This is a mini patch series to clean up INSN_* flags in opcodes, inspired
by a missed INSN_CHIP_MASK update for the recent Sony Allegrex addition.
They are our internal definitions, so we can rearrange them as we see fit.
Regtested across 100 MIPS targets. Committed.
Maciej
^ permalink raw reply [flat|nested] 3+ messages in thread
* [committed 1/2] MIPS/opcodes: Update INSN_CHIP_MASK for INSN_ALLEGREX
2024-06-13 13:03 [committed 0/2] MIPS/opcodes: INSN_* flag clean-ups Maciej W. Rozycki
@ 2024-06-13 13:03 ` Maciej W. Rozycki
2024-06-13 13:03 ` [committed 2/2] MIPS/opcodes: Rework INSN_* flags into a consistent block Maciej W. Rozycki
1 sibling, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2024-06-13 13:03 UTC (permalink / raw)
To: binutils
From: Maciej W. Rozycki <macro@redhat.com>
An update has been missed with commit df18f71b565c ("Add MIPS Allegrex
CPU as a MIPS2-based CPU") for INSN_CHIP_MASK to include INSN_ALLEGREX.
Fix it.
---
include/opcode/mips.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
binutils-mips-opcodes-chip-mask-allegrex.diff
Index: binutils-gdb/include/opcode/mips.h
===================================================================
--- binutils-gdb.orig/include/opcode/mips.h
+++ binutils-gdb/include/opcode/mips.h
@@ -1225,7 +1225,7 @@ static const unsigned int mips_isa_table
#undef ISAF
/* Masks used for Chip specific instructions. */
-#define INSN_CHIP_MASK 0xc7ff4f60
+#define INSN_CHIP_MASK 0xcfff4f60
/* Cavium Networks Octeon instructions. */
#define INSN_OCTEON 0x00000800
^ permalink raw reply [flat|nested] 3+ messages in thread
* [committed 2/2] MIPS/opcodes: Rework INSN_* flags into a consistent block
2024-06-13 13:03 [committed 0/2] MIPS/opcodes: INSN_* flag clean-ups Maciej W. Rozycki
2024-06-13 13:03 ` [committed 1/2] MIPS/opcodes: Update INSN_CHIP_MASK for INSN_ALLEGREX Maciej W. Rozycki
@ 2024-06-13 13:03 ` Maciej W. Rozycki
1 sibling, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2024-06-13 13:03 UTC (permalink / raw)
To: binutils
From: Maciej W. Rozycki <macro@redhat.com>
For historic reasons we have ended up with a random set of discontiguous
bit assignments for INSN_* flags within `membership' and `exclusions'
members of `mips_opcode'. Some of the bits were previously used for ASE
assignments and have been reused in a disorganised fashion since `ase'
has been split off as a member on its own. It makes them hard to track
and maintain, and to see how many we still have available for future
assignments.
Therefore reorder the flags using consecutive bits and matching the
order used with the switch statement in `cpu_is_member'.
---
include/opcode/mips.h | 53 +++++++++++++++++++++++---------------------------
1 file changed, 25 insertions(+), 28 deletions(-)
binutils-mips-opcodes-chip-mask-reorder.diff
Index: binutils-gdb/include/opcode/mips.h
===================================================================
--- binutils-gdb.orig/include/opcode/mips.h
+++ binutils-gdb/include/opcode/mips.h
@@ -1142,7 +1142,7 @@ mips_opcode_32bit_p (const struct mips_o
they were introduced in. INSN_ISA_MASK masks an enumeration that
specifies the base ISA level(s). The remainder of a 32-bit
word constructed using these macros is a bitmask of the remaining
- INSN_* values below. */
+ INSN_* values below, as indicated by INSN_CHIP_MASK. */
#define INSN_ISA_MASK 0x0000001ful
@@ -1225,48 +1225,45 @@ static const unsigned int mips_isa_table
#undef ISAF
/* Masks used for Chip specific instructions. */
-#define INSN_CHIP_MASK 0xcfff4f60
-
-/* Cavium Networks Octeon instructions. */
-#define INSN_OCTEON 0x00000800
-#define INSN_OCTEONP 0x00000200
-#define INSN_OCTEON2 0x00000100
-#define INSN_OCTEON3 0x00000040
-
-/* MIPS R5900 instruction */
-#define INSN_5900 0x00004000
+#define INSN_CHIP_MASK 0x01ffffe0
/* MIPS R4650 instruction. */
-#define INSN_4650 0x00010000
+#define INSN_4650 0x00000020
/* LSI R4010 instruction. */
-#define INSN_4010 0x00020000
+#define INSN_4010 0x00000040
/* NEC VR4100 instruction. */
-#define INSN_4100 0x00040000
+#define INSN_4100 0x00000080
/* Toshiba R3900 instruction. */
-#define INSN_3900 0x00080000
+#define INSN_3900 0x00000100
/* MIPS R10000 instruction. */
-#define INSN_10000 0x00100000
+#define INSN_10000 0x00000200
/* Broadcom SB-1 instruction. */
-#define INSN_SB1 0x00200000
+#define INSN_SB1 0x00000400
/* NEC VR4111/VR4181 instruction. */
-#define INSN_4111 0x00400000
+#define INSN_4111 0x00000800
/* NEC VR4120 instruction. */
-#define INSN_4120 0x00800000
+#define INSN_4120 0x00001000
/* NEC VR5400 instruction. */
-#define INSN_5400 0x01000000
+#define INSN_5400 0x00002000
/* NEC VR5500 instruction. */
-#define INSN_5500 0x02000000
-
+#define INSN_5500 0x00004000
+/* MIPS R5900 instruction. */
+#define INSN_5900 0x00008000
/* ST Microelectronics Loongson 2E. */
-#define INSN_LOONGSON_2E 0x40000000
+#define INSN_LOONGSON_2E 0x00010000
/* ST Microelectronics Loongson 2F. */
-#define INSN_LOONGSON_2F 0x80000000
-/* RMI Xlr instruction */
-#define INSN_XLR 0x00000020
+#define INSN_LOONGSON_2F 0x00020000
+/* Cavium Networks Octeon instructions. */
+#define INSN_OCTEON 0x00040000
+#define INSN_OCTEONP 0x00080000
+#define INSN_OCTEON2 0x00100000
+#define INSN_OCTEON3 0x00200000
+/* RMI XLR instruction. */
+#define INSN_XLR 0x00400000
/* Imagination interAptiv MR2. */
-#define INSN_INTERAPTIV_MR2 0x04000000
+#define INSN_INTERAPTIV_MR2 0x00800000
/* Sony PSP Allegrex instruction. */
-#define INSN_ALLEGREX 0x08000000
+#define INSN_ALLEGREX 0x01000000
/* DSP ASE */
#define ASE_DSP 0x00000001
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-13 13:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-13 13:03 [committed 0/2] MIPS/opcodes: INSN_* flag clean-ups Maciej W. Rozycki
2024-06-13 13:03 ` [committed 1/2] MIPS/opcodes: Update INSN_CHIP_MASK for INSN_ALLEGREX Maciej W. Rozycki
2024-06-13 13:03 ` [committed 2/2] MIPS/opcodes: Rework INSN_* flags into a consistent block Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).