================
@@ -710,21 +710,23 @@ class ScalarExprEmitter : public 
StmtVisitor<ScalarExprEmitter, mlir::Value> {
 
       if (type->isHalfType() &&
           !cgf.getContext().getLangOpts().NativeHalfType) {
-        cgf.cgm.errorNYI(e->getSourceRange(), "Unary inc/dec half");
-        return {};
+        // Another special case: half FP increment should be done via float. If
+        // the input isn't already half, it may be i16.
+        mlir::Value fp16Input =
+            builder.createBitcast(input, builder.getFp16Ty());
----------------
Lancern wrote:

When could `input` be `i16`? Could you add a test to cover such cases?

https://github.com/llvm/llvm-project/pull/193215
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to