This is an archive of the discontinued LLVM Phabricator instance.

[libc][math] Implement double precision exp10 function correctly rounded for all rounding modes.
ClosedPublic

Authored by lntue on Aug 29 2023, 3:17 PM.

Details

Summary

Implement double precision exp10 function correctly rounded for all
rounding modes. Using the same algorithm as double precision exp
(https://reviews.llvm.org/D158551) and exp2 (https://reviews.llvm.org/D158812)
functions.

Diff Detail

Event Timeline

lntue created this revision.Aug 29 2023, 3:17 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 29 2023, 3:17 PM
lntue requested review of this revision.Aug 29 2023, 3:17 PM
lntue updated this revision to Diff 554509.Aug 29 2023, 3:20 PM

Remove debugging stuff.

zimmermann6 accepted this revision.Aug 29 2023, 11:46 PM

a small typo in the summary: fucntions should be functions.

The performance is quite good, nice work!

zimmerma@biscotte:~/svn/core-math$ LIBM=/localdisk/zimmerma/llvm-project/build/projects/libc/lib/libm.a CORE_MATH_PERF_MODE=rdtsc ./perf.sh exp10
GNU libc version: 2.37
GNU libc release: stable
[####################] 100 %
Ntrial = 20 ; Min = 33.623 + 0.357 clc/call; Median-Min = 0.334 clc/call; Max = 34.216 clc/call;
[####################] 100 %
Ntrial = 20 ; Min = 37.281 + 0.352 clc/call; Median-Min = 0.326 clc/call; Max = 39.768 clc/call;
[####################] 100 %
Ntrial = 20 ; Min = 18.802 + 0.174 clc/call; Median-Min = 0.028 clc/call; Max = 20.781 clc/call;

and for the latency:

zimmerma@biscotte:~/svn/core-math$ LIBM=/localdisk/zimmerma/llvm-project/build/projects/libc/lib/libm.a CORE_MATH_PERF_MODE=rdtsc PERF_ARGS=--latency ./perf.sh exp10
GNU libc version: 2.37
GNU libc release: stable
[####################] 100 %
Ntrial = 20 ; Min = 73.058 + 0.361 clc/call; Median-Min = 0.342 clc/call; Max = 73.720 clc/call;
[####################] 100 %
Ntrial = 20 ; Min = 72.787 + 0.393 clc/call; Median-Min = 0.337 clc/call; Max = 73.469 clc/call;
[####################] 100 %
Ntrial = 20 ; Min = 55.295 + 0.349 clc/call; Median-Min = 0.291 clc/call; Max = 55.876 clc/call;
This revision is now accepted and ready to land.Aug 29 2023, 11:46 PM
lntue edited the summary of this revision. (Show Details)Aug 30 2023, 5:42 AM