public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, POINTER] Let gas support mips64
@ 2001-06-18 15:53 Thiemo Seufer
       [not found] ` <mailpost.992925926.14781@postal.sibyte.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Thiemo Seufer @ 2001-06-18 15:53 UTC (permalink / raw)
  To: binutils

Hi All,

This patch adds support for mips64 to gas. Testcases are not provided for
64bit case because of the necessary bfd and binutils changes (which aren't
done in a acceptable way yet).

btw:
At least for configuration mips64-linux, current CVS fails the
'make check' in gas for test 'MIPS ELF reloc 3'. The patch does not
change this behaviour.


Thiemo


2001-06-18  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>

	/gas/ChangeLog
	* config/tc-mips.h (MAX_GPREL_OFFSET): Changed from the first invalid
	value to the maximum value.
	* config/tc-mips.c (USES_32BIT_REGS): Define.
	(USES_64BIT_ADDRESSES): Define.
	(S_EX_*): Declare.
	(append_insn): Add handling of mips64 relocs.
	(macro_build): Likewise. Replace numeric constants by defines. Move
	insertion of immediate constants in case 'u' to append_insn().
	(load_register): Change register width check to use USES_32BIT_REGS.
	Fix handling of sign bit in 64bit constants.
	(load_address): Add parameters required to handle 64bit addresses.
	Add handling of 64bit addresses. Change register width check to use
	USES_32BIT_REGS. Change check for MAX_GPREL_OFFSET to fit the new
	value. Formatting.
	(macro): Change register width check to use USES_32BIT_REGS.
	Formatting. Typos. Add handling of 64bit addresses. Some code cleanup.
	Change check for MAX_GPREL_OFFSET to fit the new value.
	(macro2): Formatting. Change register width check to use
	USES_32BIT_REGS. Warn on used $at in M_UL[DW] case. Change calls to
	load_address().	Mark M_USD_A as double value.
	(mips16_macro): Formatting.
	(mips_ip): Replace numeric constants by defines. Change register width
	check to use USES_32BIT_REGS. Use new return values of
	my_getSmallExpression() instead of characters. Add mips64 relocation
	handling.
	(LP): Remove.
	(RP): Remove.
	(my_getSmallExpression): Rewritten to allow arbitrary upper/lowercase,
	return more useful values and support mips64 relocations.
	(md_parse_option): Use TE_TMIPS conditional as in other places.
	(md_apply_fix): Preliminary support for mips64 relocations.
	Fix bad JMP argument generation.
	(s_cprestore): Change register width check to use USES_32BIT_REGS.
	(s_cpadd): Likewise.
	(md_estimate_size_before_relax): Code cleanup.
	(md_obj_end): Remove ugly `' in message string. :-)
	(s_mips_end): Remove unused variables.
	(s_mips_ent): Remove ugly `' in message string.


Because of it's size (82689), the actual patch is provided at
http://www.csv.ica.uni-stuttgart.de/homes/ths/linux-mips/cygnus-gas-mips64.diff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
       [not found] ` <mailpost.992925926.14781@postal.sibyte.com>
@ 2001-06-18 23:03   ` cgd
  2001-06-20 10:21     ` Thiemo Seufer
  0 siblings, 1 reply; 12+ messages in thread
From: cgd @ 2001-06-18 23:03 UTC (permalink / raw)
  To: ica2_ts; +Cc: binutils

ica2_ts@csv.ica.uni-stuttgart.de ("Thiemo Seufer") writes:
> This patch adds support for mips64 to gas. Testcases are not provided for
> 64bit case because of the necessary bfd and binutils changes (which aren't
> done in a acceptable way yet).

by 'mips64' in this case, you mean the targets named mips64,
a.k.a. 64-bit object files.

as opposed to MIPS64, the architecture.

right?



(... the historical choice of mips64 as meaning, basically, mips3, and
now, 64-bit object file formats is ... going to hurt more and more as
time goes by.)


cgd

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-18 15:53 [PATCH, POINTER] Let gas support mips64 Thiemo Seufer
       [not found] ` <mailpost.992925926.14781@postal.sibyte.com>
@ 2001-06-18 23:13 ` Ian Lance Taylor
  2001-06-20 11:06   ` Thiemo Seufer
  2001-06-19  1:40 ` Nick Clifton
  2 siblings, 1 reply; 12+ messages in thread
