public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* difference between xscale and iwmmxt
@ 2006-09-07  2:53 Bridge Wu
  2006-09-07  3:42 ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Bridge Wu @ 2006-09-07  2:53 UTC (permalink / raw)
  To: crossgcc, linux-arm-toolchain, gcc-help

Hello,

It seems -mcpu=xscale and -mcpu=iwmmxt not only mean for different
target, but also mean different calling convention. E.g, look at issue
below.

I built an arm linux tool chain with gcc-3.4.3, glibc-2.3.2 and
binutils-2.14.90.0.7 by using crosstool. I set
GCC_EXTRA_CONFIG="--with-cpu=iwmmxt --enable-cxx-flags=-mcpu=iwmmxt".

% cat floattest.c
#include <stdio.h>
int main()
{
        float a;

        printf("%f\n", 1.0/3.0);
        return 0;
}

% arm-linux-gcc floattest.c -mcpu=xscale
The result is wrong.

% arm-linux-gcc floattest.c
% arm-linux-gcc floattest.c -mcpu=iwmmxt
Both the results are correct.

Look at the generated assembly code, I find "ldmia   r1, {r1, r2}" is
used before invoking printf() with -mcpu=xscale, while "ldmia   r2,
{r2, r3}" is used with -mcpu=iwmmxt. It shows these two options have
different calling convention.

Then which PCS (procedure call standard) do xscale and iwmmxt follow
up respectively? Are there any clues to this?

-- 
best regards,
-Bridge

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: difference between xscale and iwmmxt
  2006-09-07  2:53 difference between xscale and iwmmxt Bridge Wu
@ 2006-09-07  3:42 ` Khem Raj
  2006-09-07  6:56   ` Bridge Wu
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2006-09-07  3:42 UTC (permalink / raw)
  To: Bridge Wu; +Cc: crossgcc, linux-arm-toolchain, gcc-help

Hi Bridge

I think there should be no differences in calling convention if you are 
configuring toolchain with EABI.
with Old ABI there may be differences because iwmmxt has it  own  ABI
which was  different.

Thanks

Khem

Bridge Wu said the following on 9/6/2006 7:53 PM:
> Hello,
>
> It seems -mcpu=xscale and -mcpu=iwmmxt not only mean for different
> target, but also mean different calling convention. E.g, look at issue
> below.
>
> I built an arm linux tool chain with gcc-3.4.3, glibc-2.3.2 and
> binutils-2.14.90.0.7 by using crosstool. I set
> GCC_EXTRA_CONFIG="--with-cpu=iwmmxt --enable-cxx-flags=-mcpu=iwmmxt".
>
> % cat floattest.c
> #include <stdio.h>
> int main()
> {
>        float a;
>
>        printf("%f\n", 1.0/3.0);
>        return 0;
> }
>
> % arm-linux-gcc floattest.c -mcpu=xscale
> The result is wrong.
>
> % arm-linux-gcc floattest.c
> % arm-linux-gcc floattest.c -mcpu=iwmmxt
> Both the results are correct.
>
> Look at the generated assembly code, I find "ldmia   r1, {r1, r2}" is
> used before invoking printf() with -mcpu=xscale, while "ldmia   r2,
> {r2, r3}" is used with -mcpu=iwmmxt. It shows these two options have
> different calling convention.
>
> Then which PCS (procedure call standard) do xscale and iwmmxt follow
> up respectively? Are there any clues to this?
>

-- 
Khem Raj <kraj@mvista.com>
MontaVista Software Inc.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: difference between xscale and iwmmxt
  2006-09-07  3:42 ` Khem Raj
@ 2006-09-07  6:56   ` Bridge Wu
  2006-09-07  8:55     ` Richard Earnshaw
  0 siblings, 1 reply; 5+ messages in thread
From: Bridge Wu @ 2006-09-07  6:56 UTC (permalink / raw)
  To: Khem Raj; +Cc: crossgcc, linux-arm-toolchain, gcc-help

Hi Khem,

Yes, if we use EABI toolchain, the result is always fine regardless of
xscale or iwmmxt.
You mean iwmmxt has its own ABI, which ABI does iwmmxt follow? Are
there documents for iwmmxt like BSABI (ABI for ARM Architecture)?

Thanks and Best regards,
Bridge

On 9/7/06, Khem Raj <kraj@mvista.com> wrote:
> Hi Bridge
>
> I think there should be no differences in calling convention if you are
> configuring toolchain with EABI.
> with Old ABI there may be differences because iwmmxt has it  own  ABI
> which was  different.
>
> Thanks
>
> Khem
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: difference between xscale and iwmmxt
  2006-09-07  6:56   ` Bridge Wu
@ 2006-09-07  8:55     ` Richard Earnshaw
  2006-09-08  3:44       ` Bridge Wu
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Earnshaw @ 2006-09-07  8:55 UTC (permalink / raw)
  To: Bridge Wu; +Cc: Khem Raj, crossgcc, linux-arm-toolchain, gcc-help

On Thu, 2006-09-07 at 07:56, Bridge Wu wrote:
> Hi Khem,
> 
> Yes, if we use EABI toolchain, the result is always fine regardless of
> xscale or iwmmxt.
> You mean iwmmxt has its own ABI, which ABI does iwmmxt follow? Are
> there documents for iwmmxt like BSABI (ABI for ARM Architecture)?

Prior to the EABI iwmmxt had it's own ill-specified ABI which had a
number of weird self-inconsistencies.  I'd strongly suggest you avoid
using that and adopt the EABI instead.

R.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: difference between xscale and iwmmxt
  2006-09-07  8:55     ` Richard Earnshaw
@ 2006-09-08  3:44       ` Bridge Wu
  0 siblings, 0 replies; 5+ messages in thread
From: Bridge Wu @ 2006-09-08  3:44 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: Khem Raj, crossgcc, linux-arm-toolchain, gcc-help

EABI tool chain is certainly good. But upgrading from old ABI tool
chain to EABI tool chain will impact too much aspects, not only
upgrading tool chain, re-building applications, but also upgrading
kernel.

I think I can build a compiler with --with-cpu=xscale configuration
and a library for xscale. But I'm not sure if that is fine with
-mcpu=iwmmxt. Because -mcpu=iwmmxt is needed for those programs using
iwmmxt instructions, we cannot stop using it completely.

Hi Richard,
I'd like to know what ill-specified ABI iwmmxt followed. Could you
please share with us how you know them? Thanks.

-- 
best regards,
-Bridge

On 9/7/06, Richard Earnshaw <rearnsha@arm.com> wrote:
> Prior to the EABI iwmmxt had it's own ill-specified ABI which had a
> number of weird self-inconsistencies.  I'd strongly suggest you avoid
> using that and adopt the EABI instead.
>
> R.
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-09-08  3:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-07  2:53 difference between xscale and iwmmxt Bridge Wu
2006-09-07  3:42 ` Khem Raj
2006-09-07  6:56   ` Bridge Wu
2006-09-07  8:55     ` Richard Earnshaw
2006-09-08  3:44       ` Bridge Wu

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 read-only IMAP folder(s) and NNTP newsgroup(s).