public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] s390: Optionally print instruction description in disassembly
@ 2023-12-08 16:03 Jens Remus
  2023-12-08 16:03 ` [PATCH 1/2] s390: Fix build when using EXEEXT_FOR_BUILD Jens Remus
  2023-12-08 16:03 ` [PATCH 2/2] s390: Optionally print instruction description in disassembly Jens Remus
  0 siblings, 2 replies; 5+ messages in thread
From: Jens Remus @ 2023-12-08 16:03 UTC (permalink / raw)
  To: binutils; +Cc: Jens Remus, Andreas Krebbel, Nick Clifton

With this patch series the s390 disassembler optionally prints the
instruction descriptions as comment in the disassembly. This is enabled
by specifying the new s390-specific disassembler option "insndesc".

Patch 1 is a cleanup in the s390-mkopc build, that I stumbled upon.

Patch 2 allows to optionally print the instruction descriptions as
comments using s390-specific disassembler option "insndesc".

Example output:
$ objdump -d -M insndesc test
...
0000000000000620 <deregister_tm_clones>:
 620:   c0 10 00 00 0d 5c       larl    %r1,20d8 <__TMC_END__>  # load address relative long
 626:   c0 20 00 00 0d 59       larl    %r2,20d8 <__TMC_END__>  # load address relative long
 62c:   ec 12 00 0a 80 64       cgrje   %r1,%r2,640 <deregister_tm_clones+0x20> # compare and branch relative (64)
 632:   c4 18 00 00 0c d7       lgrl    %r1,1fe0 <_ITM_deregisterTMCloneTable@Base>     # load relative long (64)
 638:   ec 18 00 04 00 7c       cgije   %r1,0,640 <deregister_tm_clones+0x20>   # compare immediate and branch relative (64<8)
 63e:   07 f1                   br      %r1     # unconditional branch
 640:   07 fe                   br      %r14    # unconditional branch

Note that the readability can be enhanced by using a filter such as "expand":

$ objdump -d -M insndesc test | expand -t 8,16,24,32,40,80
...
0000000000000620 <deregister_tm_clones>:
 620:   c0 10 00 00 0d 5c       larl    %r1,20d8 <__TMC_END__>                  # load address relative long
 626:   c0 20 00 00 0d 59       larl    %r2,20d8 <__TMC_END__>                  # load address relative long
 62c:   ec 12 00 0a 80 64       cgrje   %r1,%r2,640 <deregister_tm_clones+0x20> # compare and branch relative (64)
 632:   c4 18 00 00 0c d7       lgrl    %r1,1fe0 <_ITM_deregisterTMCloneTable@Base> # load relative long (64)
 638:   ec 18 00 04 00 7c       cgije   %r1,0,640 <deregister_tm_clones+0x20>   # compare immediate and branch relative (64<8)
 63e:   07 f1                   br      %r1                                     # unconditional branch
 640:   07 fe                   br      %r14                                    # unconditional branch

Regards,
Jens

Jens Remus (2):
  s390: Fix build when using EXEEXT_FOR_BUILD
  s390: Optionally print instruction description in disassembly

 binutils/NEWS         |  5 ++++
 include/opcode/s390.h |  5 +++-
 opcodes/Makefile.am   |  7 +++--
 opcodes/Makefile.in   |  7 +++--
 opcodes/s390-dis.c    | 13 ++++++++-
 opcodes/s390-mkopc.c  | 18 ++++++++-----
 opcodes/s390-opc.c    | 62 +++++++++++++++++++++----------------------
 7 files changed, 73 insertions(+), 44 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] s390: Fix build when using EXEEXT_FOR_BUILD
  2023-12-08 16:03 [PATCH 0/2] s390: Optionally print instruction description in disassembly Jens Remus
