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;
}
--- /dev/null
+/* { 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 } } */