[Pixman] [PATCH] Make sure iwMMXt is only detected on ARM

Toms Miks barvins.test at gmail.com
Thu Oct 6 04:44:55 PDT 2011


>accepting -march=iwmmxt on x86 is a bug in GCC

"-march" just tells gcc for what processor it has to generate the code. It
does not matter what processor the computer actually has. I mean, it's ok to
compile code for ARM on x86 computer, or the other way around.


On Thu, Oct 6, 2011 at 2:15 PM, Søren Sandmann <sandmann at cs.au.dk> wrote:

> Matt Turner <mattst88 at gmail.com> writes:
>
> > I'm not able to reproduce it, but I have two reports that iwMMXt is
> > incorrectly detected on x86 and amd64. This happens because it uses the
> > standard _mm_* intrinsic functions. It should fail on x86 and amd64
> > because configure will use -march=iwmmxt to compile the test, which
> > isn't a valid option on these platforms.
> >
> > So, just #error out in the test if the __arm__ preprocessor directive
> > isn't defined.
>
> Looks good to me, though presumably accepting -march=iwmmxt on x86 is a
> bug in GCC. Also, looking at this again, isn't there a typo in the
> compiler check:
>
>    #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 3 &&
> __GNUC_MINOR__ < 6))
>    #error "Need GCC >= 4.6 for IWMMXT intrinsics"
>    #endif
>
> where __GNUC__ == 3 should be __GNUC__ == 4?
>
>
> Soren
>
> > Fixes https://bugs.gentoo.org/show_bug.cgi?id=385179
> >
> > Signed-off-by: Matt Turner <mattst88 at gmail.com>
> > ---
> >  configure.ac |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 481d0bb..471a127 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -552,6 +552,9 @@ AC_MSG_CHECKING(whether to use ARM IWMMXT intrinsics)
> >  xserver_save_CFLAGS=$CFLAGS
> >  CFLAGS="$IWMMXT_CFLAGS $CFLAGS"
> >  AC_COMPILE_IFELSE([
> > +#ifndef __arm__
> > +#error "IWMMXT is only available on ARM"
> > +#endif
> >  #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 3 &&
> __GNUC_MINOR__ < 6))
> >  #error "Need GCC >= 4.6 for IWMMXT intrinsics"
> >  #endif
> _______________________________________________
> Pixman mailing list
> Pixman at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pixman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pixman/attachments/20111006/2be4304b/attachment.html>


More information about the Pixman mailing list