mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
ef7f39cab9
To set non-default rounding mode user usually calls function 'fesetround' from standard C library. This way has some disadvantages. * It creates unnecessary dependency on libc. On the other hand, setting rounding mode requires few instructions and could be made by compiler. Sometimes standard C library even is not available, like in the case of GPU or AI cores that execute small kernels. * Compiler could generate more effective code if it knows that a particular call just sets rounding mode. This change introduces new IR intrinsic, namely 'llvm.set.rounding', which sets current rounding mode, similar to 'fesetround'. It however differs from the latter, because it is a lower level facility: * 'llvm.set.rounding' does not return any value, whereas 'fesetround' returns non-zero value in the case of failure. In glibc 'fesetround' reports failure if its argument is invalid or unsupported or if floating point operations are unavailable on the hardware. Compiler usually knows what core it generates code for and it can validate arguments in many cases. * Rounding mode is specified in 'fesetround' using constants like 'FE_TONEAREST', which are target dependent. It is inconvenient to work with such constants at IR level. C standard provides a target-independent way to specify rounding mode, it is used in FLT_ROUNDS, however it does not define standard way to set rounding mode using this encoding. This change implements only IR intrinsic. Lowering it to machine code is target-specific and will be implemented latter. Mapping of 'fesetround' to 'llvm.set.rounding' is also not implemented here. Differential Revision: https://reviews.llvm.org/D74729 |
||
---|---|---|
.. | ||
AbstractCallSiteTest.cpp | ||
AsmWriterTest.cpp | ||
AttributesTest.cpp | ||
BasicBlockTest.cpp | ||
CFGBuilder.cpp | ||
CFGBuilder.h | ||
CMakeLists.txt | ||
ConstantRangeTest.cpp | ||
ConstantsTest.cpp | ||
DataLayoutTest.cpp | ||
DebugInfoTest.cpp | ||
DebugTypeODRUniquingTest.cpp | ||
DemandedBitsTest.cpp | ||
DominatorTreeBatchUpdatesTest.cpp | ||
DominatorTreeTest.cpp | ||
FunctionTest.cpp | ||
InstructionsTest.cpp | ||
IntrinsicsTest.cpp | ||
IRBuilderTest.cpp | ||
LegacyPassManagerTest.cpp | ||
ManglerTest.cpp | ||
MDBuilderTest.cpp | ||
MetadataTest.cpp | ||
ModuleTest.cpp | ||
PassBuilderCallbacksTest.cpp | ||
PassManagerTest.cpp | ||
PatternMatch.cpp | ||
TimePassesTest.cpp | ||
TypesTest.cpp | ||
UserTest.cpp | ||
UseTest.cpp | ||
ValueHandleTest.cpp | ||
ValueMapTest.cpp | ||
ValueTest.cpp | ||
VectorTypesTest.cpp | ||
VerifierTest.cpp | ||
VPIntrinsicTest.cpp |