[PATCH] D76077: [ARM] Add __bf16 as new Bfloat16 C Type
Alexandros Lamprineas via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 1 01:33:50 PDT 2020
labrinea added inline comments.
================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:4493
+ case NeonTypeFlags::BFloat16:
+ if (HasBFloat16Type)
+ return llvm::VectorType::get(CGF->BFloatTy, V1Ty ? 1 : (4 << IsQuad));
----------------
This is not what we should be checking for here. Imagine a command line with +bf16 and +mfloat-abi=softfp, that should generate i16, not bfloat. We therefore need a target hook to pass this information. I suggest `allowBFloatArgsAndRet()` in ABIInfo, returning false by default, overloaded for Arm and AArch64 to return `!IsFloatABISoftFP && hasBFloat16Type()` and `hasBFloat16Type()` respectively.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76077/new/
https://reviews.llvm.org/D76077
More information about the cfe-commits
mailing list