User account creation filtered due to spam.

Bug 31585 - gcc.target/i386/sse-vect-types.c FAILs (also sse-13.c and sse-14.c)
Summary: gcc.target/i386/sse-vect-types.c FAILs (also sse-13.c and sse-14.c)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ssemmx
Depends on:
Blocks:
 
Reported: 2007-04-16 07:49 UTC by Uroš Bizjak
Modified: 2007-05-26 03:12 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uroš Bizjak 2007-04-16 07:49:18 UTC
These tests all start to fail after the fix for PR 31361 was committed to SVN. FAILing tests test SSE intrinsics by:

--quote--
/* Test that the intrinsics compile with optimization.  All of them are
   defined as inline functions in mmintrin.h that reference the proper
   builtin functions.  Defining away "static" and "__inline" results in
   all of them being compiled as proper functions.  */

#define static
#define __inline

#include <xmmintrin.h>
--/quote--


Following testcase illustrates the failure:

--cut here--
typedef short __v8hi __attribute__ ((__vector_size__ (16)));
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));

__m128i test (__m128i __A, const int __B)
{
  return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B);
}
--cut here--

gcc -O2 -msse2 test.c
test.c: In function âtestâ:
test.c:6: error: shift must be an immediate

(sse-13.c and sse-14.c fail on x86_64 only as it defaults to -msse2. On i386, these tests are compiled using -msse, so xmmintrin.h is not included).
Comment 1 Uroš Bizjak 2007-04-16 08:02:24 UTC
Proposed patch to macroize these functions in emmintrin.h (http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00096.html).

Please note that some other intrinsic functions, such as _mm_shuffle_ps() are defined as macro as well because of their check for constant arguments.
Comment 2 uros 2007-05-20 00:28:03 UTC
Subject: Bug 31585

Author: uros
Date: Sat May 19 23:27:48 2007
New Revision: 124861

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124861
Log:
        PR target/31585
        * config/i386/pmmintrin.h: Do not include xmmintrin.h
        * config/i386/xmmintrin.h (_mm_extract_pi16): Implement as always
        inlined function, not as a macro.
        (_mm_prefetch): Ditto.
        (_m_pextrw): Ditto.
        (_mm_insert_pi16): Ditto.
        (_m_pinsrw): Ditto.
        (_mm_shuffle_pi16): Ditto.  Add const to __N argument.
        (_m_pshufw): Ditto. Add const to __N argument.
        (_mm_shufle_ps): Ditto.  Add const to __mask argument.
        * config/i386/emmintrin.h (_mm_slli_epi16): Add const to __B argument.
        (_mm_slli_epi32): Ditto.
        (_mm_srli_si128): Implement as always inlined function, not as a macro.
        Add __inline to function declaration.
        (_mm_slli_si128): Ditto.

testsuite/ChangeLog:

        PR target/31585
        * gcc.target/i386/sse-13.c: Use -mssse3 and -msse4a compile options.
        (__builtin_ia32_psllwi128): Redefine to test with immediate operand.
        (__builtin_ia32_psrlqi128): Ditto.
        (__builtin_ia32_psrlwi128): Ditto.
        (__builtin_ia32_psrldi128): Ditto.
        (__builtin_ia32_psrldqi128): Ditto.
        (__builtin_ia32_pslldqi128): Ditto.
        (__builtin_ia32_psrawi128): Ditto.
        (__builtin_ia32_psradi128): Ditto.
        (__builtin_ia32_psllqi128): Ditto.
        (__builtin_ia32_pslldi128): Ditto.
        (__builtin_prefetch): Ditto.
        (__builtin_ia32_pshufw): Ditto.
        (__builtin_ia32_vec_set_v4hi): Ditto.
        (__builtin_ia32_vec_ext_v4hi): Ditto.
        (__builtin_ia32_shufps): Ditto.
        * gcc.target/i386/sse-14.c: Same changes as sse-13.c.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/emmintrin.h
    trunk/gcc/config/i386/pmmintrin.h
    trunk/gcc/config/i386/xmmintrin.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/i386/sse-13.c
    trunk/gcc/testsuite/gcc.target/i386/sse-14.c

Comment 3 uros 2007-05-20 10:54:38 UTC
Subject: Bug 31585

Author: uros
Date: Sun May 20 09:54:23 2007
New Revision: 124868

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124868
Log:
        PR target/31585
        * gcc.target/i386/sse-vect-types.c: Do not redefine "static"
        and "__inline".  Use "-msse" instead of "-msse2".


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/i386/sse-vect-types.c

Comment 4 Uroš Bizjak 2007-05-20 10:55:56 UTC
Fixed.