[PowerPC]Activate "vector bool long long" (and alternate spellings) as a valid type for Altivec support for Power.

There are two test case updates for very basic testing. While I was editing cxx-altivec.cpp I also updated it to better match some other changes in altivec.c.

Note: "vector bool long" was not also added because its use is considered deprecated.

http://reviews.llvm.org/D7235

llvm-svn: 231118
This commit is contained in:
Bill Seurer 2015-03-03 20:08:43 +00:00
parent f0f5e46e07
commit 2351bec3ea
4 changed files with 32 additions and 7 deletions

View File

@ -353,6 +353,9 @@ def err_invalid_vector_bool_decl_spec : Error<
"cannot use '%0' with '__vector bool'">; "cannot use '%0' with '__vector bool'">;
def err_invalid_vector_double_decl_spec : Error < def err_invalid_vector_double_decl_spec : Error <
"use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)">; "use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)">;
def err_invalid_vector_long_long_decl_spec : Error <
"use of 'long long' with '__vector bool' requires VSX support to be enabled "
"(available on the POWER7 or later)">;
def err_invalid_vector_long_double_decl_spec : Error< def err_invalid_vector_long_double_decl_spec : Error<
"cannot use 'long double' with '__vector'">; "cannot use 'long double' with '__vector'">;
def warn_vector_long_decl_spec_combination : Warning< def warn_vector_long_decl_spec_combination : Warning<

View File

@ -982,11 +982,16 @@ void DeclSpec::Finish(DiagnosticsEngine &D, Preprocessor &PP, const PrintingPoli
getSpecifierName((TST)TypeSpecType, Policy)); getSpecifierName((TST)TypeSpecType, Policy));
} }
// Only 'short' is valid with vector bool. (PIM 2.1) // Only 'short' and 'long long' are valid with vector bool. (PIM 2.1)
if ((TypeSpecWidth != TSW_unspecified) && (TypeSpecWidth != TSW_short)) if ((TypeSpecWidth != TSW_unspecified) && (TypeSpecWidth != TSW_short) &&
(TypeSpecWidth != TSW_longlong))
Diag(D, TSWLoc, diag::err_invalid_vector_bool_decl_spec) Diag(D, TSWLoc, diag::err_invalid_vector_bool_decl_spec)
<< getSpecifierName((TSW)TypeSpecWidth); << getSpecifierName((TSW)TypeSpecWidth);
// vector bool long long requires VSX support.
if ((TypeSpecWidth == TSW_longlong) && (!PP.getTargetInfo().hasFeature("vsx")))
Diag(D, TSTLoc, diag::err_invalid_vector_long_long_decl_spec);
// Elements of vector bool are interpreted as unsigned. (PIM 2.1) // Elements of vector bool are interpreted as unsigned. (PIM 2.1)
if ((TypeSpecType == TST_char) || (TypeSpecType == TST_int) || if ((TypeSpecType == TST_char) || (TypeSpecType == TST_int) ||
(TypeSpecWidth != TSW_unspecified)) (TypeSpecWidth != TSW_unspecified))

View File

