This patch is part of a series that adds support for the Bfloat16 extension of the Armv8.6-a architecture, as detailed here:
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a
Specifically:
- it adds the bfloat scalar and vector types in the necessary register classes,
- it adjusts the calling convention to cope with bfloat argument passing and return,
- it adds codegen patterns for moves, loads and stores relying on fullfp16.
It's tested mostly by the intrinsic patches that depend on it (load/store, convert/copy).
The bfloat type, and its properties are specified in the Arm Architecture Reference Manual:
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a
The following people contributed to this patch:
- Alexandros Lamprineas
- Ties Stuij
We only add the FP16 regclass if we have HasFullFP16. Not if we just have the vcvt instructions (HasFP16). I agree it is probably good to make bf16 a legal type if we can, but a lot of operations will not be supported. As far as I understand they are not expected to work, and there will be nothing that can promote them at the moment?
I'm not sure how the AArch64 backend handled it, but do we need something like setAllExpand(..)? Honestly I would expect it to still break if you tried to add two bfloats in IR, but it might be more future-proof.