[llvm] [APFloat] Add exp function for APFloat::IEEESsingle using expf implementation from LLVM libc. (PR #143959)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 12 19:02:51 PDT 2025
================
@@ -5601,6 +5606,35 @@ float APFloat::convertToFloat() const {
return Temp.getIEEE().convertToFloat();
}
+#ifdef LLVM_INTEGRATE_LIBC
+APFloat exp(const APFloat &X, RoundingMode rounding_mode) {
+ assert((&X.getSemantics() == (const llvm::fltSemantics *)&semIEEEsingle) &&
+ "Float semantics is not IEEEsingle");
+ if (&X.getSemantics() == (const llvm::fltSemantics *)&semIEEEsingle) {
+ int current_rounding_mode = fegetround();
+ switch (rounding_mode) {
+ case APFloat::rmNearestTiesToEven:
+ fesetround(FE_TONEAREST);
----------------
arsenm wrote:
We're not compiling LLVM with strictfp (which also barely works, on one target). Can we instead just call a fixed rounding mode implementation in libc?
https://github.com/llvm/llvm-project/pull/143959
More information about the llvm-commits
mailing list