[PATCH] D120395: [X86] Prohibit arithmetic operations on type `__bfloat16`

Andy Kaylor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 7 14:41:11 PST 2022


andrew.w.kaylor added a comment.

In D120395#3359255 <https://reviews.llvm.org/D120395#3359255>, @pengfei wrote:

> I don't agree. Unlike `__fp16`, `__bf16` is simple an ARM specific type.

Why is __bf16 an ARM-specific type? It's a type that describes a floating point value with a specific binary representation that is supported on some ARM and some Intel processors. Why should the type be ARM-specific? What the clang documentation says is just a description of the current implementation. We can change the documentation based on what the compiler supports.

In D120395#3359255 <https://reviews.llvm.org/D120395#3359255>, @pengfei wrote:

> So, it is not a problem of easy or difficult. It's a wrong direction we can't go with it (introducing new IR type without clear ABI declarations). We made such mistake with the `half` type. https://godbolt.org/z/K55s5zqPG We shouldn't make it again.

If people are writing code that uses variables of this type, we aren't really solving anything by pretending it's a different type because the ABI for the type they're using hasn't been defined. The solution here is to work with HJ and others to get the ABI defined for this type.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120395



More information about the cfe-commits mailing list