Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] oprofile "requires" gmp???
Date: Fri, 24 Dec 2010 09:05:17 +0100	[thread overview]
Message-ID: <20101224090517.0c935c19@surf> (raw)
In-Reply-To: <9AC3F0E75060224C8BBC5BA2DDC8853A1EA263BF@EXV1.corp.adtran.com>

Andy,

(Could you please avoid top-posting ? Thanks!)

On Thu, 23 Dec 2010 13:03:15 -0600
ANDY KENNEDY <ANDY.KENNEDY@adtran.com> wrote:

> Okay, I've done some tracking and have found the issue, but I don't know
> Mips asm that great (only 2 months into mips).
> 
> The code that it pukes at for building gmp for the native toolchain is:
> 
> #define umul_ppmm(w1, w0, u, v) \
> __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
> 
> (defined in longlong.h under the root of gmp-4.2.4)
> 
> The error given is:
> dive_1.c:114:4: error: impossible constraint in 'asm'
> dive_1.c:114 is: umul_ppmm (h, dummy, l, divisor);

Hum, maybe this has been fixed in more recent versions of gmp. Could
you try Gustavoz's toolchain-rework branch ? It bumps gmp to version
5.0.1, it's really the first thing to test before trying to fix an old
gmp version.

Gustavo's repository is at git://repo.or.cz/buildroot-gz.git, the
branch is toolchain-rework. Or you can get the individual patches at
http://lists.busybox.net/pipermail/buildroot/2010-December/039804.html.

> Also, for my edification and learning, how does that asm line read?

Well:

 * multu is the instruction

 * %2 says "the third argument in the argument list", so in our case,
   it's "d" (u)

 * %3 says "the fourth argument in the argument list", so in our case,
   it's "d" (v)

 * the part after the first colon is the list of output registers.
   See
   http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#s5
   for the syntax of what Gcc calls "extended assembly".

 * The "=l" (w0) tells gcc to put the contents of the LO register into
   the w0 variable. Presumably, the LO register contains a part of the
   result of the multiplication. The "l" is called a constraint, and is
   described at
   http://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints
   (section on MIPS).

 * Similarly, the "=h" (w1) tells gcc to put the contents of the HI
   register into the w1 variable. The gcc documentation say that this
   constraint is no longer supported, so probably the problem is here.

 * the part after the second colon is the list of input registers.

 * the "d" (u) and "d" (v) tell gcc to store the values of variables u
   and v into two "address registers", and use those registers instead
   of %2 and %3 in the instruction.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2010-12-24  8:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-23  4:47 [Buildroot] oprofile "requires" gmp??? ANDY KENNEDY
2010-12-23  7:27 ` Thomas Petazzoni
2010-12-23 19:03   ` ANDY KENNEDY
2010-12-24  8:05     ` Thomas Petazzoni [this message]
2010-12-27 18:15       ` ANDY KENNEDY
2010-12-27 18:15         ` Gustavo Zacarias
2010-12-27 18:18           ` Gustavo Zacarias
     [not found]             ` <9AC3F0E75060224C8BBC5BA2DDC8853A1EAEB132@EXV1.corp.adtran.com>
2010-12-28 13:04               ` Gustavo Zacarias
2010-12-28 16:19                 ` [Buildroot] oprofile "requires" gmp??? Slight fork: BR2_STAGING_DIR ANDY KENNEDY
2010-12-28 21:21                   ` Gustavo Zacarias
2010-12-28 22:31                     ` ANDY KENNEDY
2010-12-29 10:57                     ` Thomas Petazzoni
2010-12-29 11:21                       ` Peter Korsgaard
2010-12-29 21:02                 ` [Buildroot] oprofile "requires" gmp??? ANDY KENNEDY
2010-12-29 21:10                   ` Peter Korsgaard
2010-12-29 21:54                     ` ANDY KENNEDY
2010-12-29 22:01                       ` Gustavo Zacarias
2010-12-29 22:41                 ` ANDY KENNEDY
2010-12-29 23:26                 ` ANDY KENNEDY

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=20101224090517.0c935c19@surf \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /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