This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Generate FP16 vector compare instructions
ClosedPublic

Authored by az on Feb 22 2019, 4:27 PM.

Details

Reviewers
SjoerdMeijer
Summary

We currently generate inefficient code for fp16 vector compare instructions: Comparison is done one element at a time. With this patch and when the fp16 feature is on, vector comparison instructions are generated.

Diff Detail

Event Timeline

az created this revision.Feb 22 2019, 4:27 PM
SjoerdMeijer accepted this revision.Feb 25 2019, 1:00 AM

LGTM, with one nit inline.

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
7793

Just looking at this if we can simplify this if-else and asserts. Folding the FullFP16 into the assert is probably not going to make things much clearer. I guess this is covering it:

assert(( !FullFP16 && LHS.getValueType().getVectorElementType() != MVT::f16)  || 
             LHS.getValueType().getVectorElementType() != MVT::f128);
This revision is now accepted and ready to land.Feb 25 2019, 1:00 AM