linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Fortune <Matthew.Fortune@imgtec.com>
To: Maciej Rozycki <Maciej.Rozycki@imgtec.com>,
	Ralf Baechle <ralf@linux-mips.org>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>,
	kbuild test robot <fengguang.wu@intel.com>,
	Paul Burton <Paul.Burton@imgtec.com>,
	"kbuild-all@01.org" <kbuild-all@01.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: {standard input}:136: Error: number (0x9000000080000000) larger than 32 bits
Date: Tue, 19 Apr 2016 14:43:45 +0000	[thread overview]
Message-ID: <6D39441BF12EF246A7ABCE6654B023537E3DB822@hhmail02.hh.imgtec.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1604190104420.21846@tp.orcam.me.uk>

Maciej Rozycki <Maciej.Rozycki@imgtec.com> writes:
> On Mon, 18 Apr 2016, Maciej W. Rozycki wrote:
> 
> >  The thing is that to match some software's (such as ours)
> > requirements an ISA override -- as a side effect -- relaxes ABI
> > restrictions on certain operations.  E.g. the DLI macro and its 64-bit
> > immediate argument are not valid in the o32 ABI.  When no actual
> > override happens, such as with `-march=r4600' which already implies
> > `mips3' for the ISA, the side effect is lost:
> >
> >   /* The use of .set [arch|cpu]= historically 'fixes' the width of gp
> and fp
> >      registers based on what is supported by the arch/cpu.  */
> >   if (mips_opts.isa != prev_isa)
> 
>  It's worse yet actually, as operations such as `.set pop' and `.set
> mips0' may not restore the ABI restrictions, possibly leading to wrong
> code generation elsewhere, generally in handcoded assembly only.  This
> can be illustrated with a program like:
> 
> 	.set	push
> 	.set	mips3
> 	dli	$2, 0x9000000080000000
> 	.set	mips0
> 	dli	$2, 0x9000000080000000
> 	.set	mips3
> 	.set	pop
> 	dli	$2, 0x9000000080000000
> 
> -- try building it with `-mips3' and `-mips4' to see how it fails or
> succeeds to assemble all the three DLI macros respectively, where it is
> supposed to succeed with the first macro only and fail with the other
> two in both cases.
> 
>  I have a fix in the works and to have it integrated upstream I just
> need to accompany it with suitable cases -- like the fragment above --
> for the GAS testsuite.  I'll send an update when it's ready.

I do not think the change in behaviour was intentional. I think it came
about because I separated the handling of an explicit .set mips* directive
from the implicit setting of gp/fp. I needed to ensure that gp/fp was
only updated when there was a .set mips* directive but missed the case
where you have an explicit directive that matches the current mips*
setting.

The conditional nature of updating 'fp' is however very much intentional
in that if a user enters 'fpxx' mode where fp==0 then the implicit update
of fp does not happen. This is OK as this behaviour only triggers when
using the newly added fpxx feature anyway.

I am generally not in favour of these implicit side-effect behaviours
as they are only useful in niche cases and are somewhat non-intuitive but
we are stuck with them because of history. It would be possible to write
code that does not need them by explicitly using the .set gp or .set fp
options. There is little we can do about that given historic precedent
though. Instead code that does not want the implicit behaviour has to
explicitly do things like:

.set mips3
.set gp=default
.set fp=default

Matthew

  reply	other threads:[~2016-04-19 14:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-17  0:20 {standard input}:136: Error: number (0x9000000080000000) larger than 32 bits kbuild test robot
2016-04-17  1:19 ` Ralf Baechle
2016-04-17 14:43   ` Maciej W. Rozycki
2016-04-18 13:34     ` Ralf Baechle
2016-04-18 14:25       ` Maciej W. Rozycki
2016-04-18 15:54         ` Ralf Baechle
2016-04-18 18:09           ` Maciej W. Rozycki
2016-04-19  0:25             ` Maciej W. Rozycki
2016-04-19 14:43               ` Matthew Fortune [this message]
2016-04-22  1:00                 ` Maciej W. Rozycki
  -- strict thread matches above, loose matches on Subject: below --
2016-06-25 23:37 kbuild test robot
2016-06-11 23:37 kbuild test robot
2016-03-12 23:00 kbuild test robot
2016-03-05 23:09 kbuild test robot
2016-02-27 23:05 kbuild test robot

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=6D39441BF12EF246A7ABCE6654B023537E3DB822@hhmail02.hh.imgtec.org \
    --to=matthew.fortune@imgtec.com \
    --cc=Maciej.Rozycki@imgtec.com \
    --cc=Paul.Burton@imgtec.com \
    --cc=fengguang.wu@intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=ralf@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 NNTP newsgroup(s).