@ 2023-12-08 16:03 ` Jens Remus
  2023-12-11 11:48   ` Nick Clifton
  2023-12-08 16:03 ` [PATCH 2/2] s390: Optionally print instruction description in disassembly Jens Remus
  1 sibling, 1 reply; 5+ messages in thread
From: Jens Remus @ 2023-12-08 16:03 UTC (permalink / raw)
  To: binutils; +Cc: Jens Remus, Andreas Krebbel, Nick Clifton

Suffix the s390-mkopc build utility executable file name with
EXEEXT_FOR_BUILD. Otherwise it cannot be located when building with
EXEEXT_FOR_BUILD. Use pattern used for other architecture build
utilities and compile and link s390-mkopc in two steps.

While at it also specify the dependencies of s390-mkopc.c.

opcodes/
	* Makefile.am: Add target to build s390-mkopc.o. Correct
	  target to build s390-mkopc$(EXEEXT_FOR_BUILD).
	* Makefile.in: Regenerate.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
---
 opcodes/Makefile.am | 7 +++++--
 opcodes/Makefile.in | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index 5804dd1ab38..ea264989509 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -570,8 +570,11 @@ opc2c$(EXEEXT_FOR_BUILD): opc2c.o $(BUILD_LIBS_DEPS)
 opc2c.o: opc2c.c $(INCDIR)/libiberty.h
 	$(AM_V_CC)$(COMPILE_FOR_BUILD) -c $(srcdir)/opc2c.c
 
-s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.c
-	$(AM_V_CCLD)$(COMPILE_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c
+s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.o
+	$(AM_V_CCLD)$(LINK_FOR_BUILD) s390-mkopc.o
+
+s390-mkopc.o: s390-mkopc.c $(INCDIR)/opcode/s390.h
+	$(COMPILE_FOR_BUILD) -c $(srcdir)/s390-mkopc.c
 
 s390-opc.tab: s390-mkopc$(EXEEXT_FOR_BUILD) s390-opc.txt
 	$(AM_V_GEN)./s390-mkopc$(EXEEXT_FOR_BUILD) < $(srcdir)/s390-opc.txt > s390-opc.tab
diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in
index e2c6e5a4374..7586b54fbd8 100644
--- a/opcodes/Makefile.in
+++ b/opcodes/Makefile.in
@@ -1548,8 +1548,11 @@ opc2c$(EXEEXT_FOR_BUILD): opc2c.o $(BUILD_LIBS_DEPS)
 opc2c.o: opc2c.c $(INCDIR)/libiberty.h
 	$(AM_V_CC)$(COMPILE_FOR_BUILD) -c $(srcdir)/opc2c.c
 
-s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.c
-	$(AM_V_CCLD)$(COMPILE_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c
+s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.o
+	$(AM_V_CCLD)$(LINK_FOR_BUILD) s390-mkopc.o
+
+s390-mkopc.o: s390-mkopc.c $(INCDIR)/opcode/s390.h
+	$(COMPILE_FOR_BUILD) -c $(srcdir)/s390-mkopc.c
 
 s390-opc.tab: s390-mkopc$(EXEEXT_FOR_BUILD) s390-opc.txt
 	$(AM_V_GEN)./s390-mkopc$(EXEEXT_FOR_BUILD) < $(srcdir)/s390-opc.txt > s390-opc.tab
-- 
2.40.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] s390: Optionally print instruction description in disassembly
  2023-12-08 16:03 [PATCH 0/2] s390: Optionally print instruction description in disassembly Jens Remus
  2023-12-08 16:03 ` [PATCH 1/2] s390: Fix build when using EXEEXT_FOR_BUILD Jens Remus
@ 2023-12-08 16:03 ` Jens Remus
  2023-12-11 11:52   ` Nick Clifton
  1 sibling, 1 reply; 5+ messages in thread
From: Jens Remus @ 2023-12-08 16:03 UTC (permalink / raw)
  To: binutils; +Cc: Jens Remus, Andreas Krebbel, Nick Clifton

Print instruction description as comment in disassembly with s390
architecture specific option "insndesc":

- For objdump it can be enabled with option "-M insndesc"
- In gdb it can be enabled with "set disassembler-options insndesc"

Since comments are not column aligned the output can enhanced for
readability by postprocessing using a filter such as "expand":

... | expand -t 8,16,24,32,40,80

