diff options
author | David Green <david.green@arm.com> | 2023-07-31 21:31:56 +0100 |
---|---|---|
committer | David Green <david.green@arm.com> | 2023-07-31 21:31:56 +0100 |
commit | 778fa4edaf207bd2fef3635ceb8782e325ded76a (patch) | |
tree | e0c5dc975fde0a9e7ed701540078eae2ce0895b5 /llvm/lib/CodeGen/TargetLoweringBase.cpp | |
parent | e9bdf4afa0be3b364571a7cc3db9510367972bec (diff) | |
download | llvm-778fa4edaf207bd2fef3635ceb8782e325ded76a.zip llvm-778fa4edaf207bd2fef3635ceb8782e325ded76a.tar.gz llvm-778fa4edaf207bd2fef3635ceb8782e325ded76a.tar.bz2 |
[AArch64] Add some basic handling for bf16 constants.
This adds some basic handling for bf16 constants, attempting to treat them a
lot like fp16 constants where it can. Zero immediates get lowered to FMOVH0,
others either get lowered to FMOVWHr(MOVi32imm) or use FMOVHi if they can.
Without fp16 they get expanded. This may not always be optimal, but fixes a gap
in our lowering. See llvm/test/CodeGen/AArch64/f16-imm.ll for the equivalent
fp16 test.
Differential Revision: https://reviews.llvm.org/D156649
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index badb7fe..68a4616 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -921,7 +921,7 @@ void TargetLoweringBase::initActions() { // Legal, in which case all fp constants are legal, or use isFPImmLegal() // to optimize expansions for certain constants. setOperationAction(ISD::ConstantFP, - {MVT::f16, MVT::f32, MVT::f64, MVT::f80, MVT::f128}, + {MVT::bf16, MVT::f16, MVT::f32, MVT::f64, MVT::f80, MVT::f128}, Expand); // These library functions default to expand. |