mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Add minnum / maxnum intrinsics
These are named following the IEEE-754 names for these functions, rather than the libm fmin / fmax to avoid possible ambiguities. Some languages may implement something resembling fmin / fmax which return NaN if either operand is to propagate errors. These implement the IEEE-754 semantics of returning the other operand if either is a NaN representing missing data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220341 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1228,6 +1228,18 @@ m_BSwap(const Opnd0 &Op0) {
|
||||
return m_Intrinsic<Intrinsic::bswap>(Op0);
|
||||
}
|
||||
|
||||
template<typename Opnd0, typename Opnd1>
|
||||
inline typename m_Intrinsic_Ty<Opnd0, Opnd1>::Ty
|
||||
m_FMin(const Opnd0 &Op0, const Opnd1 &Op1) {
|
||||
return m_Intrinsic<Intrinsic::minnum>(Op0, Op1);
|
||||
}
|
||||
|
||||
template<typename Opnd0, typename Opnd1>
|
||||
inline typename m_Intrinsic_Ty<Opnd0, Opnd1>::Ty
|
||||
m_FMax(const Opnd0 &Op0, const Opnd1 &Op1) {
|
||||
return m_Intrinsic<Intrinsic::maxnum>(Op0, Op1);
|
||||
}
|
||||
|
||||
} // end namespace PatternMatch
|
||||
} // end namespace llvm
|
||||
|
||||
|
Reference in New Issue
Block a user