aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2023-03-03 00:00:44 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2023-03-03 01:25:45 +0100
commit929c6b8cd12a3bd338a4c250274a9d86da5b2ea7 (patch)
tree44cc9a476333506c4dbecff672f3b91446af7727 /gcc/testsuite/gdc.dg
parentce1cea3e22f58bbddde017f8a92e59bae8892339 (diff)
downloadgcc-929c6b8cd12a3bd338a4c250274a9d86da5b2ea7.zip
gcc-929c6b8cd12a3bd338a4c250274a9d86da5b2ea7.tar.gz
gcc-929c6b8cd12a3bd338a4c250274a9d86da5b2ea7.tar.bz2
d: Allow vectors to be compared for identity [PR108946]
Vector equality and comparisons are now accepted by the language implementation, but identity wasn't. Implement it as an extra integer comparison of the bit-casted bitmask. PR d/108946 gcc/d/ChangeLog: * d-target.cc (Target::isVectorOpSupported): Allow identity ops. * expr.cc (ExprVisitor::visit (IdentityExp *)): Handle vector identity comparisons. gcc/testsuite/ChangeLog: * gdc.dg/simd2a.d: Update test. * gdc.dg/simd2b.d: Likewise. * gdc.dg/simd2c.d: Likewise. * gdc.dg/simd2d.d: Likewise. * gdc.dg/simd2e.d: Likewise. * gdc.dg/simd2f.d: Likewise. * gdc.dg/simd2g.d: Likewise. * gdc.dg/simd2h.d: Likewise. * gdc.dg/simd2i.d: Likewise. * gdc.dg/simd2j.d: Likewise.
Diffstat (limited to 'gcc/testsuite/gdc.dg')
-rw-r--r--gcc/testsuite/gdc.dg/simd2a.d5
-rw-r--r--gcc/testsuite/gdc.dg/simd2b.d5
-rw-r--r--gcc/testsuite/gdc.dg/simd2c.d5
-rw-r--r--gcc/testsuite/gdc.dg/simd2d.d5
-rw-r--r--gcc/testsuite/gdc.dg/simd2e.d5
-rw-r--r--gcc/testsuite/gdc.dg/simd2f.d5
-rw-r--r--gcc/testsuite/gdc.dg/simd2g.d5
-rw-r--r--gcc/testsuite/gdc.dg/simd2h.d5
-rw-r--r--gcc/testsuite/gdc.dg/simd2i.d5
-rw-r--r--gcc/testsuite/gdc.dg/simd2j.d5
10 files changed, 30 insertions, 20 deletions
diff --git a/gcc/testsuite/gdc.dg/simd2a.d b/gcc/testsuite/gdc.dg/simd2a.d
index 373d5d1..d47175f 100644
--- a/gcc/testsuite/gdc.dg/simd2a.d
+++ b/gcc/testsuite/gdc.dg/simd2a.d
@@ -5,6 +5,7 @@ import core.simd;
void test2a()
{
byte16 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2a()
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
diff --git a/gcc/testsuite/gdc.dg/simd2b.d b/gcc/testsuite/gdc.dg/simd2b.d
index e72da0d..a1b2a10 100644
--- a/gcc/testsuite/gdc.dg/simd2b.d
+++ b/gcc/testsuite/gdc.dg/simd2b.d
@@ -5,6 +5,7 @@ import core.simd;
void test2b()
{
ubyte16 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2b()
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
diff --git a/gcc/testsuite/gdc.dg/simd2c.d b/gcc/testsuite/gdc.dg/simd2c.d
index dc4954e..ca8d100 100644
--- a/gcc/testsuite/gdc.dg/simd2c.d
+++ b/gcc/testsuite/gdc.dg/simd2c.d
@@ -5,6 +5,7 @@ import core.simd;
void test2c()
{
short8 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2c()
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
diff --git a/gcc/testsuite/gdc.dg/simd2d.d b/gcc/testsuite/gdc.dg/simd2d.d
index 2d782ba..e928d4b 100644
--- a/gcc/testsuite/gdc.dg/simd2d.d
+++ b/gcc/testsuite/gdc.dg/simd2d.d
@@ -5,6 +5,7 @@ import core.simd;
void test2d()
{
ushort8 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2d()
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
diff --git a/gcc/testsuite/gdc.dg/simd2e.d b/gcc/testsuite/gdc.dg/simd2e.d
index b6d4ed6..a611ea7 100644
--- a/gcc/testsuite/gdc.dg/simd2e.d
+++ b/gcc/testsuite/gdc.dg/simd2e.d
@@ -5,6 +5,7 @@ import core.simd;
void test2e()
{
int4 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2e()
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
diff --git a/gcc/testsuite/gdc.dg/simd2f.d b/gcc/testsuite/gdc.dg/simd2f.d
index df8f13f..1e9d6c2 100644
--- a/gcc/testsuite/gdc.dg/simd2f.d
+++ b/gcc/testsuite/gdc.dg/simd2f.d
@@ -5,6 +5,7 @@ import core.simd;
void test2f()
{
uint4 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2f()
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
diff --git a/gcc/testsuite/gdc.dg/simd2g.d b/gcc/testsuite/gdc.dg/simd2g.d
index 028b25e..7183304 100644
--- a/gcc/testsuite/gdc.dg/simd2g.d
+++ b/gcc/testsuite/gdc.dg/simd2g.d
@@ -5,6 +5,7 @@ import core.simd;
void test2g()
{
long2 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2g()
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
diff --git a/gcc/testsuite/gdc.dg/simd2h.d b/gcc/testsuite/gdc.dg/simd2h.d
index 6c3e91a..8c55e01 100644
--- a/gcc/testsuite/gdc.dg/simd2h.d
+++ b/gcc/testsuite/gdc.dg/simd2h.d
@@ -5,6 +5,7 @@ import core.simd;
void test2h()
{
ulong2 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2h()
v1 = v2 ^ v3;
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
diff --git a/gcc/testsuite/gdc.dg/simd2i.d b/gcc/testsuite/gdc.dg/simd2i.d
index 2fa7f3a..d9ff688 100644
--- a/gcc/testsuite/gdc.dg/simd2i.d
+++ b/gcc/testsuite/gdc.dg/simd2i.d
@@ -5,6 +5,7 @@ import core.simd;
void test2i()
{
float4 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2i()
static assert(!__traits(compiles, v1 ^ v2));
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));
diff --git a/gcc/testsuite/gdc.dg/simd2j.d b/gcc/testsuite/gdc.dg/simd2j.d
index 7c2d12f..a84120f 100644
--- a/gcc/testsuite/gdc.dg/simd2j.d
+++ b/gcc/testsuite/gdc.dg/simd2j.d
@@ -5,6 +5,7 @@ import core.simd;
void test2j()
{
double2 v1, v2 = 1, v3 = 1;
+ bool b1;
v1 = v2;
v1 = v2 + v3;
v1 = v2 - v3;
@@ -16,8 +17,8 @@ void test2j()
static assert(!__traits(compiles, v1 ^ v2));
static assert(!__traits(compiles, v1 ~ v2));
static assert(!__traits(compiles, v1 ^^ v2));
- static assert(!__traits(compiles, v1 is v2));
- static assert(!__traits(compiles, v1 !is v2));
+ b1 = v1 is v2;
+ b1 = v1 !is v2;
static assert( __traits(compiles, v1 == v2));
static assert( __traits(compiles, v1 != v2));
static assert( __traits(compiles, v1 < v2));