This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Use correct half-precision functions in EABI mode
ClosedPublic

Authored by olista01 on Sep 9 2015, 8:47 AM.

Details

Reviewers
rengolin
Summary

The ARM RTABI defines the half- to single-precision float conversion functions with an aeabi prefix, but libgcc only has them with a gnu prefix. Therefore we need to emit the aeabi version when compiling with an eabi or eabihf triple, and the gnu version with a gnueabi or gnueabihf triple.

Diff Detail

Event Timeline

olista01 updated this revision to Diff 34343.Sep 9 2015, 8:47 AM
olista01 retitled this revision from to [ARM] Use correct half-precision functions in EABI mode.
olista01 updated this object.
olista01 added a reviewer: rengolin.
olista01 set the repository for this revision to rL LLVM.
olista01 added a subscriber: llvm-commits.
ab added a subscriber: ab.Sep 9 2015, 8:57 AM

Do these need aliases in compiler-rt?

rengolin edited edge metadata.Sep 9 2015, 9:17 AM
In D12733#242508, @ab wrote:

Do these need aliases in compiler-rt?

Yes, we don't have the eabi versions in RT yet.

ab added a comment.Sep 10 2015, 11:15 AM

Renato: Alright then, this mostly LGTM, but what do I know about ARM ABIs! I'll let you have the final say.

Oliver: please make sure to commit the compiler-rt additions first.

lib/Target/ARM/ARMISelLowering.cpp
402–403

The same thing is done for f64->f16 when Subtarget->isAAPCS_ABI(), not isTargetAEABI(). Should we also set the f64 libcall here?

I don't think any runtime has a f16->f64 libcall though.

test/CodeGen/ARM/fp16.ll
16–17

What about adding a common shared prefix, say --check-prefix=CHECK-ALL or =CHECK, to simplify the -LABELs ?

rengolin accepted this revision.Sep 11 2015, 2:44 AM
rengolin edited edge metadata.
In D12733#243549, @ab wrote:

Renato: Alright then, this mostly LGTM, but what do I know about ARM ABIs! I'll let you have the final say.

Looks ok to me too, with your comments.

Oliver: please make sure to commit the compiler-rt additions first.

Sounds like a good plan.

Thanks!

lib/Target/ARM/ARMISelLowering.cpp
402–403

Good point, I think we should.

test/CodeGen/ARM/fp16.ll
16–17

Yes, you can use CHECK-LABEL for all of them.

This revision is now accepted and ready to land.Sep 11 2015, 2:44 AM

Compiler-rt change up for review at D13204, sorry for the delay.

olista01 updated this revision to Diff 35852.Sep 28 2015, 4:30 AM
olista01 edited edge metadata.
olista01 removed rL LLVM as the repository for this revision.
olista01 marked 2 inline comments as done.

Also set the libcall name for FPROUND_F64_F16, and simplify the test.

olista01 closed this revision.Oct 7 2015, 10:03 AM

Thanks, committed as r249565.