This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Guard the declarations of f16 to f32 vcvt intrinsics in arm_neon.h by testing __ARM_FP
ClosedPublic

Authored by sbaranga on Apr 28 2016, 8:50 AM.

Details

Summary

Conversions between float and half are only available when the
taraget has the half-precision extension. Guard these intrinsics
so that they don't cause crashes in the backend.

Fixes PR27550.

Diff Detail

Event Timeline

sbaranga updated this revision to Diff 55423.Apr 28 2016, 8:50 AM
sbaranga retitled this revision from to [ARM] Guard the declarations of f16 to f32 vcvt intrinsics in arm_neon.h by testing __ARM_FP.
sbaranga updated this object.
sbaranga added a reviewer: rengolin.
sbaranga added subscribers: t.p.northover, cfe-commits.

Couple of issues, as far as I can see:

include/clang/Basic/arm_neon.td
710–711

I think these _high variants are supposed to be AArch64-only.

test/CodeGen/arm-negative-fp16.c
1 ↗(On Diff #55423)

This is a Sema test.

sbaranga updated this revision to Diff 55555.Apr 29 2016, 2:51 AM

Don't change the AArch64 intrinsics and move the test to Sema.

include/clang/Basic/arm_neon.td
710–711

Thanks for catching this!

t.p.northover accepted this revision.Apr 29 2016, 7:36 AM
t.p.northover added a reviewer: t.p.northover.

Looks good. Thanks for updating the patch.

Tim.

This revision is now accepted and ready to land.Apr 29 2016, 7:36 AM
sbaranga closed this revision.Apr 29 2016, 8:09 AM

Thanks, r268047!

Cheers,
Silviu