This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][builtins][PowerPC] Add __fixtfti builtin on PowerPC
ClosedPublic

Authored by bsaleil on Nov 1 2019, 12:28 PM.

Details

Summary

This patch implements __fixtfti builtin for PowerPC.
This builtin converts a long double (IBM double-double) to a signed int128.

The conversion relies on the unsigned conversion of the absolute value of the long double.

The patch also includes tests for this builtin using both positive and negative long doubles.

Diff Detail

Event Timeline

bsaleil created this revision.Nov 1 2019, 12:28 PM
bsaleil updated this revision to Diff 228121.Nov 6 2019, 12:12 PM

Improved test case by testing conversion of the biggest negative int128.

kamaub added a subscriber: kamaub.Nov 14 2019, 12:12 PM

This LGTM, please unify the comment styles.

compiler-rt/test/builtins/Unit/ppc/fixtfti_test.c
10

Same here, mismatched comment styles.

compiler-rt/test/builtins/Unit/ppc/fixtfti_test.h
2

Very minor nit: could you change this comment style to match the rest of the file (/**/ vs //).

bsaleil updated this revision to Diff 229845.Nov 18 2019, 7:40 AM

Make comment style uniform

bsaleil marked 2 inline comments as done.Nov 18 2019, 7:41 AM

Fixed comment style mismatch

nemanjai accepted this revision.Nov 21 2019, 4:06 AM

LGTM. Thank you.

@echristo FYI

This revision is now accepted and ready to land.Nov 21 2019, 4:06 AM
jgorbe added a subscriber: jgorbe.Nov 22 2019, 3:50 PM
amyk accepted this revision.Nov 23 2019, 8:38 PM

This also LGTM.

This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Nov 25 2019, 3:47 PM
thakis added inline comments.
compiler-rt/lib/builtins/CMakeLists.txt
522

mind keeping this alphabetized?