Or when using in combination with objdump option --visualize-jumps:

... | expand | sed -e 's/ *#/\t#/' | expand -t 1,80

Note that the instruction descriptions add about 128 KB to s390-opc.o:

s390-opc.o without instruction descriptions: 216368 bytes
s390-opc.o with instruction descriptions   : 348432 bytes

binutils/
	* NEWS: Mention new s390-specific disassembler option
	  "insndesc".

include/
	* opcode/s390.h (struct s390_opcode): Add field to hold
	  instruction description.

opcodes/
	* s390-mkopc.c: Copy instruction description from s390-opc.txt
	  into generated operation code table s390-opc.tab.
	* s390-opc.c (s390_opformats): Provide NULL as description in
	  .insn pseudo-mnemonics opcode table.
	* s390-dis.c: Add s390 specific disassembler option "insndesc"
	  and optionally print the instruction description as comment in
	  the disassembly when it is specified.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
---
 binutils/NEWS         |  5 ++++
 include/opcode/s390.h |  5 +++-
 opcodes/s390-dis.c    | 13 ++++++++-
 opcodes/s390-mkopc.c  | 18 ++++++++-----
 opcodes/s390-opc.c    | 62 +++++++++++++++++++++----------------------
 5 files changed, 63 insertions(+), 40 deletions(-)

diff --git a/binutils/NEWS b/binutils/NEWS
index 73df7053be4..35b84e62b95 100644
--- a/binutils/NEWS
+++ b/binutils/NEWS
@@ -19,6 +19,11 @@
 
 * objdump --visualize-jumps is now supported on s390 architecture.
 
+* The s390 disassembly now optionally includes the instruction description as
+  comment with the s390-specific disassembler option "insndesc":
+  - For objdump it can be enabled with "objdump -M insndesc ...".
+  - In gdb it can be enabled with "set disassembler-options insndesc".
+
 Changes in 2.41:
 
 * The MIPS port now supports the Sony Interactive Entertainment Allegrex
diff --git a/include/opcode/s390.h b/include/opcode/s390.h
index d540e1dfd00..319bfe2d629 100644
--- a/include/opcode/s390.h
+++ b/include/opcode/s390.h
@@ -81,7 +81,7 @@ enum s390_opcode_cpu_val
 
 struct s390_opcode
   {
-    /* The opcode name.  */
+    /* The opcode name (mnemonic).  */
     const char * name;
 
     /* The opcode itself.  Those bits which will be filled in with
@@ -110,6 +110,9 @@ struct s390_opcode
 
     /* Instruction specific flags.  */
     unsigned int flags;
+
+    /* Instruction description.  */
+    const char * description;
   };
 
 /* The table itself is sorted by major opcode number, and is otherwise
diff --git a/opcodes/s390-dis.c b/opcodes/s390-dis.c
index 8c8a98c4e24..fca965fbb5d 100644
--- a/opcodes/s390-dis.c
+++ b/opcodes/s390-dis.c
@@ -31,6 +31,7 @@
 static int opc_index[256];
 static int current_arch_mask = 0;
 static int option_use_insn_len_bits_p = 0;
+static int option_print_insn_desc = 0;
 
 typedef struct
 {
@@ -43,7 +44,8 @@ static const s390_options_t options[] =
   { "esa" ,       N_("Disassemble in ESA architecture mode") },
   { "zarch",      N_("Disassemble in z/Architecture mode") },
   { "insnlength", N_("Print unknown instructions according to "
-		     "length from first two bits") }
+		     "length from first two bits") },
+  { "insndesc",   N_("Print instruction description as comment") },
 };
 
 /* Set up index table for first opcode byte.  */
@@ -63,6 +65,7 @@ disassemble_init_s390 (struct disassemble_info *info)
 
   current_arch_mask = 1 << S390_OPCODE_ZARCH;
   option_use_insn_len_bits_p = 0;
