This is an archive of the discontinued LLVM Phabricator instance.

[AArch32] Added patterns for VCVT{A,N, P,M}.
ClosedPublic

Authored by mcrosier on Aug 22 2014, 3:35 PM.

Details

Summary

All,
This patch adds patterns for VCVT{A,N, P,M}. Patterns for lowering libm calls to VCVT{A,N,P,M}, e.g. (int)floorf(float) => VCVTM.s32.f32, are also included. Please have a look.

Regards,

Chad

Diff Detail

Event Timeline

mcrosier updated this revision to Diff 12860.Aug 22 2014, 3:35 PM
mcrosier retitled this revision from to [AArch32] Added patterns for VCVT{A,N, P,M}..
mcrosier updated this object.
mcrosier edited the test plan for this revision. (Show Details)
mcrosier added a subscriber: Unknown Object (MLST).
compnerd edited edge metadata.Aug 24 2014, 1:30 PM

First, thanks for adding these.

The changes to the table data looks fine.

I think that you should add a bit more test coverage though. The hard float shouldn't matter towards use of these instructions. So, I think you should also test gnueabi. Furthermore, I believe that these instructions are also available on non-v8 hardware if you have a NEON FPU. So, it may be nice to also add cases for armv7 with neon on hard float and soft float. The tests would be identical in those cases, simply a matter of adding the appropriate RUN lines.

In D5033#4, @compnerd wrote:

I think that you should add a bit more test coverage though. The hard float shouldn't matter towards use of these instructions. So, I think you should also test gnueabi.

Shouldn't matter, but adding won't hurt either. Is VCVTN tested elsewhere?

Furthermore, I believe that these instructions are also available on non-v8 hardware if you have a NEON FPU. So, it may be nice to also add cases for armv7 with neon on hard float and soft float.

AFAIK, VCVT with user rounding in ARMv7 can only be done via the FPSCR, which is not the same thing here (and will need more code if there isn't already). These tests are clearly for v8, so I'm fine with it the way it is.

cheers,
--renato

mcrosier accepted this revision.Aug 25 2014, 10:13 AM
mcrosier added a reviewer: mcrosier.

I went ahead and committed this in r216388, per Renato's feedback. This was only designed to target ARMv8 and I'll defer any additional improvements to a later patch.

Chad

This revision is now accepted and ready to land.Aug 25 2014, 10:13 AM

Thanks!

I think making this work in v7 will involve a lot more thinking, since this changes the FPSCR register, even if for a brief moment, while exception can still occur. It's a whole new problem.

rengolin accepted this revision.Aug 25 2014, 10:35 AM
rengolin added a reviewer: rengolin.
mcrosier closed this revision.Aug 26 2014, 7:07 AM

Committed r216388.