[PATCH] D76612: [Matrix] Add draft specification for matrix support in Clang.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 15 21:17:28 PDT 2020


rjmccall added inline comments.


================
Comment at: clang/docs/MatrixTypes.rst:29
+A *matrix element type* must be a real type (as in C99 6.2.5p17) excluding
+enumeration types or an implementation-defined half-precision floating point
+type, otherwise the program is ill-formed.
----------------
fhahn wrote:
> SjoerdMeijer wrote:
> > Now I am wondering if this requires some explanations on binary operations for these implemenation-defined types? For example, for `__fp16` and matrices with this `__fp16` element type, I assume arithmetic is performed in at least the (single) floating-point precision. So I guess in section "Arithmetic Conversions" a rule needs to be added that the conversion of these implementation defined types need to performed?
> > 
> I don't think we need to specifically discuss the implementation defined types here, as the conversions and binary operator definitions are framed in terms of the existing rules for the element types used. I am potentially missing something, but with the current wording the conversions for `__fp16` would use the conversion rules for that type and the binary operators would use the arithmetic rules for it.
Yeah, for the scalar conversions / scalar operands, you should just say that the source has to be a real type and not otherwise restrict it.  All of those types should already be convertible to any matrix element type.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76612/new/

https://reviews.llvm.org/D76612





More information about the cfe-commits mailing list