From: Aurelien Jarno <aurelien@aurel32.net>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH 08/35] s390: Update disassembler to the last GPLv2 from binutils.
Date: Thu, 10 Jun 2010 00:47:28 +0200 [thread overview]
Message-ID: <20100609224728.GC3008@ohm.aurel32.net> (raw)
In-Reply-To: <1275678883-7082-9-git-send-email-rth@twiddle.net>
On Fri, Jun 04, 2010 at 12:14:16PM -0700, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> s390-dis.c | 81 +++++++++++++++++++++++++++++++++++++-----------------------
> 1 files changed, 50 insertions(+), 31 deletions(-)
Thanks, applied.
> diff --git a/s390-dis.c b/s390-dis.c
> index 86dd84f..3d96be0 100644
> --- a/s390-dis.c
> +++ b/s390-dis.c
> @@ -1,3 +1,4 @@
> +/* opcodes/s390-dis.c revision 1.12 */
> /* s390-dis.c -- Disassemble S390 instructions
> Copyright 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
> Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
> @@ -15,11 +16,14 @@
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> - along with this program; if not, see <http://www.gnu.org/licenses/>. */
> + along with this program; if not, write to the Free Software
> + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
> + 02110-1301, USA. */
>
> -#include <stdio.h>
> +#include "qemu-common.h"
> #include "dis-asm.h"
>
> +/* include/opcode/s390.h revision 1.9 */
> /* s390.h -- Header file for S390 opcode table
> Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
> Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
> @@ -37,7 +41,9 @@
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> - along with this program; if not, see <http://www.gnu.org/licenses/>. */
> + along with this program; if not, write to the Free Software
> + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
> + 02110-1301, USA. */
>
> #ifndef S390_H
> #define S390_H
> @@ -57,7 +63,8 @@ enum s390_opcode_cpu_val
> S390_OPCODE_Z900,
> S390_OPCODE_Z990,
> S390_OPCODE_Z9_109,
> - S390_OPCODE_Z9_EC
> + S390_OPCODE_Z9_EC,
> + S390_OPCODE_Z10
> };
>
> /* The opcode table is an array of struct s390_opcode. */
> @@ -95,12 +102,13 @@ struct s390_opcode
> /* The table itself is sorted by major opcode number, and is otherwise
> in the order in which the disassembler should consider
> instructions. */
> -extern const struct s390_opcode s390_opcodes[];
> -extern const int s390_num_opcodes;
> +/* QEMU: Mark these static. */
> +static const struct s390_opcode s390_opcodes[];
> +static const int s390_num_opcodes;
>
> /* A opcode format table for the .insn pseudo mnemonic. */
> -extern const struct s390_opcode s390_opformats[];
> -extern const int s390_num_opformats;
> +static const struct s390_opcode s390_opformats[];
> +static const int s390_num_opformats;
>
> /* Values defined for the flags field of a struct powerpc_opcode. */
>
> @@ -121,7 +129,7 @@ struct s390_operand
> /* Elements in the table are retrieved by indexing with values from
> the operands field of the powerpc_opcodes table. */
>
> -extern const struct s390_operand s390_operands[];
> +static const struct s390_operand s390_operands[];
>
> /* Values defined for the flags field of a struct s390_operand. */
>
> @@ -164,12 +172,13 @@ extern const struct s390_operand s390_operands[];
> the instruction may be optional. */
> #define S390_OPERAND_OPTIONAL 0x400
>
> - #endif /* S390_H */
> -
> +#endif /* S390_H */
>
> static int init_flag = 0;
> static int opc_index[256];
> -static int current_arch_mask = 0;
> +
> +/* QEMU: We've disabled the architecture check below. */
> +/* static int current_arch_mask = 0; */
>
> /* Set up index table for first opcode byte. */
>
> @@ -188,17 +197,21 @@ init_disasm (struct disassemble_info *info)
> (opcode[1].opcode[0] == opcode->opcode[0]))
> opcode++;
> }
> -// switch (info->mach)
> -// {
> -// case bfd_mach_s390_31:
> +
> +#ifdef QEMU_DISABLE
> + switch (info->mach)
> + {
> + case bfd_mach_s390_31:
> current_arch_mask = 1 << S390_OPCODE_ESA;
> -// break;
> -// case bfd_mach_s390_64:
> -// current_arch_mask = 1 << S390_OPCODE_ZARCH;
> -// break;
> -// default:
> -// abort ();
> -// }
> + break;
> + case bfd_mach_s390_64:
> + current_arch_mask = 1 << S390_OPCODE_ZARCH;
> + break;
> + default:
> + abort ();
> + }
> +#endif /* QEMU_DISABLE */
> +
> init_flag = 1;
> }
>
> @@ -297,9 +310,12 @@ print_insn_s390 (bfd_vma memaddr, struct disassemble_info *info)
> const struct s390_operand *operand;
> const unsigned char *opindex;
>
> +#ifdef QEMU_DISABLE
> /* Check architecture. */
> if (!(opcode->modes & current_arch_mask))
> continue;
> +#endif /* QEMU_DISABLE */
> +
> /* Check signature of the opcode. */
> if ((buffer[1] & opcode->mask[1]) != opcode->opcode[1]
> || (buffer[2] & opcode->mask[2]) != opcode->opcode[2]
> @@ -392,6 +408,8 @@ print_insn_s390 (bfd_vma memaddr, struct disassemble_info *info)
> return 1;
> }
> }
> +
> +/* opcodes/s390-opc.c revision 1.16 */
> /* s390-opc.c -- S390 opcode list
> Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
> Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
> @@ -409,9 +427,9 @@ print_insn_s390 (bfd_vma memaddr, struct disassemble_info *info)
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> - along with this program; if not, see <http://www.gnu.org/licenses/>. */
> -
> -#include <stdio.h>
> + along with this program; if not, write to the Free Software
> + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
> + 02110-1301, USA. */
>
> /* This file holds the S390 opcode table. The opcode table
> includes almost all of the extended instruction mnemonics. This
> @@ -427,7 +445,7 @@ print_insn_s390 (bfd_vma memaddr, struct disassemble_info *info)
> /* The operands table.
> The fields are bits, shift, insert, extract, flags. */
>
> -const struct s390_operand s390_operands[] =
> +static const struct s390_operand s390_operands[] =
> {
> #define UNUSED 0
> { 0, 0, 0 }, /* Indicates the end of the operand list */
> @@ -563,7 +581,7 @@ const struct s390_operand s390_operands[] =
> quite close.
>
> For example the instruction "mvo" is defined in the PoP as follows:
> -
> +
> MVO D1(L1,B1),D2(L2,B2) [SS]
>
> --------------------------------------
> @@ -739,7 +757,7 @@ const struct s390_operand s390_operands[] =
>
> /* The opcode formats table (blueprints for .insn pseudo mnemonic). */
>
> -const struct s390_opcode s390_opformats[] =
> +static const struct s390_opcode s390_opformats[] =
> {
> { "e", OP8(0x00LL), MASK_E, INSTR_E, 3, 0 },
> { "ri", OP8(0x00LL), MASK_RI_RI, INSTR_RI_RI, 3, 0 },
> @@ -765,9 +783,10 @@ const struct s390_opcode s390_opformats[] =
> { "ssf", OP8(0x00LL), MASK_SSF_RRDRD, INSTR_SSF_RRDRD,3, 0 },
> };
>
> -const int s390_num_opformats =
> +static const int s390_num_opformats =
> sizeof (s390_opformats) / sizeof (s390_opformats[0]);
>
> +/* include "s390-opc.tab" generated from opcodes/s390-opc.txt rev 1.17 */
> /* The opcode table. This file was generated by s390-mkopc.
>
> The format of the opcode table is:
> @@ -783,7 +802,7 @@ const int s390_num_opformats =
> The disassembler reads the table in order and prints the first
> instruction which matches. */
>
> -const struct s390_opcode s390_opcodes[] =
> +static const struct s390_opcode s390_opcodes[] =
> {
> { "dp", OP8(0xfdLL), MASK_SS_LLRDRD, INSTR_SS_LLRDRD, 3, 0},
> { "mp", OP8(0xfcLL), MASK_SS_LLRDRD, INSTR_SS_LLRDRD, 3, 0},
> @@ -1700,5 +1719,5 @@ const struct s390_opcode s390_opcodes[] =
> { "pr", OP16(0x0101LL), MASK_E, INSTR_E, 3, 0}
> };
>
> -const int s390_num_opcodes =
> +static const int s390_num_opcodes =
> sizeof (s390_opcodes) / sizeof (s390_opcodes[0]);
> --
> 1.7.0.1
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2010-06-09 22:47 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-04 19:14 [Qemu-devel] [PATCH 00/35] S390 TCG target, version 2 Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 01/35] tcg-s390: Adjust compilation flags Richard Henderson
2010-06-09 22:53 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 02/35] s390x: Avoid _llseek Richard Henderson
2010-06-09 22:54 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 03/35] s390x: Don't use a linker script for user-only Richard Henderson
2010-06-09 22:54 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 04/35] tcg-s390: Compute is_write in cpu_signal_handler Richard Henderson
2010-06-09 22:54 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 05/35] tcg-s390: Icache flush is a no-op Richard Henderson
2010-06-09 22:55 ` Aurelien Jarno
2010-06-10 22:04 ` Richard Henderson
2010-06-11 6:46 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 06/35] tcg-s390: Allocate the code_gen_buffer near the main program Richard Henderson
2010-06-09 22:59 ` Aurelien Jarno
2010-06-10 22:05 ` Richard Henderson
2010-06-11 7:31 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 07/35] tcg: Optionally sign-extend 32-bit arguments for 64-bit host Richard Henderson
2010-06-10 10:22 ` Aurelien Jarno
2010-06-10 22:08 ` Richard Henderson
2010-06-14 22:20 ` Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 08/35] s390: Update disassembler to the last GPLv2 from binutils Richard Henderson
2010-06-09 22:47 ` Aurelien Jarno [this message]
2010-06-04 19:14 ` [Qemu-devel] [PATCH 09/35] s390: Disassemble some general-instruction-extension insns Richard Henderson
2010-06-09 22:47 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 10/35] tcg-s390: New TCG target Richard Henderson
2010-06-10 10:24 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 11/35] tcg-s390: Tidy unimplemented opcodes Richard Henderson
2010-06-10 10:24 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 12/35] tcg-s390: Define TCG_TMP0 Richard Henderson
2010-06-10 10:25 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 13/35] tcg-s390: Tidy regset initialization; use R14 as temporary Richard Henderson
2010-06-10 10:26 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 14/35] tcg-s390: Rearrange register allocation order Richard Henderson
2010-06-10 10:26 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 15/35] tcg-s390: Query instruction extensions that are installed Richard Henderson
2010-06-10 10:28 ` Aurelien Jarno
2010-06-10 22:19 ` Richard Henderson
2010-06-11 8:06 ` Aurelien Jarno
2010-06-11 13:07 ` Richard Henderson
2010-06-12 11:57 ` Aurelien Jarno
2010-06-11 13:13 ` Richard Henderson
2010-06-13 10:49 ` Aurelien Jarno
2010-06-13 16:02 ` Richard Henderson
2010-06-13 16:44 ` Aurelien Jarno
2010-06-13 22:23 ` Alexander Graf
2010-06-14 16:20 ` Richard Henderson
2010-06-14 17:39 ` Alexander Graf
2010-06-04 19:14 ` [Qemu-devel] [PATCH 16/35] tcg-s390: Re-implement tcg_out_movi Richard Henderson
2010-06-12 12:04 ` Aurelien Jarno
2010-06-13 23:19 ` Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 17/35] tcg-s390: Implement sign and zero-extension operations Richard Henderson
2010-06-12 12:32 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 18/35] tcg-s390: Implement bswap operations Richard Henderson
2010-06-12 12:32 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 19/35] tcg-s390: Implement rotates Richard Henderson
2010-06-12 12:33 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 20/35] tcg-s390: Use LOAD COMPLIMENT for negate Richard Henderson
2010-06-12 12:33 ` Aurelien Jarno
2010-06-04 19:14 ` [Qemu-devel] [PATCH 21/35] tcg-s390: Use the ADD IMMEDIATE instructions Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 22/35] tcg-s390: Use the AND " Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 23/35] tcg-s390: Use the OR " Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 24/35] tcg-s390: Use the XOR " Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 25/35] tcg-s390: Use the MULTIPLY " Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 26/35] tcg-s390: Tidy goto_tb Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 27/35] tcg-s390: Rearrange qemu_ld/st to avoid register copy Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 28/35] tcg-s390: Tidy tcg_prepare_qemu_ldst Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 29/35] tcg-s390: Tidy user qemu_ld/st Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 30/35] tcg-s390: Implement GUEST_BASE Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 31/35] tcg-s390: Use 16-bit branches for forward jumps Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 32/35] tcg-s390: Use the LOAD AND TEST instruction for compares Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 33/35] tcg-s390: Use the COMPARE IMMEDIATE instrucions " Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 34/35] tcg-s390: Use COMPARE AND BRANCH instructions Richard Henderson
2010-06-04 19:14 ` [Qemu-devel] [PATCH 35/35] tcg-s390: Enable compile in 32-bit mode Richard Henderson
2010-06-08 13:11 ` [Qemu-devel] Re: [PATCH 00/35] S390 TCG target, version 2 Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100609224728.GC3008@ohm.aurel32.net \
--to=aurelien@aurel32.net \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.