From 146522ec40ebc21a8c826e8bac98befaf91504cb Mon Sep 17 00:00:00 2001 From: Jack Carter Date: Thu, 15 Aug 2013 15:16:57 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188464 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Builtins.def | 1 + lib/AST/ASTContext.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def index 906c2c0e28..ad39bd7c0b 100644 --- a/include/clang/Basic/Builtins.def +++ b/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/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index f38a24811b..29ddb37525 100644 --- a/lib/AST/ASTContext.cpp +++ b/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'!"); -- 2.40.0