This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: Macro expansion on MIPS
> -----Original Message-----
> From: Paul_Koning@Dell.com [mailto:Paul_Koning@Dell.com]
> Sent: woensdag 5 oktober 2011 12:38
> To: Smets, Jan (Jan); binutils@sourceware.org
> Subject: RE: Macro expansion on MIPS
>
> >>> Is there a way to disable macro expansion on MIPS? More
> specific the
> >>> replacement of 64bit instructions into two 32bit ones.
> >>> ...
> >> From: Paul_Koning@Dell.com [mailto:Paul_Koning@Dell.com]
> >> Have you considered O64? It's like O32 except with 64 bit
> registers
> >> and 64-bit operations. It gives you much of the benefits
> you'd get
> >> from N32 with a lot less effort. We've used it for years with
> >> excellent results.
> >
> >We have a very customized VxWorks 5 and a lot of in-house software.
> > It would be too much work to switch entirely to a new ABI in a few
> >weeks/months. So I really want to get everything building
> and running
> >with the new toolchain. 64bit pointers are too much overhead for us,
> >so we will likely go to N32 in the near future. But first
> things first,
> > and that's a new toolchain.
>
> O64, in spite of its name, uses 32 bit pointers. The best
> way to understand it is "O32 with 64 bit registers". So all
> pointers remain the same, the register usage is the same
> (four A registers for argument passing, for example), and
> most importantly, the ABICALLS mechanism is the same as O32.
>
> From past experience (working on millions of lines of code,
> much of it custom), it is indeed possible to do this in a few
> weeks. It involves a few trivial changes to a small number
> of assembly files, plus recompiling everything. The main
> effort is (a) building the O64 multilibs of the toolchain,
> (b) testing.
>
> And by the way, your code will then be faster and smaller.
> All for probably less effort than manually fixing up 64 bit
> assembly operations.
>
Thanks for the clearification Paul. But I still think switching ABI is too much work right now and very risky. So I really want to continue to use O32 for now, and have minimal changes. I'm sure we will slowly transition away from it, but it will take some time.
Meanwhile I tried some things, please see my 'no brainer' examples:
as -mabi=32 -march=mips4
input: ld
output: lw + lw
as -mabi=32 -march=mips4
input: .set mips64; ld (or any ISA >= mips3)
output: ld
Good, this is what I want! But it's almost impossible to find all the code that needs this fixup.
as -mabi=32 -march=mips64
input: ld
output: lw + lw
Why don't I get 'ld' as output? -march=mips64 != .set mips64 ?
as -mabi=32 -march=mips64
input: .set mips64; ld
output: ld
Does this indicate that there is something wrong with my assembler?
- Jan