public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] sba_iommu update (2.6 version)
Date: Mon, 12 Jan 2004 21:26:50 +0000	[thread overview]
Message-ID: <16387.4378.836759.342756@napali.hpl.hp.com> (raw)
In-Reply-To: <1073938588.6497.56.camel@patsy.fc.hp.com>

>>>>> On Mon, 12 Jan 2004 13:16:29 -0700, Alex Williamson <alex.williamson@hp.com> said:

  Alex> +static SBA_INLINE int
  Alex> +get_iovp_order (unsigned long size)
  Alex> +{
  Alex> +	double d = size - 1;
  Alex> +	long order;
  Alex> +
  Alex> +	__asm__ ("getf.exp %0=%1" : "=r"(order) : "f"(d));
  Alex> +	order = order - iovp_shift - 0xffff + 1;
  Alex> +	if (order < 0)
  Alex> +		order = 0;
  Alex> +	return order;
  Alex> +}

Please avoid inline-asm and use the corresponding intrinsic instead
(ia64_getf_exp(), in this particular case) so that the Intel compiler
remains usable.

Also, looking at it, I suspect we'd be better off using "long double"
instead of "double" to avoid problems with huge values (yeah, probably
doesn't make a difference in practice, but we should avoid propagating
potentially-buggy code; I see get_order() has the same
problem---apparently only ia64_fls() got fixed).

  Alex> +sba_page_override(char *str)

Wouldn't it be cleaner to use lib/cmdline.c:memparse() here?

	--david

  reply	other threads:[~2004-01-12 21:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-12 20:16 [PATCH] sba_iommu update (2.6 version) Alex Williamson
2004-01-12 21:26 ` David Mosberger [this message]
2004-01-12 21:57 ` Bjorn Helgaas
2004-01-12 23:01 ` Alex Williamson
2004-01-12 23:53 ` Alex Williamson
2004-01-13  0:05 ` David Mosberger

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=16387.4378.836759.342756@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@vger.kernel.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