This is an archive of the discontinued LLVM Phabricator instance.

Add hard float versions of floating point to long long conversions
ClosedPublic

Authored by sdmitrouk on Sep 17 2014, 4:52 AM.

Details

Summary

This adds hard-float implementation for the following builtins:

  • __fixdfdi()
  • __fixsfdi()
  • __fixunsdfdi()
  • __fixunssfdi()

The soft-float implementation does never raise floating point exceptions,
which doesn't allow clients to detect floating point conversion errors.

I must mention that I had to refer to libgcc's implementation to write these
functions.

Related unit-tests of compiler-rt passed with these changes.

Diff Detail

Repository
rL LLVM

Event Timeline

sdmitrouk updated this revision to Diff 13777.Sep 17 2014, 4:52 AM
sdmitrouk retitled this revision from to Add hard float versions of floating point to long long conversions.
sdmitrouk updated this object.
sdmitrouk edited the test plan for this revision. (Show Details)
sdmitrouk added a reviewer: howard.hinnant.
sdmitrouk added a subscriber: Unknown Object (MLST).

Ping? Anyone interested in using hard-float when it's available?

Ping. Also note that apart from related compiler-rt-tests I've also tested these changes with musl-libc-testsuite, musl-libc-bench and llvm-testsuite, none of which revealed any regressions.

Ping.

Am I going for a record here? It's thirteenth ping and I'm wondering what's current maximum number of successive pings? :-)

rengolin set the repository for this revision to rL LLVM.
rengolin edited edge metadata.Mar 10 2015, 4:51 AM

Sorry Sergey,

I didn't get any email about this, and I'd not be surprised if no one else got it, either. I've added more people to look at this, since this is not as simple as it looks.

We'll also going to need some tests to make sure the expected behaviour is attained on the corner cases.

cheers,
--renato

Hi Renato,

I see all my pings in the mailing list, so I'd expect notifications to work fine, but I can't know for sure. It's not something urgent anyway.

We'll also going to need some tests to make sure the expected behaviour is attained on the corner cases.

There are tests for these builtins, I used them to check that everything still works as expected (some of them failed at the beginning, so those tests do their work).

Thanks,
Sergey

I see all my pings in the mailing list, so I'd expect notifications to work fine, but I can't know for sure. It's not something urgent anyway.

Maybe my filter didn't work as expected, or maybe I just managed to ignore all your pings, which is unsettling... :)

There are tests for these builtins, I used them to check that everything still works as expected (some of them failed at the beginning, so those tests do their work).

I saw them, and they seem broad enough. What kind of hardware did you test this on? These should apply to all architectures, right?

cheers,
--renato

I saw them, and they seem broad enough. What kind of hardware did you test this on? These should apply to all architectures, right?

I couldn't compile compiler-rt for x86/x86_64 and tested changes on ARM only (but on both 32 and 64 bit). I mentioned that test-suite and musl libc tests (which are quite picky about floating point operations) pass fine with these changes on 32 bit ARM, but I'll add some more tests if you wish.

Cheers,
Sergey

No, I'm happy with the tests how they are. Please allow others to comment, but it looks ok to me.

rengolin accepted this revision.Mar 18 2015, 4:12 AM
rengolin edited edge metadata.

Forgot to accept. @compnerd do you have any comments?

This revision is now accepted and ready to land.Mar 18 2015, 4:12 AM

Ping.

I'll wait for comments until some time on the next week and assume that everyone is OK with the changes if there is no objections.

This revision was automatically updated to reflect the committed changes.