+  option_print_insn_desc = 0;
 
   for (p = info->disassembler_options; p != NULL; )
     {
@@ -72,6 +75,8 @@ disassemble_init_s390 (struct disassemble_info *info)
 	current_arch_mask = 1 << S390_OPCODE_ZARCH;
       else if (startswith (p, "insnlength"))
 	option_use_insn_len_bits_p = 1;
+      else if (startswith (p, "insndesc"))
+	option_print_insn_desc = 1;
       else
 	/* xgettext:c-format */
 	opcodes_error_handler (_("unknown S/390 disassembler option: %s"), p);
@@ -311,6 +316,12 @@ s390_print_insn_with_opcode (bfd_vma memaddr,
       else
 	separator = ',';
     }
+
+  /* Optional: instruction name.  */
+  if (option_print_insn_desc && opcode->description
+      && opcode->description[0] != '\0')
+    info->fprintf_styled_func (info->stream, dis_style_comment_start, "\t# %s",
+			       opcode->description);
 }
 
 /* Check whether opcode A's mask is more specific than that of B.  */
diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c
index 5f921ee0628..80ffe42978c 100644
--- a/opcodes/s390-mkopc.c
+++ b/opcodes/s390-mkopc.c
@@ -32,6 +32,7 @@ struct op_struct
     int   mode_bits;
     int   min_cpu;
     int   flags;
+    char  description[80];
 
     unsigned long long sort_value;
     int   no_nibbles;
@@ -53,7 +54,7 @@ createTable (void)
 
 static void
 insertOpcode (char *opcode, char *mnemonic, char *format,
-	      int min_cpu, int mode_bits, int flags)
+	      int min_cpu, int mode_bits, int flags, char* description)
 {
   char *str;
   unsigned long long sort_value;
@@ -98,6 +99,7 @@ insertOpcode (char *opcode, char *mnemonic, char *format,
   op_array[ix].min_cpu = min_cpu;
   op_array[ix].mode_bits = mode_bits;
   op_array[ix].flags = flags;
+  strcpy(op_array[ix].description, description);
   no_ops++;
 }
 
@@ -159,7 +161,7 @@ const struct s390_cond_ext_format s390_crb_extensions[NUM_CRB_EXTENSIONS] =
 
 static void
 insertExpandedMnemonic (char *opcode, char *mnemonic, char *format,
-			int min_cpu, int mode_bits, int flags)
+			int min_cpu, int mode_bits, int flags, char *description)
 {
   char *tag;
   char prefix[15];
@@ -172,7 +174,7 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format,
 
   if (!(tag = strpbrk (mnemonic, "*$")))
     {
-      insertOpcode (opcode, mnemonic, format, min_cpu, mode_bits, flags);
+      insertOpcode (opcode, mnemonic, format, min_cpu, mode_bits, flags, description);
       return;
     }
 
@@ -252,7 +254,7 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format,
       opcode[mask_start] = ext_table[i].nibble;
       strcat (new_mnemonic, ext_table[i].extension);
       strcat (new_mnemonic, suffix);
-      insertOpcode (opcode, new_mnemonic, format, min_cpu, mode_bits, flags);
+      insertOpcode (opcode, new_mnemonic, format, min_cpu, mode_bits, flags, description);
     }
   return;
 
@@ -273,7 +275,8 @@ static const char file_header[] =
   "   instruction which matches.\n"
   "   MODE_BITS - zarch or esa\n"
   "   MIN_CPU - number of the min cpu level required\n"
-  "   FLAGS - instruction flags.  */\n\n"
+  "   FLAGS - instruction flags.\n"
+  "   DESCRIPTION - description of the instruction.  */\n\n"
   "const struct s390_opcode s390_opcodes[] =\n  {\n";
 
 /* `dumpTable': write opcode table.  */
@@ -299,7 +302,8 @@ dumpTable (void)
 	      op_array[ix].format, op_array[ix].format);
       printf ("%i, ", op_array[ix].mode_bits);
       printf ("%i, ", op_array[ix].min_cpu);
-      printf ("%i}", op_array[ix].flags);
+      printf ("%i, ", op_array[ix].flags);
+      printf ("\"%s\" }", op_array[ix].description);
       if (ix < no_ops-1)
 	printf (",\n");
       else