From: Ian Lance Taylor @ 2001-06-18 23:13 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:

> 	(load_register): Change register width check to use USES_32BIT_REGS.
> 	Fix handling of sign bit in 64bit constants.

A small thing: you're changing a pair of shifts by 16 to a single
shift by 32.  That will lead to warnings when compiled on a 32 bit
processor.  That's why the shifts by 16 are there.  Also, note that
gas normally use valueT and addressT rather than bfd_vma.  (I actually
don't see any semantic change here at all, although I am probably
missing something.)

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-18 15:53 [PATCH, POINTER] Let gas support mips64 Thiemo Seufer
       [not found] ` <mailpost.992925926.14781@postal.sibyte.com>
  2001-06-18 23:13 ` Ian Lance Taylor
@ 2001-06-19  1:40 ` Nick Clifton
  2001-06-20 19:11   ` Eric Christopher
  2 siblings, 1 reply; 12+ messages in thread
From: Nick Clifton @ 2001-06-19  1:40 UTC (permalink / raw)
  To: echristo; +Cc: binutils

Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:

> Hi All,
> 
> This patch adds support for mips64 to gas. Testcases are not provided for
> 64bit case because of the necessary bfd and binutils changes (which aren't
> done in a acceptable way yet).
> 
> btw:
> At least for configuration mips64-linux, current CVS fails the
> 'make check' in gas for test 'MIPS ELF reloc 3'. The patch does not
> change this behaviour.
> 
> 
> Thiemo
> 
> 
> 2001-06-18  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
> 
> 	/gas/ChangeLog
> 	* config/tc-mips.h (MAX_GPREL_OFFSET): Changed from the first invalid
> 	value to the maximum value.
> 	* config/tc-mips.c (USES_32BIT_REGS): Define.
> 	(USES_64BIT_ADDRESSES): Define.
> 	(S_EX_*): Declare.
> 	(append_insn): Add handling of mips64 relocs.
> 	(macro_build): Likewise. Replace numeric constants by defines. Move
> 	insertion of immediate constants in case 'u' to append_insn().
> 	(load_register): Change register width check to use USES_32BIT_REGS.
> 	Fix handling of sign bit in 64bit constants.
> 	(load_address): Add parameters required to handle 64bit addresses.
> 	Add handling of 64bit addresses. Change register width check to use
> 	USES_32BIT_REGS. Change check for MAX_GPREL_OFFSET to fit the new
> 	value. Formatting.
> 	(macro): Change register width check to use USES_32BIT_REGS.
> 	Formatting. Typos. Add handling of 64bit addresses. Some code cleanup.
> 	Change check for MAX_GPREL_OFFSET to fit the new value.
> 	(macro2): Formatting. Change register width check to use
> 	USES_32BIT_REGS. Warn on used $at in M_UL[DW] case. Change calls to
> 	load_address().	Mark M_USD_A as double value.
> 	(mips16_macro): Formatting.
> 	(mips_ip): Replace numeric constants by defines. Change register width
> 	check to use USES_32BIT_REGS. Use new return values of
> 	my_getSmallExpression() instead of characters. Add mips64 relocation
> 	handling.
> 	(LP): Remove.
> 	(RP): Remove.
> 	(my_getSmallExpression): Rewritten to allow arbitrary upper/lowercase,
> 	return more useful values and support mips64 relocations.
> 	(md_parse_option): Use TE_TMIPS conditional as in other places.
> 	(md_apply_fix): Preliminary support for mips64 relocations.
> 	Fix bad JMP argument generation.
> 	(s_cprestore): Change register width check to use USES_32BIT_REGS.
> 	(s_cpadd): Likewise.
> 	(md_estimate_size_before_relax): Code cleanup.
> 	(md_obj_end): Remove ugly `' in message string. :-)
> 	(s_mips_end): Remove unused variables.
> 	(s_mips_ent): Remove ugly `' in message string.
> 
> 
> Because of it's size (82689), the actual patch is provided at
> http://www.csv.ica.uni-stuttgart.de/homes/ths/linux-mips/cygnus-gas-mips64.diff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-18 23:03   ` cgd
@ 2001-06-20 10:21     ` Thiemo Seufer
  0 siblings, 0 replies; 12+ messages in thread
From: Thiemo Seufer @ 2001-06-20 10:21 UTC (permalink / raw)
  To: binutils

cgd@sibyte.com wrote:
[snip]
>by 'mips64' in this case, you mean the targets named mips64,
>a.k.a. 64-bit object files.
>
>as opposed to MIPS64, the architecture.
>
>right?

Yes, thats right.


Thiemo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-18 23:13 ` Ian Lance Taylor
@ 2001-06-20 11:06   ` Thiemo Seufer
  2001-06-20 22:35     ` Ian Lance Taylor
  0 siblings, 1 reply; 12+ messages in thread
