extern vector long long l8; l8 = vec_mul (l3, l4);
extern vector unsigned long long u6; u6 = vec_mul (u3, u4);
- extern vector double dh; dh = vec_ctf (la, -2);
+ extern vector double dh; dh = vec_ctf (la, 2);
extern vector double di; di = vec_ctf (ua, 2);
extern vector int sz; sz = vec_cts (fa, 0x1F);
- extern vector long long l9; l9 = vec_cts (dh, -2);
+ extern vector long long l9; l9 = vec_cts (dh, 2);
extern vector unsigned long long u7; u7 = vec_ctu (di, 2);
extern vector unsigned int usz; usz = vec_ctu (fa, 0x1F);
|| ue[0] != 27L || ue[1] != 27L || uf[0] != 14L || uf[1] != 14L)
abort ();
- vector double da = vec_ctf (sa, -2);
+ vector double da = vec_ctf (sa, 2);
vector double db = vec_ctf (ua, 2);
- vector long long sg = vec_cts (da, -2);
+ vector long long sg = vec_cts (da, 2);
vector unsigned long long ug = vec_ctu (db, 2);
- if (da[0] != 108.0 || da[1] != -56.0 || db[0] != 6.75 || db[1] != 3.5
+ if (da[0] != 6.75 || da[1] != -3.5 || db[0] != 6.75 || db[1] != 3.5
|| sg[0] != 27L || sg[1] != -14L || ug[0] != 27L || ug[1] != 14L)
abort ();
--- /dev/null
+/* { dg-do compile */
+/* { dg-require-effective-target p8vector_ok } */
+/* { dg-options "-mdejagnu-cpu=power8" } */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <altivec.h>
+
+vector double retd;
+vector float retf;
+vector signed int retsi;
+
+void test_int(vector signed int a, const int b)
+{
+ retf = vec_ctf(a,b); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,-1); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,-31); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,-32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,1);
+ retf = vec_ctf(a,31);
+ retf = vec_ctf(a,32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,42); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+}
+
+void test_uint(vector unsigned int a, const int b)
+{
+ retf = vec_ctf(a,b); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,-1); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,-31); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,-32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,1);
+ retf = vec_ctf(a,31);
+ retf = vec_ctf(a,32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retf = vec_ctf(a,42); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+}
+
+void test_longlong(vector signed long long a, const int b,int x)
+{
+ retd = vec_ctf(a,b); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,-1); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,-31); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,-32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,1);
+ retd = vec_ctf(a,31);
+ retd = vec_ctf(a,32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,42); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+}
+
+void test_ulonglong(vector unsigned long long a, const int b,int x)
+{
+ retd = vec_ctf(a,b); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,-1); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,-31); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,-32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,1);
+ retd = vec_ctf(a,31);
+ retd = vec_ctf(a,32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retd = vec_ctf(a,42); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+}
+
+
+void test_cts_1(vector float a, const int b)
+{
+ retsi = vec_cts(a,b); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retsi = vec_cts(a,-1); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retsi = vec_cts(a,-31); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retsi = vec_cts(a,-32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retsi = vec_cts(a,1);
+ retsi = vec_cts(a,31);
+ retsi = vec_cts(a,32); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+ retsi = vec_cts(a,42); /* { dg-error "argument 2 must be a 5-bit unsigned literal" } */
+}
+