This revision was automatically updated to reflect the committed changes. Closed by commit rG62a251f824f6: [Clang][BFloat16] Upgrade __bf16 by supporting increment/decrement operations (authored by joshua-arch1). Herald added a project: clang. Herald added a subscriber: cfe-commits.
Changed prior to commit: https://reviews.llvm.org/D152768?vs=530750&id=545049#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152768/new/ https://reviews.llvm.org/D152768 Files: clang/lib/CodeGen/CGExprScalar.cpp clang/test/Sema/arm-bfloat.cpp Index: clang/test/Sema/arm-bfloat.cpp =================================================================== --- clang/test/Sema/arm-bfloat.cpp +++ clang/test/Sema/arm-bfloat.cpp @@ -19,6 +19,8 @@ bf16 - bf16; bf16 * bf16; bf16 / bf16; + ++bf16; + --bf16; __fp16 fp16; Index: clang/lib/CodeGen/CGExprScalar.cpp =================================================================== --- clang/lib/CodeGen/CGExprScalar.cpp +++ clang/lib/CodeGen/CGExprScalar.cpp @@ -2764,8 +2764,8 @@ amt = llvm::ConstantFP::get(VMContext, llvm::APFloat(static_cast<double>(amount))); else { - // Remaining types are Half, LongDouble, __ibm128 or __float128. Convert - // from float. + // Remaining types are Half, Bfloat16, LongDouble, __ibm128 or __float128. + // Convert from float. llvm::APFloat F(static_cast<float>(amount)); bool ignored; const llvm::fltSemantics *FS; @@ -2775,6 +2775,8 @@ FS = &CGF.getTarget().getFloat128Format(); else if (value->getType()->isHalfTy()) FS = &CGF.getTarget().getHalfFormat(); + else if (value->getType()->isBFloatTy()) + FS = &CGF.getTarget().getBFloat16Format(); else if (value->getType()->isPPC_FP128Ty()) FS = &CGF.getTarget().getIbm128Format(); else
Index: clang/test/Sema/arm-bfloat.cpp =================================================================== --- clang/test/Sema/arm-bfloat.cpp +++ clang/test/Sema/arm-bfloat.cpp @@ -19,6 +19,8 @@ bf16 - bf16; bf16 * bf16; bf16 / bf16; + ++bf16; + --bf16; __fp16 fp16; Index: clang/lib/CodeGen/CGExprScalar.cpp =================================================================== --- clang/lib/CodeGen/CGExprScalar.cpp +++ clang/lib/CodeGen/CGExprScalar.cpp @@ -2764,8 +2764,8 @@ amt = llvm::ConstantFP::get(VMContext, llvm::APFloat(static_cast<double>(amount))); else { - // Remaining types are Half, LongDouble, __ibm128 or __float128. Convert - // from float. + // Remaining types are Half, Bfloat16, LongDouble, __ibm128 or __float128. + // Convert from float. llvm::APFloat F(static_cast<float>(amount)); bool ignored; const llvm::fltSemantics *FS; @@ -2775,6 +2775,8 @@ FS = &CGF.getTarget().getFloat128Format(); else if (value->getType()->isHalfTy()) FS = &CGF.getTarget().getHalfFormat(); + else if (value->getType()->isBFloatTy()) + FS = &CGF.getTarget().getBFloat16Format(); else if (value->getType()->isPPC_FP128Ty()) FS = &CGF.getTarget().getIbm128Format(); else
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits