This is an archive of the discontinued LLVM Phabricator instance.

[libc][Experimental] Use nearest integer instructions to speed up exp*f.
AbandonedPublic

Authored by lntue on Jul 18 2022, 6:58 AM.

Details

Reviewers
None
Summary

Performance before:

$ ./perf.sh expf
LIBC-location: /home/lnt/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH reciprocal throughput   : 9.469
System LIBC reciprocal throughput : 7.341
LIBC reciprocal throughput        : 11.764

$ ./perf.sh exp2f
LIBC-location: /home/lnt/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH reciprocal throughput   : 9.659
System LIBC reciprocal throughput : 6.424
LIBC reciprocal throughput        : 20.633

$ ./perf.sh expm1f
LIBC-location: /home/lnt/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH reciprocal throughput   : 9.942
System LIBC reciprocal throughput : 43.645
LIBC reciprocal throughput        : 11.431

Performance after:

$ ./perf.sh expf
LIBC-location: /home/lnt/experiment/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH reciprocal throughput   : 9.514
System LIBC reciprocal throughput : 7.356
LIBC reciprocal throughput        : 8.840

$ ./perf.sh exp2f
LIBC-location: /home/lnt/experiment/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH reciprocal throughput   : 9.672
System LIBC reciprocal throughput : 6.387
LIBC reciprocal throughput        : 8.674

$ ./perf.sh expm1f
LIBC-location: /home/lnt/experiment/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH reciprocal throughput   : 9.945
System LIBC reciprocal throughput : 43.685
LIBC reciprocal throughput        : 9.138

Diff Detail

Event Timeline

lntue created this revision.Jul 18 2022, 6:58 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 18 2022, 6:58 AM
lntue requested review of this revision.Jul 18 2022, 6:58 AM
lntue edited the summary of this revision. (Show Details)Jul 18 2022, 7:00 AM
lntue abandoned this revision.Dec 7 2022, 4:49 PM