@@ -452,7 +456,7 @@ main (void)
 	      str++;
 	  } while (*str != 0);
 	}
-      insertExpandedMnemonic (opcode, mnemonic, format, min_cpu, mode_bits, flag_bits);
+      insertExpandedMnemonic (opcode, mnemonic, format, min_cpu, mode_bits, flag_bits, description);
     }
 
   dumpTable ();
diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c
index cbfdb3df0b7..e44621a7479 100644
--- a/opcodes/s390-opc.c
+++ b/opcodes/s390-opc.c
@@ -774,37 +774,37 @@ unused_s390_operands_static_asserts (void)
 
 const struct s390_opcode s390_opformats[] =
   {
-  { "e",    OP8(0x00LL), MASK_E,	   INSTR_E,	      3,  0 ,0 },
-  { "ri",   OP8(0x00LL), MASK_RI_RI,	   INSTR_RI_RI,	      3,  0 ,0 },
-  { "rie",  OP8(0x00LL), MASK_RIE_RRP,	   INSTR_RIE_RRP,     3,  0 ,0 },
-  { "ril",  OP8(0x00LL), MASK_RIL_RP,	   INSTR_RIL_RP,      3,  0 ,0 },
-  { "rilu", OP8(0x00LL), MASK_RIL_RU,	   INSTR_RIL_RU,      3,  0 ,0 },
-  { "ris",  OP8(0x00LL), MASK_RIS_RURDI,   INSTR_RIS_RURDI,   3,  6 ,0 },
-  { "rr",   OP8(0x00LL), MASK_RR_RR,	   INSTR_RR_RR,       3,  0 ,0 },
-  { "rre",  OP8(0x00LL), MASK_RRE_RR,	   INSTR_RRE_RR,      3,  0 ,0 },
-  { "rrf",  OP8(0x00LL), MASK_RRF_RURR,	   INSTR_RRF_RURR,    3,  0 ,0 },
-  { "rrs",  OP8(0x00LL), MASK_RRS_RRRDU,   INSTR_RRS_RRRDU,   3,  6 ,0 },
-  { "rs",   OP8(0x00LL), MASK_RS_RRRD,	   INSTR_RS_RRRD,     3,  0 ,0 },
-  { "rse",  OP8(0x00LL), MASK_RSE_RRRD,	   INSTR_RSE_RRRD,    3,  0 ,0 },
-  { "rsi",  OP8(0x00LL), MASK_RSI_RRP,	   INSTR_RSI_RRP,     3,  0 ,0 },
-  { "rsy",  OP8(0x00LL), MASK_RSY_RRRD,	   INSTR_RSY_RRRD,    3,  3 ,0 },
-  { "rx",   OP8(0x00LL), MASK_RX_RRRD,	   INSTR_RX_RRRD,     3,  0 ,0 },
-  { "rxe",  OP8(0x00LL), MASK_RXE_RRRD,	   INSTR_RXE_RRRD,    3,  0 ,0 },
-  { "rxf",  OP8(0x00LL), MASK_RXF_RRRDR,   INSTR_RXF_RRRDR,   3,  0 ,0 },
-  { "rxy",  OP8(0x00LL), MASK_RXY_RRRD,	   INSTR_RXY_RRRD,    3,  3 ,0 },
-  { "s",    OP8(0x00LL), MASK_S_RD,	   INSTR_S_RD,	      3,  0 ,0 },
-  { "si",   OP8(0x00LL), MASK_SI_URD,	   INSTR_SI_URD,      3,  0 ,0 },
-  { "siy",  OP8(0x00LL), MASK_SIY_URD,	   INSTR_SIY_URD,     3,  3 ,0 },
-  { "sil",  OP8(0x00LL), MASK_SIL_RDI,     INSTR_SIL_RDI,     3,  6 ,0 },
-  { "ss",   OP8(0x00LL), MASK_SS_RRRDRD,   INSTR_SS_RRRDRD,   3,  0 ,0 },
-  { "sse",  OP8(0x00LL), MASK_SSE_RDRD,	   INSTR_SSE_RDRD,    3,  0 ,0 },
-  { "ssf",  OP8(0x00LL), MASK_SSF_RRDRD,   INSTR_SSF_RRDRD,   3,  0 ,0 },
-  { "vrv",  OP8(0x00LL), MASK_VRV_VVXRDU,  INSTR_VRV_VVXRDU,  3,  9 ,0 },
-  { "vri",  OP8(0x00LL), MASK_VRI_VVUUU,   INSTR_VRI_VVUUU,   3,  9 ,0 },
-  { "vrx",  OP8(0x00LL), MASK_VRX_VRRDU,   INSTR_VRX_VRRDU,   3,  9 ,0 },
-  { "vrs",  OP8(0x00LL), MASK_VRS_RVRDU,   INSTR_VRS_RVRDU,   3,  9 ,0 },
-  { "vrr",  OP8(0x00LL), MASK_VRR_VVV0UUU, INSTR_VRR_VVV0UUU, 3,  9 ,0 },
-  { "vsi",  OP8(0x00LL), MASK_VSI_URDV,	   INSTR_VSI_URDV,    3, 10 ,0 },
+  { "e",    OP8(0x00LL), MASK_E,	   INSTR_E,	      3,  0, 0, NULL },
+  { "ri",   OP8(0x00LL), MASK_RI_RI,	   INSTR_RI_RI,	      3,  0, 0, NULL },
+  { "rie",  OP8(0x00LL), MASK_RIE_RRP,	   INSTR_RIE_RRP,     3,  0, 0, NULL },
+  { "ril",  OP8(0x00LL), MASK_RIL_RP,	   INSTR_RIL_RP,      3,  0, 0, NULL },
+  { "rilu", OP8(0x00LL), MASK_RIL_RU,	   INSTR_RIL_RU,      3,  0, 0, NULL },
+  { "ris",  OP8(0x00LL), MASK_RIS_RURDI,   INSTR_RIS_RURDI,   3,  6, 0, NULL },
+  { "rr",   OP8(0x00LL), MASK_RR_RR,	   INSTR_RR_RR,       3,  0, 0, NULL },
+  { "rre",  OP8(0x00LL), MASK_RRE_RR,	   INSTR_RRE_RR,      3,  0, 0, NULL },
+  { "rrf",  OP8(0x00LL), MASK_RRF_RURR,	   INSTR_RRF_RURR,    3,  0, 0, NULL },
+  { "rrs",  OP8(0x00LL), MASK_RRS_RRRDU,   INSTR_RRS_RRRDU,   3,  6, 0, NULL },
+  { "rs",   OP8(0x00LL), MASK_RS_RRRD,	   INSTR_RS_RRRD,     3,  0, 0, NULL },
+  { "rse",  OP8(0x00LL), MASK_RSE_RRRD,	   INSTR_RSE_RRRD,    3,  0, 0, NULL },
+  { "rsi",  OP8(0x00LL), MASK_RSI_RRP,	   INSTR_RSI_RRP,     3,  0, 0, NULL },
+  { "rsy",  OP8(0x00LL), MASK_RSY_RRRD,	   INSTR_RSY_RRRD,    3,  3, 0, NULL },
+  { "rx",   OP8(0x00LL), MASK_RX_RRRD,	   INSTR_RX_RRRD,     3,  0, 0, NULL },
+  { "rxe",  OP8(0x00LL), MASK_RXE_RRRD,	   INSTR_RXE_RRRD,    3,  0, 0, NULL },
+  { "rxf",  OP8(0x00LL), MASK_RXF_RRRDR,   INSTR_RXF_RRRDR,   3,  0, 0, NULL },
+  { "rxy",  OP8(0x00LL), MASK_RXY_RRRD,	   INSTR_RXY_RRRD,    3,  3, 0, NULL },
+  { "s",    OP8(0x00LL), MASK_S_RD,	   INSTR_S_RD,	      3,  0, 0, NULL },
+  { "si",   OP8(0x00LL), MASK_SI_URD,	   INSTR_SI_URD,      3,  0, 0, NULL },
+  { "siy",  OP8(0x00LL), MASK_SIY_URD,	   INSTR_SIY_URD,     3,  3, 0, NULL },
+  { "sil",  OP8(0x00LL), MASK_SIL_RDI,     INSTR_SIL_RDI,     3,  6, 0, NULL },
+  { "ss",   OP8(0x00LL), MASK_SS_RRRDRD,   INSTR_SS_RRRDRD,   3,  0, 0, NULL },
+  { "sse",  OP8(0x00LL), MASK_SSE_RDRD,	   INSTR_SSE_RDRD,    3,  0, 0, NULL },
+  { "ssf",  OP8(0x00LL), MASK_SSF_RRDRD,   INSTR_SSF_RRDRD,   3,  0, 0, NULL },
+  { "vrv",  OP8(0x00LL), MASK_VRV_VVXRDU,  INSTR_VRV_VVXRDU,  3,  9, 0, NULL },
+  { "vri",  OP8(0x00LL), MASK_VRI_VVUUU,   INSTR_VRI_VVUUU,   3,  9, 0, NULL },
+  { "vrx",  OP8(0x00LL), MASK_VRX_VRRDU,   INSTR_VRX_VRRDU,   3,  9, 0, NULL },
+  { "vrs",  OP8(0x00LL), MASK_VRS_RVRDU,   INSTR_VRS_RVRDU,   3,  9, 0, NULL },
+  { "vrr",  OP8(0x00LL), MASK_VRR_VVV0UUU, INSTR_VRR_VVV0UUU, 3,  9, 0, NULL },
+  { "vsi",  OP8(0x00LL), MASK_VSI_URDV,	   INSTR_VSI_URDV,    3, 10, 0, NULL },
 };
 
 const int s390_num_opformats =