@ -20,7 +20,7 @@ __vector bool short vv_bs;
__vector bool int vv_bi; __vector bool int vv_bi;
__vector __bool char vv___bc; __vector __bool char vv___bc;
__vector __bool short vv___bs; __vector __bool short vv___bs;
__vector __bool int vv_bi; __vector __bool int vv___bi;
__vector __pixel vv_p; __vector __pixel vv_p;
__vector pixel vv__p; __vector pixel vv__p;
__vector int vf__r(); __vector int vf__r();
@ -75,6 +75,10 @@ vector __bool v___b; // expected-warning {{type specifier missing
// These should have errors. // These should have errors.
__vector double vv_d1; // expected-error {{use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)}} __vector double vv_d1; // expected-error {{use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)}}
vector double v_d2; // expected-error {{use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)}} vector double v_d2; // expected-error {{use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)}}
__vector bool long long v_bll1; // expected-error {{use of 'long long' with '__vector bool' requires VSX support to be enabled (available on the POWER7 or later)}}
__vector __bool long long v_bll2; // expected-error {{use of 'long long' with '__vector bool' requires VSX support to be enabled (available on the POWER7 or later)}}
vector bool long long v_bll3; // expected-error {{use of 'long long' with '__vector bool' requires VSX support to be enabled (available on the POWER7 or later)}}
vector __bool long long v_bll4; // expected-error {{use of 'long long' with '__vector bool' requires VSX support to be enabled (available on the POWER7 or later)}}
__vector long double vv_ld3; // expected-error {{cannot use 'long double' with '__vector'}} __vector long double vv_ld3; // expected-error {{cannot use 'long double' with '__vector'}}
vector long double v_ld4; // expected-error {{cannot use 'long double' with '__vector'}} vector long double v_ld4; // expected-error {{cannot use 'long double' with '__vector'}}
vector bool float v_bf; // expected-error {{cannot use 'float' with '__vector bool'}} vector bool float v_bf; // expected-error {{cannot use 'float' with '__vector bool'}}
@ -83,14 +87,12 @@ vector bool pixel v_bp; // expected-error {{cannot use '__pixel' wi
vector bool signed char v_bsc; // expected-error {{cannot use 'signed' with '__vector bool'}} vector bool signed char v_bsc; // expected-error {{cannot use 'signed' with '__vector bool'}}
vector bool unsigned int v_bsc2; // expected-error {{cannot use 'unsigned' with '__vector bool'}} vector bool unsigned int v_bsc2; // expected-error {{cannot use 'unsigned' with '__vector bool'}}
vector bool long v_bl; // expected-error {{cannot use 'long' with '__vector bool'}} vector bool long v_bl; // expected-error {{cannot use 'long' with '__vector bool'}}
vector bool long long v_bll; // expected-error {{cannot use 'long long' with '__vector bool'}}
vector __bool float v___bf; // expected-error {{cannot use 'float' with '__vector bool'}} vector __bool float v___bf; // expected-error {{cannot use 'float' with '__vector bool'}}
vector __bool double v___bd; // expected-error {{cannot use 'double' with '__vector bool'}} vector __bool double v___bd; // expected-error {{cannot use 'double' with '__vector bool'}}
vector __bool pixel v___bp; // expected-error {{cannot use '__pixel' with '__vector bool'}} vector __bool pixel v___bp; // expected-error {{cannot use '__pixel' with '__vector bool'}}
vector __bool signed char v___bsc; // expected-error {{cannot use 'signed' with '__vector bool'}} vector __bool signed char v___bsc; // expected-error {{cannot use 'signed' with '__vector bool'}}
vector __bool unsigned int v___bsc2; // expected-error {{cannot use 'unsigned' with '__vector bool'}} vector __bool unsigned int v___bsc2; // expected-error {{cannot use 'unsigned' with '__vector bool'}}
vector __bool long v___bl; // expected-error {{cannot use 'long' with '__vector bool'}} vector __bool long v___bl; // expected-error {{cannot use 'long' with '__vector bool'}}
vector __bool long long v___bll; // expected-error {{cannot use 'long long' with '__vector bool'}}
// vector long is deprecated, but vector long long is not. // vector long is deprecated, but vector long long is not.
vector long long v_ll; vector long long v_ll;

View File

