[PATCH] D130973: [AArch64] Always allow the __bf16 type

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 02:06:50 PDT 2022


dmgreen added a comment.

It can only be used to pass values around.  The tests in arm-bfloat.cpp shows that you can declare variables but not perform any of the operations in that test. arm-bf16-forbidden-ops.cpp shows it can't be cast. arm-bf16-params-returns.c shows it can be passed through args and rets. And this shows that working as expected in the backend: https://godbolt.org/z/oxzh1PWe9. The idea is that you can't do a huge amount with them, and what you can do can be handled without any special instructions.

(I do know that there are a few areas where they currently do not work but should, like ternary operations: https://godbolt.org/z/v8Mx3EPW7. I hope to fix that but it's an orthogonal issue as it happens with the feature).

That leaves the intrinsics, which are currently part of arm_neon.h. The arm_neon.h file is more difficult to deal with, I'm starting with arm_sve.h. The bfloat16 intrinsics in arm_neon.h are currently behind an #ifdef guard, so cannot be used. Once that changes it will work more like this GCC example, where they are defined but using them in a function without bf16 available will give an error: https://godbolt.org/z/13vfecjx1


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

https://reviews.llvm.org/D130973



More information about the llvm-commits mailing list