X-Git-Url: https://ginac.de/CLN/cln.git//cln.git?a=blobdiff_plain;f=src%2Fbase%2Fdigitseq%2Fcl_DS_mul.cc;h=5400e7f25b932c0a5512208f4c307945f232e924;hb=c84c6db5d56829d69083c819688a973867694a2a;hp=e1f94a411398ca0e504ab3a9094b11c5324a7b1b;hpb=850abfde7f0d985ba01526c346bcd0d733562943;p=cln.git diff --git a/src/base/digitseq/cl_DS_mul.cc b/src/base/digitseq/cl_DS_mul.cc index e1f94a4..5400e7f 100644 --- a/src/base/digitseq/cl_DS_mul.cc +++ b/src/base/digitseq/cl_DS_mul.cc @@ -354,15 +354,20 @@ namespace cln { const unsigned int cl_fftm_threshold2 = 2*cl_fftm_threshold; // len1 > cl_fftm_threshold1 && len2 > cl_fftm_threshold2 // && len1 >= cl_fftm_threshold1 + cl_fftm_threshold/(len2-cl_fftm_threshold1)*(cl_fftm_threshold-cl_fftm_threshold1). - static inline cl_boolean cl_fftm_suitable (uintL len1, uintL len2) + static inline cl_boolean cl_fftm_suitable (uintC len1, uintC len2) { if (len1 >= cl_fftm_threshold) return cl_true; if (len1 > cl_fftm_threshold1) if (len2 > cl_fftm_threshold2) - { var uint32 hi; + { const unsigned int prod_threshold = cl_fftm_threshold*(cl_fftm_threshold-cl_fftm_threshold1); + if (len1-cl_fftm_threshold1 >= prod_threshold) + return cl_true; + if (len2-cl_fftm_threshold1 >= prod_threshold) + return cl_true; + var uint32 hi; var uint32 lo; mulu32(len1-cl_fftm_threshold1,len2-cl_fftm_threshold1, hi=,lo=); - if (hi > 0 || lo >= cl_fftm_threshold*(cl_fftm_threshold-cl_fftm_threshold1)) + if (hi > 0 || lo >= prod_threshold) return cl_true; } return cl_false;