This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] MIPS Gas: generating mips16e jrc/jalrc instruction.
On Fri, 2005-10-14 at 19:35 +0200, Thiemo Seufer wrote:
> >
> > Index: gas/config/tc-mips.c
> > ===================================================================
> > RCS file: /cvs/src/src/gas/config/tc-mips.c,v
> > retrieving revision 1.323
> > diff -c -p -b -r1.323 tc-mips.c
> > *** gas/config/tc-mips.c 11 Oct 2005 11:16:16 -0000 1.323
> > --- gas/config/tc-mips.c 14 Oct 2005 17:23:59 -0000
> > *************** append_insn (struct mips_cl_insn *ip, ex
> > *** 2693,2704 ****
> > --- 2693,2721 ----
> > sync.p, we can not swap. */
> > || (prev_pinfo & INSN_SYNC))
> > {
> > + if (mips_opts.mips16
> > + && (pinfo & INSN_UNCOND_BRANCH_DELAY)
> > + && (pinfo & (MIPS16_INSN_READ_X | MIPS16_INSN_READ_31))
> > + && (mips_opts.isa == ISA_MIPS32
> > + || mips_opts.isa == ISA_MIPS32R2
> > + || mips_opts.isa == ISA_MIPS64
> > + || mips_opts.isa == ISA_MIPS64R2))
> > + {
> > + /* Convert MIPS16 jr/jalr into a "compact" jump. */
>
> The comment formatting rules want two spaces at the end of a sentence.
ok..
> > #objdump: -dr -mmips:isa32 -mmips:16
> > #as: -march=mips32 -mips16
> > #name: mips16e jalrc/jrc
> > .*: file format .*
> > Disassembly of section .text:
> > 00000000 <.text>:
> > 0: eac0 jalrc v0
> > 2: e8a0 jrc ra
> > 4: 6500 nop
> > 6: 6500 nop
> > 8: 6500 nop
> > a: 6500 nop
> > c: 6500 nop
> > e: 6500 nop
>
> > # Test the generation of jalrc/jrc opcodes
> > jalr $31,$2
> > jr $31
> >
> > .p2align 4
>
> Could you expand that to jrc not being followed by a nop? Otherwise it
> might not be an effective test.
>
I'll add "li $2,1" after the jrc instruction, (although one only need to
verify that the first jalrc works, since jrc uses the same code).
patch ok after these change?
David.