linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, henrik.sorensen@gmail.com,
	Stephane Marchesin <marchesin@icps.u-strasbg.fr>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: V4L2: __ucmpdi2 undefined on ppc
Date: Tue, 4 Mar 2008 23:43:25 +0100	[thread overview]
Message-ID: <c3fe70f4c488b04e426b9d61c5263059@kernel.crashing.org> (raw)
In-Reply-To: <18381.49853.255430.142431@cargo.ozlabs.ibm.com>

>> Every occurrence of r7 here is wrong (and some of the r6).  Is there
>> any reason to do this in assembler code at all?
>
> The fact that the obvious C code generates ... a call to __ucmpdi2? :)

Hrm?  Here's the "obvious" C code, portable to all architectures
(modulo the specific types used, this isn't a proposed patch):


unsigned int ucmpdi2(unsigned long long a, unsigned long long b)
{
         unsigned long ahi, bhi, alo, blo;

         ahi = a >> 32;
         bhi = b >> 32;
         if (ahi < bhi)
                 return 0;
         if (ahi > bhi)
                 return 2;

         alo = a;
         blo = b;
         if (alo < blo)
                 return 0;
         if (alo > blo)
                 return 2;

         return 1;
}


(libgcc does it a bit differently, with unions and stuff).


Segher

      parent reply	other threads:[~2008-03-04 22:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.SOC.4.61.0612131359430.10721@math.ut.ee>
     [not found] ` <1166053317.909.19.camel@praia>
     [not found]   ` <20061214195842.GA14041@athena.road.mcmartin.ca>
2006-12-17 13:29     ` V4L2: __ucmpdi2 undefined on ppc David Woodhouse
2008-02-06 14:39       ` Stephane Marchesin
2008-03-02 18:48         ` Stephane Marchesin
2008-03-02 21:53         ` Segher Boessenkool
2008-03-04 16:37           ` David Woodhouse
2008-03-04 16:58             ` Scott Wood
2008-03-04 20:32             ` Segher Boessenkool
2008-03-04 21:44           ` Paul Mackerras
2008-03-04 21:47             ` Scott Wood
2008-03-04 22:43             ` Segher Boessenkool [this message]

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=c3fe70f4c488b04e426b9d61c5263059@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dwmw2@infradead.org \
    --cc=henrik.sorensen@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=marchesin@icps.u-strasbg.fr \
    --cc=paulus@samba.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).