-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featurefloating-pointFloating-point mathFloating-point math
Description
I was looking at some benchmarks and found out that we can spend a lot of time in
IEEEFloat::convertFromDecimalString (for the case of large arrays of floating points in source code)
Looking at that code, it seems that for at least some combination of rounding modes, semantics
and size, we could benefit from Lemire's algorithm.
We already ship that algorithm in libc, so hopefully we could reuse that.
https://github.com/llvm/llvm-project/blob/main/libc/src/__support/str_to_float.h
Assuming most floating-point literals are well-formed/short (do not represent a number that doesn't fit in a double), it would almost certainly be a great improvement to try Lemire first and fallback on the existing implementation for long doubles, etc
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featurefloating-pointFloating-point mathFloating-point math