diff mbox series

[committed] d: Merge upstream dmd 3a9790525

Message ID 20201012101722.3306413-1-ibuclaw@gdcproject.org
State New
Headers show
Series [committed] d: Merge upstream dmd 3a9790525 | expand

Commit Message

Iain Buclaw Oct. 12, 2020, 10:17 a.m. UTC
Hi,

This patch merges the D front-end implementation with upstream dmd
3a9790525.  Fixes the return codes to match the documentation of
Target::isVectorTypeSupported.

Bootstrapped and regression tested on x86_64-linux-gnu, and committed to
mainline.

Regards,
Iain.

---
gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 3a9790525
	* d-target.cc (Target::isVectorTypeSupported): Adjust return codes for
	invalid size and invalid base type.
---
 gcc/d/d-target.cc | 6 +++---
 gcc/d/dmd/MERGE   | 2 +-
 gcc/d/dmd/mtype.c | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/gcc/d/d-target.cc b/gcc/d/d-target.cc
index 4a38cca56b4..78f14203b5c 100644
--- a/gcc/d/d-target.cc
+++ b/gcc/d/d-target.cc
@@ -241,7 +241,7 @@  Target::isVectorTypeSupported (int sz, Type *type)
 {
   /* Size must be greater than zero, and a power of two.  */
   if (sz <= 0 || sz & (sz - 1))
-    return 2;
+    return 3;
 
   /* __vector(void[]) is treated same as __vector(ubyte[])  */
   if (type == Type::tvoid)
@@ -249,7 +249,7 @@  Target::isVectorTypeSupported (int sz, Type *type)
 
   /* No support for non-trivial types, complex types, or booleans.  */
   if (!type->isTypeBasic () || type->iscomplex () || type->ty == Tbool)
-    return 3;
+    return 2;
 
   /* In [simd/vector extensions], which vector types are supported depends on
      the target.  The implementation is expected to only support the vector
@@ -258,7 +258,7 @@  Target::isVectorTypeSupported (int sz, Type *type)
   tree ctype = build_vector_type (build_ctype (type), nunits);
 
   if (!targetm.vector_mode_supported_p (TYPE_MODE (ctype)))
-    return 3;
+    return 2;
 
   return 0;
 }
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index 4676645f971..8a59cbde78e 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -1,4 +1,4 @@ 
-e49192807967c6f11252683a731c5a0159ef36da
+3a979052509fff8170ba80e48817377a60e78eb3
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
diff --git a/gcc/d/dmd/mtype.c b/gcc/d/dmd/mtype.c
index 36471557dfc..bc66be028c1 100644
--- a/gcc/d/dmd/mtype.c
+++ b/gcc/d/dmd/mtype.c
@@ -3824,12 +3824,12 @@  Type *TypeVector::semantic(Loc loc, Scope *sc)
     case 1: // no support at all
         error(loc, "SIMD vector types not supported on this platform");
         return terror;
-    case 2: // invalid size
-        error(loc, "%d byte vector type %s is not supported on this platform", sz, toChars());
-        return terror;
-    case 3: // invalid base type
+    case 2: // invalid base type
         error(loc, "vector type %s is not supported on this platform", toChars());
         return terror;
+    case 3: // invalid size
+        error(loc, "%d byte vector type %s is not supported on this platform", sz, toChars());
+        return terror;
     default:
         assert(0);
     }