This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 19/20] MIPS/GAS: Only set the MIPS16 flag if code produced


"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> and noting no further comments from anyone else despite your request 
> here's my proposal to modify the MIPS16 ASE ELF file flag's semantics such 
> that it is only set (by GAS) if actual MIPS16 code has been generated.  
> That is with this change it is not enough to pass "-mips16" to GAS or emit 
> data like this:
>
> 	.set	mips16
> 	.word	0
>
> -- there actually has to be at least one instruction generated, e.g.:
>
> 	.set	mips16
> 	nop

Sounds good, thanks.

> 	gas/
> 	* config/tc-mips.c (file_ase_mips16): Adjust comment.
> 	(append_insn): Update file_ase_mips16.
> 	(mips_after_parse_args): Don't set file_ase_mips16 here.
>
> 	gas/testsuite/
> 	* gas/mips/elf_ase_mips16.d: Update test for new MIPS16 ASE flag
> 	semantics.
> 	* gas/mips/elf_ase_mips16-1.d: New test.
> 	* gas/mips/nop.s: Source for the new test.
> 	* gas/mips/mips.exp: Run the new test.
>
> 	binutils/testsuite/
> 	* lib/binutils-common.exp (regexp_diff): Implement inverse 
> 	matching, requested by `!'.

OK with a couple of niggles fixed:

1. The new test should be "elf_ase_mips16-2.d" rather than "-1.d".
   Either leave "elf_ase_mips16.d" with its current name or change
   the filename to "elf_ase_mips16-1.d".  (The former seems less
   disruptive, but feel free to do the latter if you prefer.)

2. In this hunk:

> -private flags = [0-9a-f]*[4-7c-f]......: .*[[,]mips16[],].*
> +!private flags = .{1,8}: .*[[,]mips16[],].*

I think it's better to make the inverted regexp as loose as possible.
I.e.:

!private flags = .*mips16.*

if indeed that works.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]