From: Thiemo Seufer @ 2001-06-20 11:06 UTC (permalink / raw)
  To: binutils; +Cc: ica2_ts

Ian Lance Taylor wrote:
>Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
>
>> 	(load_register): Change register width check to use USES_32BIT_REGS.
>> 	Fix handling of sign bit in 64bit constants.
>
>A small thing: you're changing a pair of shifts by 16 to a single
>shift by 32.  That will lead to warnings when compiled on a 32 bit
>processor.  That's why the shifts by 16 are there.

I do so and get no warning. :-) I assume You meant a compiler
without an integral 64bit type.

To circumvent such warnings, I switched back to 2 16bit shifts
and changed the patch accordingly.

>Also, note that
>gas normally use valueT and addressT rather than bfd_vma.  (I actually
>don't see any semantic change here at all, although I am probably
>missing something.)

The whole existing mips64 support in binutils requires bfd_vma.


Thiemo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-19  1:40 ` Nick Clifton
@ 2001-06-20 19:11   ` Eric Christopher
  2001-06-20 19:29     ` Thiemo Seufer
  0 siblings, 1 reply; 12+ messages in thread
From: Eric Christopher @ 2001-06-20 19:11 UTC (permalink / raw)
  To: ica2_ts; +Cc: binutils

Thiemo,

> > 
> > 2001-06-18  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>

Can you break this patch up a little bit?  There so much and parts of it
I'd like to comment on...

-eric

-- 
Pain is not the cleanser

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-20 19:11   ` Eric Christopher
@ 2001-06-20 19:29     ` Thiemo Seufer
  2001-06-20 19:58       ` Eric Christopher
  0 siblings, 1 reply; 12+ messages in thread
From: Thiemo Seufer @ 2001-06-20 19:29 UTC (permalink / raw)
  To: Eric Christopher; +Cc: binutils

Eric Christopher wrote:
> Thiemo,
> 
> > > 
> > > 2001-06-18  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
> 
> Can you break this patch up a little bit?  There so much and parts of it
> I'd like to comment on...

I tried so, but due to dependencies I didn't get a set of independent
patches. May You instead break up Your comments into several postings?


Thiemo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-20 19:29     ` Thiemo Seufer
@ 2001-06-20 19:58       ` Eric Christopher
  0 siblings, 0 replies; 12+ messages in thread
From: Eric Christopher @ 2001-06-20 19:58 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: Eric Christopher, binutils

> I tried so, but due to dependencies I didn't get a set of independent
> patches. May You instead break up Your comments into several postings?

I can, it would have been easier on me the other way.  I'll give you some
comments as soon as i can.

-eric

-- 
Pain is not the cleanser

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-20 11:06   ` Thiemo Seufer
@ 2001-06-20 22:35     ` Ian Lance Taylor
  2001-06-20 23:39       ` Thiemo Seufer
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Lance Taylor @ 2001-06-20 22:35 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:

> >Also, note that
> >gas normally use valueT and addressT rather than bfd_vma.  (I actually
> >don't see any semantic change here at all, although I am probably
> >missing something.)
> 
> The whole existing mips64 support in binutils requires bfd_vma.

It's a style issue, not a semantic issue.  valueT and addressT are
simply typedefs for bfd_vma--see as.h.

Although I just did a grep, and I see that a lot of uses of bfd_vma
have crept into gas, even a couple in tc-mips.c.

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-20 22:35     ` Ian Lance Taylor
@ 2001-06-20 23:39       ` Thiemo Seufer
  2001-06-26  9:36         ` Thiemo Seufer
  0 siblings, 1 reply; 12+ messages in thread
From: Thiemo Seufer @ 2001-06-20 23:39 UTC (permalink / raw)
  To: binutils

