This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: m68k : why is bra an alias for braw, not jra
- From: Andreas Schwab <schwab at suse dot de>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Philippe De Muyter <phdm at macqel dot be>, binutils mailing list <binutils at sources dot redhat dot com>
- Date: Fri, 07 Apr 2006 17:52:44 +0200
- Subject: Re: m68k : why is bra an alias for braw, not jra
- References: <200603211006.k2LA6w721722@mail.macqel.be> <4436852E.1020707@redhat.com>
Nick Clifton <nickc@redhat.com> writes:
> Hi Philippe,
>
>> In the m68k assembler, I wonder why `bra' and friends are alias for their
>> `bxxw' counterparts.
>
>> And if one writes no size specification for a `bra' instruction the assembler
>> should be free to choose the most efficient way to generate it, i.e.
>> a `brab' if possible of even a `bral' if needed.
>
>> If no-one objects, I'll submit a patch
>
> Please feel free to submit such a patch. I would recommend however that
> you control the new behaviour with a command line switch as I suspect
> that there will be assembler source files out there that rely upon the
> current behaviour.
I've found this comment in the gas-2.x sources:
/* Define this so that jump tables with calculable offsets are possible.
This option forces "bsr" and "bra" to always use 16-bit offsets, even
if smaller ones work work. Other pseudo-instructions are available for
variable-sized offsets. */
#define FIXED_SIZE_BRANCH
and later down:
#ifndef FIXED_SIZE_BRANCH
#define BRANCH "Bg"
#define BRANCH_MASK one(0xFF00)
#else
/* Fixed-size branches with 16-bit offsets */
#define BRANCH "BW"
#define BRANCH_MASK one(0xFFFF) /* 8-bit displacement must be 0 */
#endif
whereas gas 1.38.1 still made them variable sized. This is the
corresponding change log:
Wed Nov 4 07:36:49 1992 Ken Raeburn (raeburn@cygnus.com)
* m68k.h: Define FIXED_SIZE_BRANCH, so bsr and bra instructions
always use 16-bit offsets. Makes calculated-size jump tables
feasible.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."