5 Commits

Author SHA1 Message Date
Matt Arsenault
b15bf305ca Reapply "clang: Use new frexp intrinsic for builtins and add f16 version"
This reverts commit 0c545a441285a73e00b859dd52f1a85cb9eeeefc.

ARM libcall expansion was fixed in 160d7227e043cd8f491cb706916da953cabfd905
2023-06-30 09:07:23 -04:00
Hans Wennborg
0c545a4412 Revert "clang: Use new frexp intrinsic for builtins and add f16 version"
This caused asserts in some Android and Windows builds:

SelectionDAGNodes.h:1138: llvm::SDValue::SDValue(SDNode *, unsigned int):
Assertion `(!Node || !ResNo || ResNo < Node->getNumValues()) && "Invalid result number for the given node!"' failed.

See comment on 85bdea023f

Also revert "HIP: Use frexp builtins in math headers"
which seems to depend on this change.

This reverts commit 85bdea023f5116f789095b606554739403042a21.
This reverts commit bf8e92c0e792cbe3c9cc50607a1e33c6912ffd0e.
2023-06-30 13:26:25 +02:00
Matt Arsenault
85bdea023f clang: Use new frexp intrinsic for builtins and add f16 version 2023-06-28 14:50:17 -04:00
Matt Arsenault
8a21ea1d0a clang: Start emitting intrinsic for __builtin_ldexp*
Also introduce __builtin_ldexpf16.
2023-06-06 17:07:19 -04:00
Xing Xue
fa7477eb87 [Clang][CodeGen][AIX] Map __builtin_frexpl, __builtin_ldexpl, and __builtin_modfl to 'double' version lib calls in 64-bit 'long double' mode
Summary:
AIX library functions frexpl(), ldexpl(), and modfl() are for 128-bit IBM long double, i.e. __ibm128. Other *l() functions, e.g., acosl(), are for 64-bit long double. The AIX Clang compiler currently maps builtin functions __builtin_frexpl(), __builtin_ldexpl(), and __builtin_modfl() to frexpl(), ldexpl(), and modfl() in 64-bit long double mode which results in seg-faults or incorrect return values. This patch changes to map __builtin_frexpl(), __builtin_ldexpl(), and __builtin_modfl() to double version lib functions frexp(), ldexp() and modf() in 64-bit long double mode.

Reviewed by: hubert.reinterpretcast, daltenty

Differential Revision: https://reviews.llvm.org/D137986
2022-11-18 11:36:56 -05:00