From 835cc85bdf1b8e629247a8a51c897781c1c916a9 Mon Sep 17 00:00:00 2001 From: JinShil Date: Thu, 4 Apr 2019 13:19:07 +0900 Subject: [PATCH] Advance 32 byte vector deprecation to error --- src/dmd/typesem.d | 10 ++-------- test/compilable/vector_types.d | 27 --------------------------- test/fail_compilation/vector_types.d | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 35 deletions(-) delete mode 100644 test/compilable/vector_types.d create mode 100644 test/fail_compilation/vector_types.d diff --git a/src/dmd/typesem.d b/src/dmd/typesem.d index d1291455bc62..d1680a89779e 100644 --- a/src/dmd/typesem.d +++ b/src/dmd/typesem.d @@ -661,14 +661,8 @@ extern(C++) Type typeSemantic(Type t, Loc loc, Scope* sc) case 3: // invalid size - if (sz == 32) - deprecation(loc, "%d byte vector types are only supported with -mcpu=avx", sz, mtype.toChars()); - else - { - .error(loc, "%d byte vector type `%s` is not supported on this platform", sz, mtype.toChars()); - return error(); - } - break; + .error(loc, "%d byte vector type `%s` is not supported on this platform", sz, mtype.toChars()); + return error(); } return merge(mtype); } diff --git a/test/compilable/vector_types.d b/test/compilable/vector_types.d deleted file mode 100644 index baa5bda5a2bd..000000000000 --- a/test/compilable/vector_types.d +++ /dev/null @@ -1,27 +0,0 @@ -/* -REQUIRED_ARGS: -o- -PERMUTE_ARGS: -TEST_OUTPUT: -DISABLED: freebsd32 linux32 osx32 win32 ---- -compilable/vector_types.d(22): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(22): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(23): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(23): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(24): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(24): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(25): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(25): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(26): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(26): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(27): Deprecation: 32 byte vector types are only supported with -mcpu=avx -compilable/vector_types.d(27): Deprecation: 32 byte vector types are only supported with -mcpu=avx ---- -*/ -version (D_SIMD): -alias a = __vector(double[4]); -alias b = __vector(float[8]); -alias c = __vector(ulong[4]); -alias d = __vector(uint[8]); -alias e = __vector(ushort[16]); -alias f = __vector(ubyte[32]); diff --git a/test/fail_compilation/vector_types.d b/test/fail_compilation/vector_types.d new file mode 100644 index 000000000000..36eb468d5fbb --- /dev/null +++ b/test/fail_compilation/vector_types.d @@ -0,0 +1,22 @@ +/* +REQUIRED_ARGS: -o- +PERMUTE_ARGS: +TEST_OUTPUT: +DISABLED: freebsd32 linux32 osx32 win32 +--- +fail_compilation/vector_types.d(16): Error: 32 byte vector type `__vector(double[4])` is not supported on this platform +fail_compilation/vector_types.d(17): Error: 32 byte vector type `__vector(float[8])` is not supported on this platform +fail_compilation/vector_types.d(18): Error: 32 byte vector type `__vector(ulong[4])` is not supported on this platform +fail_compilation/vector_types.d(19): Error: 32 byte vector type `__vector(uint[8])` is not supported on this platform +fail_compilation/vector_types.d(20): Error: 32 byte vector type `__vector(ushort[16])` is not supported on this platform +fail_compilation/vector_types.d(21): Error: 32 byte vector type `__vector(ubyte[32])` is not supported on this platform +--- +*/ +version (D_SIMD): +alias a = __vector(double[4]); +alias b = __vector(float[8]); +alias c = __vector(ulong[4]); +alias d = __vector(uint[8]); +alias e = __vector(ushort[16]); +alias f = __vector(ubyte[32]); +