[SH] Correct clrs,sets,pref insns

Oleg Endo oleg.endo@t-online.de
Sat Feb 14 11:11:00 GMT 2015


On Sat, 2015-02-07 at 13:49 +0900, Kaz Kojima wrote:

> I can't regenerate *.s files with arch.exp yet.  It looks my expect/
> tcl is broken in some way, though I'm not sure about it.
> I've translated the part which generates *.s into the perl script
> attached.  It'll regenerate *.s files in gas/testsuite/gas/sh/arch
> with
>   cat ../../../../../opcodes/sh-opc.h | perl gen-as.pl
> Could you try it out?

Yep, that works.  Although it seems there's a off-by-one error in the
last loop 'foreach $arch (0 .. $archcount) {'.  It generates an '.s'
file which is basically empty.  I guess it should be
'foreach $arch (0 .. ($archcount - 1)) {' in this case.

> It seems that arch_expected.txt needs to be updated because "pref"
> insn was the last user of arch_sh2a_nofpu_or_sh4_nommu_nofpu_up
> in the insn list in sh-opc.h.

I don't quite understand the purpose of the 'inheritance graph' in
sh-opc.h.  Things like 'SH3-nommu/SH2A-nofpu' and 'SH4/SH2A' are
confusing, but that's another story...
  
> BTW, those generated *.s files have to be copied to the directory
> ld/testsuite/ld-sh/arch.
> Also the arch_expected.txt file in that directory have to be updated.

Oh right, that too.

I'd propose to remove the dead code in arch.exp and add the perl script
to gas/testsuite/gas/sh/arch.  I've also adjusted the comments in the
generated .s files.

Updated patch attached.

Cheers,
Oleg

opcodes/ChangeLog:
        * sh-opc.h (clrs, sets): Mark as arch_sh3_nommu_up instead of 
        arch_sh_up.
        (pref): Mark as arch_sh2a_nofpu_or_sh3_nommu_up instead of
        arch_sh2a_nofpu_or_sh4_nommu_nofpu_up.

gas/testsuite/ChangeLog:
	* gas/sh/arch/arch.exp: Replace dead code to generate 
	expected .s files with ...
	* gas/sh/arch/sh-opc-gen-as.pl: ... this new script.
	* gas/sh/arch/arch_expected.txt: Regenerate.
	* gas/sh/arch/sh-dsp.s: Likewise.
	* gas/sh/arch/sh-opc-gen-as.pl: Likewise.
	* gas/sh/arch/sh.s: Likewise.
	* gas/sh/arch/sh2.s: Likewise.
	* gas/sh/arch/sh2a-nofpu-or-sh3-nommu.s: Likewise.
	* gas/sh/arch/sh2a-nofpu-or-sh4-nommu-nofpu.s: Likewise.
	* gas/sh/arch/sh2a-nofpu.s: Likewise.
	* gas/sh/arch/sh2a-or-sh3e.s: Likewise.
	* gas/sh/arch/sh2a-or-sh4.s: Likewise.
	* gas/sh/arch/sh2a.s: Likewise.
	* gas/sh/arch/sh2e.s: Likewise.
	* gas/sh/arch/sh3-dsp.s: Likewise.
	* gas/sh/arch/sh3-nommu.s: Likewise.
	* gas/sh/arch/sh3.s: Likewise.
	* gas/sh/arch/sh3e.s: Likewise.
	* gas/sh/arch/sh4-nofpu.s: Likewise.
	* gas/sh/arch/sh4-nommu-nofpu.s: Likewise.
	* gas/sh/arch/sh4.s: Likewise.
	* gas/sh/arch/sh4a-nofpu.s: Likewise.
	* gas/sh/arch/sh4a.s: Likewise.
	* gas/sh/arch/sh4al-dsp.s: Likewise.

ld/testsuite/ChangeLog:
	* ld-sh/arch/arch_expected.txt: Regenerate.
	* ld-sh/arch/sh-dsp.s: Likewise.
	* ld-sh/arch/sh.s: Likewise.
	* ld-sh/arch/sh2.s: Likewise.
	* ld-sh/arch/sh2a-nofpu-or-sh3-nommu.s: Likewise.
	* ld-sh/arch/sh2a-nofpu-or-sh4-nommu-nofpu.s: Likewise.
	* ld-sh/arch/sh2a-nofpu.s: Likewise.
	* ld-sh/arch/sh2a-or-sh3e.s: Likewise.
	* ld-sh/arch/sh2a-or-sh4.s: Likewise.
	* ld-sh/arch/sh2a.s: Likewise.
	* ld-sh/arch/sh2e.s: Likewise.
	* ld-sh/arch/sh3-dsp.s: Likewise.
	* ld-sh/arch/sh3-nommu.s: Likewise.
	* ld-sh/arch/sh3.s: Likewise.
	* ld-sh/arch/sh3e.s: Likewise.
	* ld-sh/arch/sh4-nofpu.s: Likewise.
	* ld-sh/arch/sh4-nommu-nofpu.s: Likewise.
	* ld-sh/arch/sh4.s: Likewise.
	* ld-sh/arch/sh4a-nofpu.s: Likewise.
	* ld-sh/arch/sh4a.s: Likewise.
	* ld-sh/arch/sh4al-dsp.s: Likewise.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: sh_clrs_sets_pref.patch
Type: text/x-patch
Size: 192354 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150214/a669422e/attachment.bin>


More information about the Binutils mailing list