public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@imgtec.com>
To: Andrew Bennett <Andrew.Bennett@imgtec.com>
Cc: Mike Frysinger <vapier@gentoo.org>,
	"gdb-patches@sourceware.org"	<gdb-patches@sourceware.org>,
	Steve Ellcey <sellcey@imgtec.com>
Subject: RE: [PATCH] Add micromips support to the MIPS simulator
Date: Tue, 12 Jan 2016 23:01:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.00.1601121840430.5958@tp.orcam.me.uk> (raw)
In-Reply-To: <0DA23CC379F5F945ACB41CF394B98277211271C5@LEMAIL01.le.imgtec.org>

Andrew,

On Fri, 25 Sep 2015, Andrew Bennett wrote:

> This has now been committed.  Once I did the committing I realised that
> I only have Binutils write access permissions.  Is this ok, or do I need
> to get GDB write access as well?

 While investigating PR 18964 I noticed your change (commit 8e394ffc) 
broke building for the mips-linux-gnu target, which does not enable the 
microMIPS instruction set:

gcc -DHAVE_CONFIG_H     -DPROFILE=1 -DWITH_PROFILE=-1  -DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31 -DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG  -DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=32 -DWITH_HW=0    -DWITH_RESERVED_BITS=1  -DWITH_SMP=0  -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wold-style-definition -Wformat-nonliteral    -DMIPS_MACH_DEFAULT=bfd_mach_mips8000   -I. -I.../sim/mips -I../common -I.../sim/mips/../common -I../../include -I.../sim/mips/../..//include -I../../bfd -I.../sim/mips/../..//bfd -I../../opcodes -I.../sim/mips/../..//opcodes  -pipe -O0 -g  -o run \
          nrun.o libsim.a ../../bfd/libbfd.a ../../opcodes/libopcodes.a  ../../libiberty/libiberty.a -lm -ldl -lnsl  -L../../zlib -lz
libsim.a(engine.o): In function `delayslot_micromips':
.../sim/mips/micromips.igen:49: undefined reference to `micromips_instruction_decode'
libsim.a(semantics.o): In function `delayslot_micromips':
.../sim/mips/micromips.igen:49: undefined reference to `micromips_instruction_decode'
libsim.a(idecode.o): In function `delayslot_micromips':
.../sim/mips/micromips.igen:49: undefined reference to `micromips_instruction_decode'
collect2: ld returned 1 exit status
make[2]: *** [run] Error 1

As a microMIPS engine is not included in a mips-linux-gnu build the file 
supposed to provide `micromips_instruction_decode' is not generated or 
compiled, whereas `delayslot_micromips' (and a bunch of other functions) 
is built unconditionally.

 Restricting the affected functions to microMIPS processors only has fixed 
the build problem for me, see the patch below.  I have not verified it 
further though, will you be able to look into it soon?

	sim/mips/
	* micromips.igen (delayslot_micromips): Enable for `micromips32',
	`micromips64' and `micromipsdsp' only.
	(process_isa_mode): Enable for `micromips32' and `micromips64'
	only.
	(do_micromips_jalr, do_micromips_jal): Likewise.
	(compute_movep_src_reg): Likewise.
	(compute_andi16_imm): Likewise.
	(convert_fmt_micromips): Likewise.
	(convert_fmt_micromips_cvt_d): Likewise.
	(convert_fmt_micromips_cvt_s): Likewise.

  Maciej

sim-umips-function-proc.diff
Index: gdb/sim/mips/micromips.igen
===================================================================
--- gdb.orig/sim/mips/micromips.igen	2016-01-12 22:29:38.000000000 +0000
+++ gdb/sim/mips/micromips.igen	2016-01-12 22:37:35.169972819 +0000
@@ -39,6 +39,9 @@
 :compute:::int:IMM_SHIFT_2BIT:IMMEDIATE:(IMMEDIATE << 2)
 
 :function:::address_word:delayslot_micromips:address_word target, address_word nia, int delayslot_instruction_size
+*micromips32:
+*micromips64:
+*micromipsdsp:
 {
   instruction_word delay_insn;
   sim_events_slip (SD, 1);
@@ -52,12 +55,16 @@
 }
 
 :function:::address_word:process_isa_mode:address_word target
+*micromips32:
+*micromips64:
 {
   SD->isa_mode = target & 0x1;
   return (target & (-(1 << 1)));
 }
 
 :function:::address_word:do_micromips_jalr:int rt, int rs, address_word nia, int delayslot_instruction_size
+*micromips32:
+*micromips64:
 {
   GPR[rt] = (nia + delayslot_instruction_size) | ISA_MODE_MICROMIPS;
   return (process_isa_mode (SD_,
@@ -65,6 +72,8 @@
 }
 
 :function:::address_word:do_micromips_jal:address_word target, address_word nia, int delayslot_instruction_size
+*micromips32:
+*micromips64:
 {
   RA = (nia + delayslot_instruction_size) | ISA_MODE_MICROMIPS;
   return delayslot_micromips (SD_, target, nia, delayslot_instruction_size);
@@ -72,6 +81,8 @@
 
 
 :function:::unsigned32:compute_movep_src_reg:int reg
+*micromips32:
+*micromips64:
 {
   switch(reg)
     {
@@ -88,6 +99,8 @@
 }
 
 :function:::unsigned32:compute_andi16_imm:int encoded_imm
+*micromips32:
+*micromips64:
 {
   switch (encoded_imm)
     {
@@ -112,6 +125,8 @@
 }
 
 :function:::FP_formats:convert_fmt_micromips:int fmt
+*micromips32:
+*micromips64:
 {
   switch (fmt)
     {
@@ -123,6 +138,8 @@
 }
 
 :function:::FP_formats:convert_fmt_micromips_cvt_d:int fmt
+*micromips32:
+*micromips64:
 {
   switch (fmt)
     {
@@ -135,6 +152,8 @@
 
 
 :function:::FP_formats:convert_fmt_micromips_cvt_s:int fmt
+*micromips32:
+*micromips64:
 {
   switch (fmt)
     {

  parent reply	other threads:[~2016-01-12 23:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 12:44 Andrew Bennett
2015-02-24  5:44 ` Mike Frysinger
2015-08-27 15:05   ` Andrew Bennett
2015-09-11 10:24     ` Andrew Bennett
2016-01-01  7:07       ` Joel Brobecker
2016-01-05 14:40         ` Andrew Bennett
2016-01-06  5:43           ` Joel Brobecker
2015-09-17  4:42     ` Mike Frysinger
2015-09-25 12:06       ` Andrew Bennett
2015-09-25 14:07         ` Mike Frysinger
2015-09-25 20:22           ` Andrew Bennett
2015-09-25 20:57             ` Mike Frysinger
2016-01-12 23:01             ` Maciej W. Rozycki [this message]
2016-01-15 16:22               ` Andrew Bennett
2016-01-15 17:45                 ` Mike Frysinger

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=alpine.DEB.2.00.1601121840430.5958@tp.orcam.me.uk \
    --to=macro@imgtec.com \
    --cc=Andrew.Bennett@imgtec.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sellcey@imgtec.com \
    --cc=vapier@gentoo.org \
    /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 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).