This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] allow v4f16 types when FullFP16 is supported
ClosedPublic

Authored by SjoerdMeijer on Aug 25 2017, 6:51 AM.

Details

Summary

Support for scalars was committed in r311154, this adds support for allowing v4f16 vector types (thus avoiding conversions from/to single precision for these types).

Diff Detail

Repository
rL LLVM

Event Timeline

SjoerdMeijer created this revision.Aug 25 2017, 6:51 AM

Forgot to mention that I will address the v8f16 types in a separate patch.

Fixed typo in test case type declaration.

olista01 added inline comments.Aug 29 2017, 5:35 AM
lib/Target/AArch64/AArch64ISelLowering.cpp
397 ↗(On Diff #113058)

If there anything stopping us from doing this by just changing the operation action and promoted type here? We are already doing this for the simple arithmetic operations.

test/CodeGen/AArch64/arm64-vfloatintrinsics.ll
17 ↗(On Diff #113058)

We should also test how this gets lowered when we don't have FullFP16.

test/CodeGen/AArch64/fp16-v4-instructions.ll
105 ↗(On Diff #113058)

These two could be done with vector conversion instructions, rather than using the scalar conversions then rebuilding the vector. These instructions don't require FullFP16, so a separate patch would make most sense.

304 ↗(On Diff #113058)

I think this could use FCVTL, like the arithmetic operations. This should be a separate patch though. (same for the rest of the comparison tests)

318 ↗(On Diff #113058)

We should check that an FCMP is emitted here. (same for the rest of the comparison tests)

Thanks for reviewing! I've addressed your comments: have set operation action to 'promote', added checks to test fcmp, and also added checks when fp16 is disabled.

Thanks for the suggestion to improve codegen for the conversions. As you suggested, I will start working on them in a separate patch.

This revision is now accepted and ready to land.Aug 29 2017, 9:16 AM
This revision was automatically updated to reflect the committed changes.