This is an archive of the discontinued LLVM Phabricator instance.

Fix float literals under XO & fp-armv8
ClosedPublic

Authored by christof on Oct 11 2017, 3:07 AM.

Details

Summary

When targeting execute-only and fp-armv8, float constants in a compare resulted
in instruction selection failures in some cases. This is now fixed by using
vmov.f32 where possible, otherwise the floating point constant is lowered into
a integer constant that is moved into a floating point register.

This patch also restores using fpcmp with immediate 0 when fp-armv8 is specified.

Diff Detail

Repository
rL LLVM

Event Timeline

christof created this revision.Oct 11 2017, 3:07 AM
SjoerdMeijer added inline comments.Mar 6 2018, 6:02 AM
lib/Target/ARM/ARMISelLowering.cpp
5961–5977

Sorry to be a bit of a pain here, but I think that after my FP16 changes went in, we can also expect f16 values here. But hopefully that does not changes much; looks like only thing is that instead of a VMOVSR, we need a VMOVHR (and a test).

christof updated this revision to Diff 139305.Mar 21 2018, 8:44 AM

Updated the change to take into account f16 types. I cannot test it yet, as f16 seems to be incomplete. I've reported this to SjoerdMeijer already, and he is fixing f16. I am wondering if we can commit this and once f16 constants are actually lowered, update the test as part of that change.

SjoerdMeijer accepted this revision.Mar 22 2018, 7:43 AM

My remark about f16 values, and trying to trigger the assert, actually revealed some problems in lowering f16 constants. I am working on a fix now, but I don't see the point of holding back this patch. So this looks good to me, and if you put the assert back before committing, then we can pick up execute-only and f16 values later.

This revision is now accepted and ready to land.Mar 22 2018, 7:43 AM
christof closed this revision.Mar 23 2018, 6:11 AM

Committed as r328313