diff options
author | Jack Carter <jack.carter@imgtec.com> | 2013-08-15 15:16:57 +0000 |
---|---|---|
committer | Jack Carter <jack.carter@imgtec.com> | 2013-08-15 15:16:57 +0000 |
commit | 24bef98f9685e8724fe3a2a72f7e013502a0fbb6 (patch) | |
tree | 85bd24c418052868a6321ab95cbee07eaf7cc3bb | |
parent | 51f358209f6104eee25296b3bb5b5c9ad7e57dee (diff) | |
download | bcm5719-llvm-24bef98f9685e8724fe3a2a72f7e013502a0fbb6.tar.gz bcm5719-llvm-24bef98f9685e8724fe3a2a72f7e013502a0fbb6.zip |
[Mips][msa] Add support for half
Add support for half (a.k.a. __fp16) in builtin descriptions.
The second argument to BUILTIN() now accepts 'h' to represent half.
Patch by Daniel Sanders
llvm-svn: 188464
-rw-r--r-- | clang/include/clang/Basic/Builtins.def | 1 | ||||
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/clang/include/clang/Basic/Builtins.def b/clang/include/clang/Basic/Builtins.def index 906c2c0e28d..ad39bd7c0b9 100644 --- a/clang/include/clang/Basic/Builtins.def +++ b/clang/include/clang/Basic/Builtins.def @@ -25,6 +25,7 @@ // c -> char // s -> short // i -> int +// h -> half // f -> float // d -> double // z -> size_t diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index f38a24811bc..29ddb37525d 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -7552,6 +7552,11 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context, "Bad modifiers used with 'v'!"); Type = Context.VoidTy; break; + case 'h': + assert(HowLong == 0 && !Signed && !Unsigned && + "Bad modifiers used with 'f'!"); + Type = Context.HalfTy; + break; case 'f': assert(HowLong == 0 && !Signed && !Unsigned && "Bad modifiers used with 'f'!"); |