]> granicus.if.org Git - clang/commitdiff
[Mips][msa] Add support for half
authorJack Carter <jack.carter@imgtec.com>
Thu, 15 Aug 2013 15:16:57 +0000 (15:16 +0000)
committerJack Carter <jack.carter@imgtec.com>
Thu, 15 Aug 2013 15:16:57 +0000 (15:16 +0000)
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
lib/AST/ASTContext.cpp

index 906c2c0e28d97a7c1b7337dee3dae52a32cdb4ff..ad39bd7c0b967f8b1a1e2db479e88b74bba9dc47 100644 (file)
@@ -25,6 +25,7 @@
 //  c -> char
 //  s -> short
 //  i -> int
+//  h -> half
 //  f -> float
 //  d -> double
 //  z -> size_t
index f38a24811bc3a12bcbe7462fb6c0c5b6f49a62a7..29ddb37525dca5b6de1ca54d51e99dfd75a8fb10 100644 (file)
@@ -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'!");