Commit 10e68fe4 by Carl Love Committed by Carl Love

p9-extract-1.c: Make second argument of vec_extract a signed int.

gcc/testsuite/ChangeLog:

2018-06-25  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/p9-extract-1.c: Make second argument of
 	vec_extract a signed int. Add vec_extract tests for bool char
	and bool int.
	* gcc.target/powerpc/p9-extract-4.c:  New test file for long long
	vec_extract tests.

From-SVN: r262023
parent ad111b8e
gcc/testsuite/ChangeLog:
2018-06-25 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/p9-extract-1.c: Make second argument of
vec_extract a signed int. Add vec_extract tests for bool char
and bool int.
* gcc.target/powerpc/p9-extract-4.c: New test file for long long
vec_extract tests.
2018-06-25 Tom de Vries <tdevries@suse.de>
* lib/gcc-gdb-test.exp (report_gdb): Handle gdb -v failure.
......
......@@ -13,84 +13,112 @@
int
extract_int_0 (vector int a)
{
int b = vec_extract (a, 0);
int c = 0;
int b = vec_extract (a, c);
return b;
}
int
extract_int_3 (vector int a)
{
int b = vec_extract (a, 3);
int c = 3;
int b = vec_extract (a, c);
return b;
}
unsigned int
extract_uint_0 (vector unsigned int a)
{
unsigned int b = vec_extract (a, 0);
int c = 0;
unsigned int b = vec_extract (a, c);
return b;
}
unsigned int
extract_uint_3 (vector unsigned int a)
{
unsigned int b = vec_extract (a, 3);
int c = 3;
unsigned int b = vec_extract (a, c);
return b;
}
short
extract_short_0 (vector short a)
{
short b = vec_extract (a, 0);
int c = 0;
short b = vec_extract (a, c);
return b;
}
short
extract_short_7 (vector short a)
{
short b = vec_extract (a, 7);
int c = 7;
short b = vec_extract (a, c);
return b;
}
unsigned short
extract_ushort_0 (vector unsigned short a)
{
unsigned short b = vec_extract (a, 0);
int c = 0;
unsigned short b = vec_extract (a, c);
return b;
}
unsigned short
extract_ushort_7 (vector unsigned short a)
{
unsigned short b = vec_extract (a, 7);
int c = 7;
unsigned short b = vec_extract (a, c);
return b;
}
signed char
extract_schar_0 (vector signed char a)
{
signed char b = vec_extract (a, 0);
int c = 0;
signed char b = vec_extract (a, c);
return b;
}
signed char
extract_schar_15 (vector signed char a)
{
signed char b = vec_extract (a, 15);
int c = 15;
signed char b = vec_extract (a, c);
return b;
}
unsigned char
extract_uchar_0 (vector unsigned char a)
{
unsigned char b = vec_extract (a, 0);
int c = 0;
unsigned char b = vec_extract (a, c);
return b;
}
unsigned char
extract_uchar_15 (vector unsigned char a)
{
signed char b = vec_extract (a, 15);
int c = 15;
signed char b = vec_extract (a, c);
return b;
}
unsigned char
extract_bool_char_0 (vector bool char a)
{
int c = 0;
unsigned char b = vec_extract (a, c);
return b;
}
unsigned int
extract_bool_int_0 (vector bool int a)
{
int c = 0;
unsigned int b = vec_extract (a, c);
return b;
}
......
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-options "-mcpu=power9 -O2" } */
/* This file tests the extraction of 64-bit values. On Power 9, the direct
move is prefered for the 64-bit extract as it is either lower latency or
the same latency as the extract instruction depending on the Endianess of
the system. Furthermore, there can be up to four move instructions in
flight at a time versus only two extract intructions at a time. */
#include <altivec.h>
unsigned long long
extract_bool_long_long_0 (vector bool long long a)
{
int c = 0;
unsigned long long b = vec_extract (a, c);
return b;
}
unsigned long long int
extract_long_long_0 (vector unsigned long long int a)
{
int c = 0;
unsigned long long int b = vec_extract (a, c);
return b;
}
/* { dg-final { scan-assembler-times "m\[ft\]vsr" 2 } } */
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