public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: binutils@sourceware.org,  Chao-ying Fu <fu@mips.com>,
	 Catherine Moore <clm@codesourcery.com>,
	 "Joseph S. Myers" <joseph@codesourcery.com>,
	 Daniel Jacobowitz <dan@codesourcery.com>
Subject: Re: [PATCH] MIPS: microMIPS and MCU ASE instruction set support
Date: Tue, 01 Jun 2010 22:04:00 -0000	[thread overview]
Message-ID: <87typmo1e6.fsf@firetop.home> (raw)
In-Reply-To: <alpine.DEB.1.10.1005302126240.5236@tp.orcam.me.uk> (Maciej	W. Rozycki's message of "Tue, 1 Jun 2010 15:19:24 +0100 (BST)")

"Maciej W. Rozycki" <macro@codesourcery.com> writes:
>> Generally looks good.  It would have been better to submit the
>> ACE, m14kc and microMIPS support as three separate changes though.
>> Please can you do that for the follow-up?
>
>  I have done it now; the next version will comprise microMIPS ASE changes 
> only (the MCU ASE adds to both the MIPS ISA and the microMIPS ASE, so it 
> should be applied on top of the microMIPS change).

Thanks.  Thanks too for all the issues that you've addressed already,
and for the ones you said you'd sort out.  Sounds like good progress!

>  Stricly speaking some changes, while related, can be split off too (e.g. 
> some MIPS16 or testsuite changes), so I'll look into separating them too 
> -- perhaps that'll make the thing rolling sooner.

Yeah, thanks, that'd be a help if it's easy to do.  It doesn't matter
too much, though.  Most of the MIPS16 changes were consistent with the
microMIPS ones, so were easy to review as a unit.

>> From a usability perspective, it's a shame that:
>> 
>> 	.set	micromips
>> 	.ent	foo
>> foo:
>> 	b	1f
>> 	nop
>> 	.end	foo
>> 	.ent	bar
>> bar:
>> 1:	nop
>> 	.end	bar
>> 
>> disassembles as:
>> 
>> 00000000 <foo>:
>>    0:   cfff            b       0 <foo>
>>                         0: R_MICROMIPS_PC10_S1  .L11
>>    2:   0c00            nop
>>    4:   0c00            nop
>> 
>> 00000006 <bar>:
>>    6:   0c00            nop
>> 
>> leaving the poor user with no idea what .L11 is.
>
>  Indeed.  This is a general limitation of `objdump' it would seem.  This 
> is no different to what you get with:
>
> $ cat b.s
> 	.globl	baz
> 	.ent	foo
> foo:
> 	b	baz
> 	nop
> 	.end	foo
> 	.ent	bar
> baz:
> bar:
> 1:	nop
> 	.end	bar
> $ mips-sde-elf-objdump -dr b.o
>
> b.o:     file format elf32-tradbigmips
>
>
> Disassembly of section .text:
>
> 00000000 <foo>:
>    0:	1000ffff 	b	0 <foo>
> 			0: R_MIPS_PC16	baz
>    4:	00000000 	nop
>    8:	00000000 	nop
>
> 0000000c <bar>:
>    c:	00000000 	nop

Well, it's a little different.  The user has at least defined two
named symbols in this case, so they have a good chance of knowing
what "baz" means.  In the microMIPS case we've invented a label
and are using it in preference to the user-defined one.

> I'd just recommend peeking at the symbol table (back to the first 
> program):
>
> $ mips-sde-elf-objdump -t b.o
>
> b.o:     file format elf32-tradbigmips
>
> SYMBOL TABLE:
> 00000000 l    d  .text	00000000 .text
> 00000000 l    d  .data	00000000 .data
> 00000000 l    d  .bss	00000000 .bss
> 00000000 l    d  .reginfo	00000000 .reginfo
> 00000000 l    d  .pdr	00000000 .pdr
> 00000000 l     F .text	00000006 0x80 foo
> 00000006 l     F .text	00000002 0x80 bar
> 00000006 l       .text	00000000 0x80 .L1\x021

I suppose having a symbol with ^B in it is less than ideal too.
AIUI that name was chosen specifically because it wasn't supposed
to be written out.

It would be especially confusing if the user or compiler had a ".L11"
label (without the ^B).

>> The following:
>> 
>> 	.set	micromips
>> 	.ent	foo
>> foo:
>> 	ld	$10,0x1000($11)
>> 	.end	foo
>> 
>> generates an assertion failure:
>> 
>> Assertion failure in micromips_macro_build at gas/config/tc-mips.c line 19466.
>> Please report this bug.
>> 
>> on mipsisa64-elf with "-mips1 -mabi=32".
>
>  I can't reproduce it, sorry:
> [...]
>  Can you debug it and see what the relocation type is that's causing it?  
> I wonder if that might be related to the varargs issue you referring to 
> below and depend on the host architecture, hmm...

Yeah, you're right, sorry.  I forgot to mention that in the later reviews.
This was with a x86_64-linux-gnu host and a botched attempt at working
around the varags issue.  (I probably just added -Wno-error or something,
I can't remember now.)

I switched to a 32-bit host for parts 2 and 3 of the review, and yeah,
it doesn't reproduce there.

>> > gas/
>> > 2010-05-18  Chao-ying Fu  <fu@mips.com>
>> >             Maciej W. Rozycki  <macro@codesourcery.com>
>> >             Daniel Jacobowitz  <dan@codesourcery.com>
>> >
>> > 	* config/tc-mips.h (mips_segment_info): Add one bit for
>> > 	microMIPS.
>> > 	* config/tc-mips.c
>> 
>> How about having something like:
>> 
>>   #define OOD_TEXT_LABELS (mips_opts.mips16 || mips_opts.micromips)
>> 
>> ?
>
>  It sounds reasonable to me, except that condition is used in some other 
> contexts as well.  I have made it HAVE_CODE_COMPRESSION thus and took the 
> opportunity to optimise code around mips16_micromips_mark_labels() too.  
> Finally I have renamed the function to mips_compressed_mark_labels() for 
> as the other sounds too complicated to me.

All these changes sound good, thanks.

>> > 	(append_insn): Handle microMIPS.
>> 
>> +  if (mips_opts.micromips)
>> +    {
>> +      if ((prev_pinfo2 & INSN2_BRANCH_DELAY_16BIT)
>> +	  && !is_micromips_16bit_p (ip->insn_mo))
>> +	as_warn (_("instruction with wrong size in a branch delay slot that"
>> +		   " requires a 16-bit instruction"));
>> +      if ((prev_pinfo2 & INSN2_BRANCH_DELAY_32BIT)
>> +	  && !is_micromips_32bit_p (ip->insn_mo))
>> +	as_warn (_("instruction with wrong size in a branch delay slot that"
>> +		   " requires a 32-bit instruction"));
>> +    }
>> +  
>> 
>> Although not enforced as often as it should be, GAS convention is for
>> errors to start with a capital letter.
>
>  I'll be fixing these up as I come across them.  If to be effective, then 
> upstream HEAD should be fixed up or otherwise people have no way not to 
> get confused.  I didn't know of this rule for one.  That shouldn't be a 
> lot effort, should it?

Nope.  It's just a question of time and priorities. ;-)

>  Some have to stay for now actually, because .l testsuite patterns are 
> commonly shared between standard MIPS and microMIPS tests, and should be 
> fixed separately.

OK, that's fine.

>> +      if (pinfo & INSN_COP)
>> +	{
>> +	  /* We don't keep enough information to sort these cases out.
>> +	     The itbl support does keep this information however, although
>> +	     we currently don't support itbl fprmats as part of the cop
>> +	     instruction.  May want to add this support in the future.  */
>> +	}
>> 
>> Assert?
>
>  Well, that's no different to the standard MIPS variant.

OK, fair enough, but I suppose I was judging the new code on its merits
as new code.  Sticking to existing practice is an easier sell if the
code that implements it is being reused rather than copied...

>> +do_lsb:
>> 
>> Not properly indented.  A few other instances.
>
>  Like the respective originals in mips_ip().  I have fixed up the new 
> labels, but upstream HEAD code should be adjusted the same way.

Thanks.  Yeah, sorting out the new code is all that's needed.
As before, I was judging the code on its own merits rather than
checking whether each dubious bit was new or from cut-&-paste.

It'll be a while before I have chance to go through the update
properly, but it looks good at first glance.

Richard

  parent reply	other threads:[~2010-06-01 22:04 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18 18:19 Maciej W. Rozycki
2010-05-23 21:38 ` Richard Sandiford
2010-05-24 22:25   ` Fu, Chao-Ying
2010-05-26 19:47     ` Richard Sandiford
2010-06-01 14:21   ` Maciej W. Rozycki
2010-06-01 14:39     ` Catherine Moore
2010-06-01 22:04     ` Richard Sandiford [this message]
2010-06-01 22:47     ` Fu, Chao-Ying
2010-06-05  9:17     ` Richard Sandiford
2010-07-26 10:56   ` [PATCH] MIPS: microMIPS ASE support Maciej W. Rozycki
2010-07-26 13:25     ` Nathan Froyd
2010-07-26 13:53       ` Maciej W. Rozycki
2010-07-26 19:03     ` Richard Sandiford
2010-12-07  1:13       ` Maciej W. Rozycki
2010-12-12 14:59         ` Richard Sandiford
2010-12-14 13:30           ` Maciej W. Rozycki
2010-12-14 14:51             ` Richard Sandiford
2010-12-16 11:54               ` Maciej W. Rozycki
2010-12-18 10:26                 ` Richard Sandiford
2010-12-14 17:56             ` Joseph S. Myers
2010-12-16 15:28               ` Maciej W. Rozycki
2010-12-17 20:56             ` Fu, Chao-Ying
2010-12-18 10:09               ` Richard Sandiford
2011-01-02 11:36         ` Richard Sandiford
2011-02-21 15:35           ` Maciej W. Rozycki
2011-02-22 20:12             ` Fu, Chao-Ying
2011-02-22 20:19             ` Fu, Chao-Ying
2011-02-24 10:46               ` Maciej W. Rozycki
2011-02-26 11:41                 ` Richard Sandiford
2011-02-28 16:41                   ` Maciej W. Rozycki
2011-02-26  0:00             ` Maciej W. Rozycki
2011-03-13  9:23               ` Richard Sandiford
2011-07-25  7:49                 ` Richard Sandiford
2011-07-26  2:01                   ` Maciej W. Rozycki
2011-07-29  0:58                     ` Maciej W. Rozycki
2011-07-29 11:30                       ` Richard Sandiford
2011-07-29 22:52                         ` Maciej W. Rozycki
2011-02-26 11:36             ` Richard Sandiford
2011-07-26 14:00               ` Maciej W. Rozycki
2010-05-26 20:19 ` [PATCH] MIPS: microMIPS and MCU ASE instruction set support Richard Sandiford
2010-05-27 21:39 ` Richard Sandiford

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=87typmo1e6.fsf@firetop.home \
    --to=rdsandiford@googlemail.com \
    --cc=binutils@sourceware.org \
    --cc=clm@codesourcery.com \
    --cc=dan@codesourcery.com \
    --cc=fu@mips.com \
    --cc=joseph@codesourcery.com \
    --cc=macro@codesourcery.com \
    /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).