[PATCH] Adding type info for f16c floating-point type

Yunzhong Gao Yunzhong_Gao at playstation.sony.com
Wed Feb 12 17:11:13 PST 2014


ygao added you to the CC list for the revision "Adding type info for f16c floating-point type".

Hi,
The following patch adds support for half-precision floating point type supported by the clang front-end.
Native operations on this type is supported by OpenCL and to a limited extent by f16c (conversions are
supported); otherwise it is a storage-only type.
Could someone take a look whether this is good to go in?
- Gao.

http://llvm-reviews.chandlerc.com/D2750

Files:
  lib/CodeGen/CGRTTI.cpp
  test/CodeGenCXX/rtti-fundamental.cpp

Index: lib/CodeGen/CGRTTI.cpp
===================================================================
--- lib/CodeGen/CGRTTI.cpp
+++ lib/CodeGen/CGRTTI.cpp
@@ -969,7 +969,8 @@
                                   Context.UnsignedShortTy, Context.IntTy,
                                   Context.UnsignedIntTy, Context.LongTy, 
                                   Context.UnsignedLongTy, Context.LongLongTy, 
-                                  Context.UnsignedLongLongTy, Context.FloatTy,
+                                  Context.UnsignedLongLongTy,
+                                  Context.HalfTy, Context.FloatTy,
                                   Context.DoubleTy, Context.LongDoubleTy,
                                   Context.Char16Ty, Context.Char32Ty };
   for (unsigned i = 0; i < llvm::array_lengthof(FundamentalTypes); ++i)
Index: test/CodeGenCXX/rtti-fundamental.cpp
===================================================================
--- test/CodeGenCXX/rtti-fundamental.cpp
+++ test/CodeGenCXX/rtti-fundamental.cpp
@@ -89,6 +89,11 @@
 // CHECK: @_ZTIPy = unnamed_addr constant
 // CHECK: @_ZTIPKy = unnamed_addr constant
 
+// half
+// CHECK: @_ZTIDh = unnamed_addr constant
+// CHECK: @_ZTIPDh = unnamed_addr constant
+// CHECK: @_ZTIPKDh = unnamed_addr constant
+
 // float
 // CHECK: @_ZTIf = unnamed_addr constant
 // CHECK: @_ZTIPf = unnamed_addr constant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2750.1.patch
Type: text/x-patch
Size: 1374 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140212/7a6911fe/attachment.bin>


More information about the cfe-commits mailing list