Commit 31ebe593 by H.J. Lu Committed by H.J. Lu

i386.c (ix86_expand_vector_init_one_var): Use ix86_expand_vector_set on V16QImode for SSE4.1.

gcc/

2008-05-21  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386.c (ix86_expand_vector_init_one_var): Use
	ix86_expand_vector_set on V16QImode for SSE4.1.

gcc/testsuite/

2008-05-21  H.J. Lu  <hongjiu.lu@intel.com>

	* gcc.target/i386/m128-check.h (ARRAY_SIZE): New.
	(CHECK_EXP): Use it.

	* gcc.target/i386/set-v16qi-3.h: New.
	* gcc.target/i386/sse2-set-v16qi-3.c: Likewise.
	* gcc.target/i386/sse4_1-set-v16qi-3.c: Likewise.

From-SVN: r135750
parent c24d4112
2008-05-21 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_expand_vector_init_one_var): Use
ix86_expand_vector_set on V16QImode for SSE4.1.
2008-05-21 Tom Tromey <tromey@redhat.com>
* c.opt (Wimport): Mark as undocumented.
......
......@@ -23818,6 +23818,8 @@ ix86_expand_vector_init_one_var (bool mmx_ok, enum machine_mode mode,
break;
case V16QImode:
if (TARGET_SSE4_1)
break;
wmode = V8HImode;
goto widen;
case V8QImode:
......
2008-05-21 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/m128-check.h (ARRAY_SIZE): New.
(CHECK_EXP): Use it.
* gcc.target/i386/set-v16qi-3.h: New.
* gcc.target/i386/sse2-set-v16qi-3.c: Likewise.
* gcc.target/i386/sse4_1-set-v16qi-3.c: Likewise.
2008-05-21 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/36287
......
......@@ -37,6 +37,10 @@ typedef union
double a[2];
} union128d;
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(A) (sizeof (A) / sizeof ((A)[0]))
#endif
#ifdef DEBUG
#define PRINTF printf
#else
......@@ -51,7 +55,7 @@ check_##UINON_TYPE (UINON_TYPE u, const VALUE_TYPE *v) \
int i; \
int err = 0; \
\
for (i = 0; i < sizeof (u.a) / sizeof (u.a[0]); i++) \
for (i = 0; i < ARRAY_SIZE (u.a); i++) \
if (u.a[i] != v[i]) \
{ \
err++; \
......
#include CHECK_H
static __m128i
__attribute__((noinline))
foo (char x, int i)
{
switch (i)
{
case 15:
return _mm_set_epi8 (x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
case 14:
return _mm_set_epi8 (1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
case 13:
return _mm_set_epi8 (1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
case 12:
return _mm_set_epi8 (1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
case 11:
return _mm_set_epi8 (1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
case 10:
return _mm_set_epi8 (1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
case 9:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1);
case 8:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1);
case 7:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1);
case 6:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1);
case 5:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1);
case 4:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1);
case 3:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1);
case 2:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1);
case 1:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1);
case 0:
return _mm_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x);
default:
abort ();
}
}
static void
TEST (void)
{
char e = 0x13;
char v[16];
union128i_b u;
int i, j;
for (i = 0; i < ARRAY_SIZE (v); i++)
{
for (j = 0; j < ARRAY_SIZE (v); j++)
v[j] = 1;
v[i] = e;
u.x = foo (e, i);
if (check_union128i_b (u, v))
abort ();
}
}
/* { dg-do run } */
/* { dg-options "-O2 -msse2" } */
#define CHECK_H "sse2-check.h"
#define TEST sse2_test
#include "set-v16qi-3.h"
/* { dg-do run } */
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
#define CHECK_H "sse4_1-check.h"
#define TEST sse4_1_test
#include "set-v16qi-3.h"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment