public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Eric Christopher <echristo@redhat.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Daniel Jacobowitz <drow@false.org>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	binutils@sources.redhat.com
Subject: Re: "Error: constant too large" on mips gas
Date: Mon, 11 Apr 2005 21:40:00 -0000	[thread overview]
Message-ID: <1113255609.5094.18.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.61L.0504111732130.31547@blysk.ds.pg.gda.pl>


> 
> gas/:
> 2005-04-11  Maciej W. Rozycki  <macro@linux-mips.org>
> 
>         * config/tc-mips.c (IS_ZEXT_32BIT_NUM): New macro.
>         (normalize_address_expr): New function to sign-extend address
>         offsets that fit into 32 bits in 32-bit mode.
>         (macro_build_ldst_constoffset): Use normalize_address_expr()
>         instead of a handcoded sequence.
>         (load_register): Likewise.  Report oversized numbers in a useful
>         way.
>         (macro) [ld_st, ldd_std]: Reject all oversized offsets, not only
>         for constant addresses.  Report oversized numbers in a useful way.
>         (mips_ip): Use normalize_address_expr() for addresses.
> 
> gas/testsuite/:
> 2005-04-11  Maciej W. Rozycki  <macro@linux-mips.org>
> 
>         * gas/mips/ldstla-32.s: Exclude offsets that are now meant to fail
>         and include more instructions/offsets that are meant to succeed.
>         Use $4 instead $3 to avoid register dependencies.
>         * gas/mips/ldstla-32.d: Update accordingly.
>         * gas/mips/ldstla-32-shared.d: Likewise.
> 	* gas/mips/ldstla-32-mips3.d: New test based on the above, except 
> 	for mips3.
> 	* gas/mips/ldstla-32-mips3-shared.d: Similarly, for PIC.
> 	* gas/mips/ldstla-32-mips3.s: Source for the new tests.
>         * gas/mips/ldstla-32-1.s: New test for offsets that are meant to
>         fail.
> 	* gas/mips/ldstla-32-mips3-1.s: Likewise, for mips3.
>         * gas/mips/ldstla-32-1.l: Stderr output for the new test.
> 	* gas/mips/ldstla-32-mips3-1.l: Likewise.
>         * gas/mips/mips.exp: Run the new tests.
> 
>  I've tested it with mips64el-linux-gnu with no regressions.  OK to apply?
> 

This is all OK for 2.16, committing it to mainline for the current
timeframe is ok since you plan on working on a different implementation.
I'd like them to be mostly the same while working on things.

Interestingly enough there's still the problem of this:

la $2,0x80000000

on 64-bit abis. I believe the general consensus is to sign-extend the
constant when loading it. Currently we expand to:

ori $2,$0,0x8000
dsll $2,$2,0x10

which ends up getting us a zero-extended value which ends up being
unpredictable for calculations based on that.

>  I haven't updated documentation though, as I consider it a short-term 
> hack for 2.16 only.  For 2.17, I think expr() should be modified to be 
> able to do signed arithmetic/logic and perform operations modulo (1 << n), 
> at least for reasonable values of n.  Therefore only that implementation 
> would be able to specify the desired number ranges accepted rather than 
> accept what happens to be implemented.
> 
>  Does it sound reasonable?  I hope so.

Elaborate a bit please? It sounds ok so far, but I like examples :)

I'm working on some documentation for all of the macro instructions we
support since this is getting to be mind numbing as to what we should
expect and how we handle it. Any start that you have would be nice as
well.

-eric

  reply	other threads:[~2005-04-11 21:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-01  3:35 Atsushi Nemoto
2005-04-04  8:58 ` Atsushi Nemoto
2005-04-04 13:37   ` Maciej W. Rozycki
2005-04-04 13:40     ` Daniel Jacobowitz
2005-04-04 14:00       ` Maciej W. Rozycki
2005-04-04 18:10     ` Eric Christopher
2005-04-05 18:41       ` Maciej W. Rozycki
2005-04-05 18:41         ` Eric Christopher
2005-04-05 18:56         ` Daniel Jacobowitz
2005-04-09 15:31         ` Daniel Jacobowitz
2005-04-09 17:47           ` Eric Christopher
2005-04-11 18:23             ` Maciej W. Rozycki
2005-04-11 21:40               ` Eric Christopher [this message]
2005-04-12 18:07                 ` Maciej W. Rozycki
2005-04-12 18:25                   ` Eric Christopher
2005-04-13 17:55                     ` Maciej W. Rozycki
2005-04-15  1:12               ` Atsushi Nemoto
2005-04-17 12:22                 ` Atsushi Nemoto
2005-04-18  6:25                 ` Atsushi Nemoto
2005-04-18  8:53                   ` Atsushi Nemoto
2005-04-05  2:38     ` Atsushi Nemoto
2005-04-05  4:28       ` Atsushi Nemoto
2005-04-05  4:34         ` Thiemo Seufer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1113255609.5094.18.camel@localhost.localdomain \
    --to=echristo@redhat.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=binutils@sources.redhat.com \
    --cc=drow@false.org \
    --cc=macro@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).