Ian Lance Taylor wrote:
[snip]
> > >gas normally use valueT and addressT rather than bfd_vma.  (I actually
> > >don't see any semantic change here at all, although I am probably
> > >missing something.)
> > 
> > The whole existing mips64 support in binutils requires bfd_vma.
> 
> It's a style issue, not a semantic issue.  valueT and addressT are
> simply typedefs for bfd_vma--see as.h.

I see. I change my patch accordingly, it's available at the same
URL as before.


Thiemo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, POINTER] Let gas support mips64
  2001-06-20 23:39       ` Thiemo Seufer
@ 2001-06-26  9:36         ` Thiemo Seufer
  0 siblings, 0 replies; 12+ messages in thread
From: Thiemo Seufer @ 2001-06-26  9:36 UTC (permalink / raw)
  To: binutils

Thiemo Seufer wrote:
[snip]
> > It's a style issue, not a semantic issue.  valueT and addressT are
> > simply typedefs for bfd_vma--see as.h.
> 
> I see. I change my patch accordingly, it's available at the same
> URL as before.

I changed the patch once more to get the setting of n32 ABI
flag right. Due to its size (84 kb) it's available at
http://www.csv.ica.uni-stuttgart.de/homes/ths/linux-mips/cygnus-gas-mips64.diff-2


Thiemo


2001-06-26  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>

	/gas/ChangeLog
	* config/tc-mips.h (MAX_GPREL_OFFSET): Changed from the first invalid
	value to the maximum value.
	* config/tc-mips.c (USES_32BIT_REGS): Define.
	(USES_64BIT_ADDRESSES): Define.
	(RELAX_ENCODE): Replace bfd_vma by valueT.
	(S_EX_*): Declare.
	(append_insn): Add handling of mips64 relocs.
	(macro_build): Likewise. Replace numeric constants by defines. Move
	insertion of immediate constants in case 'u' to append_insn().
	(load_register): Change register width check to use USES_32BIT_REGS.
	Fix handling of sign bit in 64bit constants.
	(load_address): Add parameters required to handle 64bit addresses.
	Add handling of 64bit addresses. Change register width check to use
	USES_32BIT_REGS. Change check for MAX_GPREL_OFFSET to fit the new
	value. Formatting.
	(macro): Change register width check to use USES_32BIT_REGS.
	Formatting. Typos. Add handling of 64bit addresses. Some code cleanup.
	Change check for MAX_GPREL_OFFSET to fit the new value.
	(macro2): Formatting. Change register width check to use
	USES_32BIT_REGS. Warn on used $at in M_UL[DW] case. Change calls to
	load_address().	Mark M_USD_A as double value.
	(mips16_macro): Formatting.
	(mips_ip): Replace numeric constants by defines. Change register width
	check to use USES_32BIT_REGS. Use new return values of
	my_getSmallExpression() instead of characters. Add mips64 relocation
	handling.
	(LP): Remove.
	(RP): Remove.
	(my_getSmallExpression): Rewritten to allow arbitrary upper/lowercase,
	return more useful values and support mips64 relocations.
	(md_parse_option): Use TE_TMIPS conditional as in other places.
	(md_apply_fix): Preliminary support for mips64 relocations.
	Fix bad JMP argument generation.
	(s_cprestore): Change register width check to use USES_32BIT_REGS.
	(s_cpadd): Likewise.
	(md_estimate_size_before_relax): Code cleanup.
	(mips_elf_final_processing): Set EF_MIPS_ABI2 flag for n32 ABI.
	(md_obj_end): Remove ugly `' in message string. :-)
	(s_mips_end): Remove unused variables.
	(s_mips_ent): Remove ugly `' in message string.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2001-06-26  9:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-18 15:53 [PATCH, POINTER] Let gas support mips64 Thiemo Seufer
     [not found] ` <mailpost.992925926.14781@postal.sibyte.com>
2001-06-18 23:03   ` cgd
2001-06-20 10:21     ` Thiemo Seufer
2001-06-18 23:13 ` Ian Lance Taylor
2001-06-20 11:06   ` Thiemo Seufer
2001-06-20 22:35     ` Ian Lance Taylor
2001-06-20 23:39       ` Thiemo Seufer
2001-06-26  9:36         ` Thiemo Seufer
2001-06-19  1:40 ` Nick Clifton
2001-06-20 19:11   ` Eric Christopher
2001-06-20 19:29     ` Thiemo Seufer
2001-06-20 19:58       ` Eric Christopher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).