public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Ralph Loader <suckfish@ihug.co.nz>,
	  GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix for PR 37809 and 37807
Date: Wed, 22 Oct 2008 17:13:00 -0000	[thread overview]
Message-ID: <48FF3CA0.6030405@gmail.com> (raw)

Hello!

> diff --git a/gcc/testsuite/gcc.target/i386/mmx-8.c b/gcc/testsuite/gcc.target/i386/mmx-8.c
> new file mode 100644
> index 0000000..9d665f0
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/i386/mmx-8.c
> @@ -0,0 +1,136 @@
> +/* PR middle-end/37809 */
> +
> +/* { dg-do run } */
> +/* { dg-options "-O2 -mmmx" } */
> +
> +#include <mmintrin.h>
> +
> +// Various tests of cases where it is incorrect to optimise vectors as if they
> +// were integers of the same width.
> +
> +extern void abort (void);
> +
> +/* #include <stdio.h> */
> +/* #define FAIL(...) printf (__VA_ARGS__); */
> +#define FAIL(...) abort();
>   

Please remove the definitions above and simply call abort() at FAIL 
site. Alternatively, you can check for DEBUG definition to enable 
additional debug information (see i.e. gcc.target/i386/mmx-4.c)

> +
> +
> +void Sshift()
> +{
> +    volatile __m64 y = (__m64) 0xffffffffll;
> +    __m64 x = y & (__m64) 0xffffffffll;
> +    x = _m_psradi (x, 1);
> +    x &= (__m64) 0x80000000ll;
> +    if (0 == (long long) x)
>   

Aliasing violation on x variable. You should use union here and through 
the source. You should check your testcase with -Wstrict-aliasing {,=n}.

> +int main()
> +{
> +    Sshift();
> +    shiftU1();
> +    shiftU2();
> +    shiftU3();
> +    shiftU4();
> +    add();
> +    add2();
> +
> +    mult1();
> +    mult2();
> +    mult3();
> +    div();
> +    return 0;
> +}
>   

Please note, that since this is MMX runtime testcase, you should check 
for MMX support at runtime. Please look into 
gcc.target/i386/builtin-apply-mmx.c or gcc.target/i386/mmx-4.c how to 
use support for runtime check, as present in mmx-check.h header.

Thanks,
Uros.

             reply	other threads:[~2008-10-22 14:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-22 17:13 Uros Bizjak [this message]
2008-10-22 17:38 ` Andreas Schwab
2008-10-22 18:26   ` Uros Bizjak
  -- strict thread matches above, loose matches on Subject: below --
2008-10-22  8:36 Ralph Loader
2008-10-22 10:42 ` Richard Guenther
2008-11-05  7:57   ` Ralph Loader
2008-11-05  9:21     ` Richard Guenther
2008-11-13 21:52       ` Kaveh R. GHAZI
2008-11-13 22:43         ` Uros Bizjak
2008-11-13 22:54         ` Uros Bizjak
2008-11-19 20:32           ` Kaveh R. Ghazi
2008-10-22 13:49 ` Paolo Bonzini

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=48FF3CA0.6030405@gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=suckfish@ihug.co.nz \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).