public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Jérôme Arzel" <jerome.arzel@gnuside.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range
Date: Mon, 27 May 2013 10:25:17 +0100 (BST)	[thread overview]
Message-ID: <1660034702.154024.1369646717524.JavaMail.root@gnuside.com> (raw)
In-Reply-To: <1369426435.15817.19@scott-Lenovo-G560>


On 05/24/2013 10:13:55 PM, Scott Wood wrote:
> 
> On 05/23/2013 04:52:26 AM, J?r?me Arzel wrote:
> > Hi all,
> > 
> > I have an issue when I compile U-Boot for my target machine
> > (P1022DS,
> > 36-bit).
> > Here is the error message:
> > 
> > release.S: Assembler messages:
> > release.S:154: Error: operand out of range (0xfffff144 is not
> > between
> > 0x00000000 and 0x0000ffff)
> > release.S:286: Error: operand out of range (0xfffff144 is not
> > between
> > 0x00000000 and 0x0000ffff)
> > release.S:311: Error: operand out of range (0xfffff140 is not
> > between
> > 0x00000000 and 0x0000ffff)
> > 
> > (release.S is located to arch/powerpc/cpu/mpc85xx/release.S)
> > 
> > And here is the code for the first error (line 150):
> > 
> > #define toreset(x) (x - __secondary_start_page + 0xfffff000)
> > 
> >         /* get our PIR to figure out our table entry */
> >         lis     r3,toreset(__spin_table_addr)@h
> >         ori     r3,r3,toreset(__spin_table_addr)@l
> > 
> > I don't really know why it doesn't work, but I think
> > that "ori" is inappropried, the immediate value must be a 16-bit
> > value.
> 
> The @l means take the low 16 bits of the constant.  Likewise, the @h
> in
> the lis takes the upper 16 bits.
> 
> Could you try to see what that instruction looks like after the
> preprocessor stage (i.e. use -E rather than -c in gcc)?
> 

OK, I tried and unsurprisingly it's:

 lis 3,(__spin_table_addr - __secondary_start_page + 0xfffff000)@h
 ori 3,3,(__spin_table_addr - __secondary_start_page + 0xfffff000)@l
 lwz 3,0(3)

If the @l takes the low 16 bits of
(__spin_table_addr - __secondary_start_page + 0xfffff000), so
the immediate value should not be 0xfffff144, but 0xf144.
The error is maybe in GCC...


J?r?me

  reply	other threads:[~2013-05-27  9:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <158709369.126474.1369301672221.JavaMail.root@gnuside.com>
2013-05-23  9:52 ` [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range Jérôme Arzel
2013-05-24 20:13   ` Scott Wood
2013-05-27  9:25     ` Jérôme Arzel [this message]
2013-05-28 15:14       ` Jérôme Arzel
2013-05-31 18:20   ` Scott Wood
2013-06-04  9:08     ` Jérôme Arzel

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=1660034702.154024.1369646717524.JavaMail.root@gnuside.com \
    --to=jerome.arzel@gnuside.com \
    --cc=u-boot@lists.denx.de \
    /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