d: Merge upstream dmd 3a9790525
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 11 Oct 2020 20:27:00 +0000 (22:27 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Mon, 12 Oct 2020 10:14:47 +0000 (12:14 +0200)
Fixes the return codes to match the documentation of
Target::isVectorTypeSupported.

Reviewed-on: https://github.com/dlang/dmd/pull/11830

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
gcc/d/dmd/MERGE
gcc/d/dmd/mtype.c

index 4a38cca56b4df200c9459b881bbfd4023cd90177..78f14203b5cc129e53eaaf5ef5ef9207491157f8 100644 (file)
@@ -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;
 }
index 4676645f9719117866eb357b1b37a2d57718b920..8a59cbde78e95b0b0e094a5ab7a5436827650a26 100644 (file)
@@ -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.
index 36471557dfcd6bbe586f25ab59cc492a63a4fa16..bc66be028c1d84cef36bfaa4c1d0ad85647e050a 100644 (file)
@@ -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);
     }