-- 
2.40.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] s390: Fix build when using EXEEXT_FOR_BUILD
  2023-12-08 16:03 ` [PATCH 1/2] s390: Fix build when using EXEEXT_FOR_BUILD Jens Remus
@ 2023-12-11 11:48   ` Nick Clifton
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Clifton @ 2023-12-11 11:48 UTC (permalink / raw)
  To: Jens Remus, binutils; +Cc: Andreas Krebbel

Hi Jens,

> opcodes/
> 	* Makefile.am: Add target to build s390-mkopc.o. Correct
> 	  target to build s390-mkopc$(EXEEXT_FOR_BUILD).
> 	* Makefile.in: Regenerate.

This patch is approved.  Please apply either now, or with the rest
of the series.

Cheers
   Nick



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] s390: Optionally print instruction description in disassembly
  2023-12-08 16:03 ` [PATCH 2/2] s390: Optionally print instruction description in disassembly Jens Remus
@ 2023-12-11 11:52   ` Nick Clifton
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Clifton @ 2023-12-11 11:52 UTC (permalink / raw)
  To: Jens Remus, binutils; +Cc: Andreas Krebbel

Hi Jens,

> Print instruction description as comment in disassembly with s390
> architecture specific option "insndesc":

Please could you make one change and, optionally, add one extra feature:


>       int   flags;
> +    char  description[80];

Please could you replace "80" with a #define'd constant, eg MAX_DESC_LEN
and then...


>     op_array[ix].mode_bits = mode_bits;
>     op_array[ix].flags = flags;
> +  strcpy(op_array[ix].description, description);
>     no_ops++;

Use strncpy to ensure that the field is not overwritten by a erroneously
large description.


The optional extra feature is a new test case in the gas testsuite that
makes sure that the new feature actually works... :-)

Cheers
   Nick


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-11 11:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08 16:03 [PATCH 0/2] s390: Optionally print instruction description in disassembly Jens Remus
2023-12-08 16:03 ` [PATCH 1/2] s390: Fix build when using EXEEXT_FOR_BUILD Jens Remus
2023-12-11 11:48   ` Nick Clifton
2023-12-08 16:03 ` [PATCH 2/2] s390: Optionally print instruction description in disassembly Jens Remus
2023-12-11 11:52   ` Nick Clifton

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).