This is an archive of the discontinued LLVM Phabricator instance.

[COMPILER-RT] Implement __floatsitf, __floatunstfsi
ClosedPublic

Authored by koviankevin on Feb 13 2014, 9:57 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

koviankevin updated this revision to Unknown Object (????).Feb 19 2014, 6:16 PM

add test

koviankevin updated this revision to Unknown Object (????).Feb 24 2014, 7:53 PM

Use CRT_HAS_128BIT and modify the codes according to gribozavr's comments

koviankevin updated this revision to Unknown Object (????).Feb 27 2014, 8:46 PM

introduce CRT_LDBL_128BIT

koviankevin updated this revision to Unknown Object (????).Mar 10 2014, 1:14 AM

modify by gribozavr's comment and use COMPILER_RT_ABI

joerg added a subscriber: joerg.May 15 2014, 8:23 AM
joerg added inline comments.
lib/builtins/floatsitf.c
32 ↗(On Diff #7680)

Doesn't this produce a signed integer overlfow for INT_MIN? Same problem applies to the existing sources. What about moving the unsigned cast earlier by introducing an explicit aAbs variable?

test/builtins/Unit/floatunsitf_test.c
41 ↗(On Diff #7680)

Can you use UINT64_C and drop the LP64 part?

koviankevin updated this revision to Diff 9740.May 23 2014, 1:15 AM

use UINT64_C and drop le64

joerg added a comment.May 23 2014, 5:00 AM

The INT_MIN case still doesn't look correct?

lib/builtins/floatsitf.c
30 ↗(On Diff #9740)

unsigned aAbs = (unsigned)a;

33 ↗(On Diff #9740)

aAbs += 0x8000000;

44 ↗(On Diff #9740)

aAbs << shift

koviankevin updated this revision to Diff 9793.May 25 2014, 8:00 PM

Adjusted as discussed

joerg accepted this revision.May 26 2014, 6:22 AM
joerg added a reviewer: joerg.

LGTM

This revision is now accepted and ready to land.May 26 2014, 6:22 AM

This patch blocks quad math stuff on aarch64 from using compiler-rt instead of gnu libgcc
Can this patch be commited, now? Thanks

joerg closed this revision.Sep 16 2014, 1:44 PM
joerg updated this revision to Diff 13762.

Closed by commit rL217901 (authored by @joerg).