Simplify the range reduction steps by choosing the reduction constants
carefully so that the reduced arguments v = r*m_x - 1 and v^2 are exact in double
precision, even without FMA instructions, and -2^-8 <= v < 2^-7.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I get an error at compilation:
/localdisk/zimmerma/llvm-project/libc/src/math/generic/log2f.cpp:149:48: error: use of undeclared identifier 'R' static_cast<double>(R[index]), -1.0); // Exact ^
Comment Actions
Can you try to apply https://reviews.llvm.org/D147676 and https://reviews.llvm.org/D147755 before this patch to see if it works?
Comment Actions
all test are ok now. Reciprocal throughput:
GNU libc version: 2.36 GNU libc release: stable [####################] 100 % Ntrial = 20 ; Min = 9.649 + 0.454 clc/call; Median-Min = 0.288 clc/call; Max = 11.526 clc/call; [####################] 100 % Ntrial = 20 ; Min = 7.224 + 0.310 clc/call; Median-Min = 0.320 clc/call; Max = 8.306 clc/call; [####################] 100 % Ntrial = 20 ; Min = 10.579 + 0.162 clc/call; Median-Min = 0.024 clc/call; Max = 11.528 clc/call;
Latency:
GNU libc version: 2.36 GNU libc release: stable [####################] 100 % Ntrial = 20 ; Min = 42.395 + 0.340 clc/call; Median-Min = 0.322 clc/call; Max = 42.983 clc/call; [####################] 100 % Ntrial = 20 ; Min = 38.033 + 0.434 clc/call; Median-Min = 0.304 clc/call; Max = 39.897 clc/call; [####################] 100 % Ntrial = 20 ; Min = 41.699 + 0.343 clc/call; Median-Min = 0.327 clc/call; Max = 42.248 clc/call;