diff options
author | Qiu Chaofan <qiucofan@cn.ibm.com> | 2021-09-06 17:49:23 +0800 |
---|---|---|
committer | Qiu Chaofan <qiucofan@cn.ibm.com> | 2021-09-06 18:00:58 +0800 |
commit | fae0dfa6421ea6c02f86ba7292fa782e1e2b69d1 (patch) | |
tree | 709fcdac25195781a15660d74e8588a1707248df /clang/lib/Parse/ParseDecl.cpp | |
parent | 96f6785bc9fe3219e9486ff09b22b31fa0c73b34 (diff) | |
download | llvm-fae0dfa6421ea6c02f86ba7292fa782e1e2b69d1.zip llvm-fae0dfa6421ea6c02f86ba7292fa782e1e2b69d1.tar.gz llvm-fae0dfa6421ea6c02f86ba7292fa782e1e2b69d1.tar.bz2 |
[Clang] Add __ibm128 type to represent ppc_fp128
Currently, we have no front-end type for ppc_fp128 type in IR. PowerPC
target generates ppc_fp128 type from long double now, but there's option
(-mabi=(ieee|ibm)longdouble) to control it and we're going to do
transition from IBM extended double-double ppc_fp128 to IEEE fp128 in
the future.
This patch adds type __ibm128 which always represents ppc_fp128 in IR,
as what GCC did for that type. Without this type in Clang, compilation
will fail if compiling against future version of libstdcxx (which uses
__ibm128 in headers).
Although all operations in backend for __ibm128 is done by software,
only PowerPC enables support for it.
There's something not implemented in this commit, which can be done in
future ones:
- Literal suffix for __ibm128 type. w/W is suitable as GCC documented.
- __attribute__((mode(IF))) should be for __ibm128.
- Complex __ibm128 type.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D93377
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 7cec896..9f660e4 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -3929,6 +3929,10 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, isInvalid = DS.SetTypeSpecType(DeclSpec::TST_float128, Loc, PrevSpec, DiagID, Policy); break; + case tok::kw___ibm128: + isInvalid = DS.SetTypeSpecType(DeclSpec::TST_ibm128, Loc, PrevSpec, + DiagID, Policy); + break; case tok::kw_wchar_t: isInvalid = DS.SetTypeSpecType(DeclSpec::TST_wchar, Loc, PrevSpec, DiagID, Policy); @@ -5007,6 +5011,7 @@ bool Parser::isKnownToBeTypeSpecifier(const Token &Tok) const { case tok::kw__Fract: case tok::kw__Float16: case tok::kw___float128: + case tok::kw___ibm128: case tok::kw_bool: case tok::kw__Bool: case tok::kw__Decimal32: @@ -5088,6 +5093,7 @@ bool Parser::isTypeSpecifierQualifier() { case tok::kw__Fract: case tok::kw__Float16: case tok::kw___float128: + case tok::kw___ibm128: case tok::kw_bool: case tok::kw__Bool: case tok::kw__Decimal32: @@ -5258,6 +5264,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) { case tok::kw__Fract: case tok::kw__Float16: case tok::kw___float128: + case tok::kw___ibm128: case tok::kw_bool: case tok::kw__Bool: case tok::kw__Decimal32: |