@ -18,6 +18,9 @@ __vector float vv_f;
__vector bool char vv_bc; __vector bool char vv_bc;
__vector bool short vv_bs; __vector bool short vv_bs;
__vector bool int vv_bi; __vector bool int vv_bi;
__vector __bool char vv___bc;
__vector __bool short vv___bs;
__vector __bool int vv___bi;
__vector __pixel vv_p; __vector __pixel vv_p;
__vector pixel vv__p; __vector pixel vv__p;
__vector int vf__r(); __vector int vf__r();
@ -40,6 +43,9 @@ vector float v_f;
vector bool char v_bc; vector bool char v_bc;
vector bool short v_bs; vector bool short v_bs;
vector bool int v_bi; vector bool int v_bi;
vector __bool char v___bc;
vector __bool short v___bs;
vector __bool int v___bi;
vector __pixel v_p; vector __pixel v_p;
vector pixel v__p; vector pixel v__p;
vector int f__r(); vector int f__r();
@ -67,6 +73,10 @@ vector long double v_ld; // expected-error {{cannot use 'long double'
// These should have errors. // These should have errors.
__vector double vv_d1; // expected-error {{use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)}} __vector double vv_d1; // expected-error {{use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)}}
vector double v_d2; // expected-error {{use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)}} vector double v_d2; // expected-error {{use of 'double' with '__vector' requires VSX support to be enabled (available on the POWER7 or later)}}
__vector bool long long v_bll1; // expected-error {{use of 'long long' with '__vector bool' requires VSX support to be enabled (available on the POWER7 or later)}}
__vector __bool long long v_bll2; // expected-error {{use of 'long long' with '__vector bool' requires VSX support to be enabled (available on the POWER7 or later)}}
vector bool long long v_bll3; // expected-error {{use of 'long long' with '__vector bool' requires VSX support to be enabled (available on the POWER7 or later)}}
vector __bool long long v_bll4; // expected-error {{use of 'long long' with '__vector bool' requires VSX support to be enabled (available on the POWER7 or later)}}
__vector long double vv_ld3; // expected-error {{cannot use 'long double' with '__vector'}} __vector long double vv_ld3; // expected-error {{cannot use 'long double' with '__vector'}}
vector long double v_ld4; // expected-error {{cannot use 'long double' with '__vector'}} vector long double v_ld4; // expected-error {{cannot use 'long double' with '__vector'}}
vector bool v_b; // expected-error {{C++ requires a type specifier for all declarations}} vector bool v_b; // expected-error {{C++ requires a type specifier for all declarations}}
@ -74,9 +84,14 @@ vector bool float v_bf; // expected-error {{cannot use 'float' with
vector bool double v_bd; // expected-error {{cannot use 'double' with '__vector bool'}} vector bool double v_bd; // expected-error {{cannot use 'double' with '__vector bool'}}
vector bool pixel v_bp; // expected-error {{cannot use '__pixel' with '__vector bool'}} vector bool pixel v_bp; // expected-error {{cannot use '__pixel' with '__vector bool'}}
vector bool signed char v_bsc; // expected-error {{cannot use 'signed' with '__vector bool'}} vector bool signed char v_bsc; // expected-error {{cannot use 'signed' with '__vector bool'}}
vector bool unsigned int v_bsc2; // expected-error {{cannot use 'unsigned' with '__vector bool'}} vector bool unsigned int v_bsc2; // expected-error {{cannot use 'unsigned' with '__vector bool'}}
vector bool long v_bl; // expected-error {{cannot use 'long' with '__vector bool'}} vector bool long v_bl; // expected-error {{cannot use 'long' with '__vector bool'}}
vector bool long long v_bll; // expected-error {{cannot use 'long long' with '__vector bool'}} vector __bool float v___bf; // expected-error {{cannot use 'float' with '__vector bool'}}
vector __bool double v___bd; // expected-error {{cannot use 'double' with '__vector bool'}}
vector __bool pixel v___bp; // expected-error {{cannot use '__pixel' with '__vector bool'}}
vector __bool signed char v___bsc; // expected-error {{cannot use 'signed' with '__vector bool'}}
vector __bool unsigned int v___bsc2; // expected-error {{cannot use 'unsigned' with '__vector bool'}}
vector __bool long v___bl; // expected-error {{cannot use 'long' with '__vector bool'}}
// vector long is deprecated, but vector long long is not. // vector long is deprecated, but vector long long is not.
vector long long v_ll; vector long long v_ll;