mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 09:59:42 +00:00
Removed experimental rotlImmediate and rotrImmediate
This commit is contained in:
parent
4cbe552d7e
commit
89809b7d59
55
misc.h
55
misc.h
@ -1292,32 +1292,6 @@ CRYPTOPP_DLL void CRYPTOPP_API UnalignedDeallocate(void *ptr);
|
||||
|
||||
// ************** rotate functions ***************
|
||||
|
||||
//! \brief Performs a left rotate
|
||||
//! \tparam T the word type
|
||||
//! \tparam Y the number of bit positions to rotate the value
|
||||
//! \param x the value to rotate
|
||||
//! \details This is a portable C/C++ implementation which attempts to take advantage of the
|
||||
//! <tt>constexpr</tt>-ness of a template parameter in hopes of achieving better code
|
||||
//! generation under Clang and VC++. If a specialization is not available, then
|
||||
//! <tt>rotlImmediate</tt> simply calls <tt>rotlFixed</tt>.
|
||||
template <class T, unsigned int Y> inline T rotlImmediate(T x)
|
||||
{
|
||||
return rotlFixed(x, Y);
|
||||
}
|
||||
|
||||
//! \brief Performs a right rotate
|
||||
//! \tparam T the word type
|
||||
//! \tparam Y the number of bit positions to rotate the value
|
||||
//! \param x the value to rotate
|
||||
//! \details This is a portable C/C++ implementation which attempts to take advantage of the
|
||||
//! <tt>constexpr</tt>-ness of a template parameter in hopes of achieving better code
|
||||
//! generation under Clang and VC++. If a specialization is not available, then
|
||||
//! <tt>rotrImmediate</tt> simply calls <tt>rotlFixed</tt>.
|
||||
template <class T, unsigned int Y> inline T rotrFixed(T x)
|
||||
{
|
||||
return rotrFixed(x, Y);
|
||||
}
|
||||
|
||||
//! \brief Performs a left rotate
|
||||
//! \tparam T the word type
|
||||
//! \param x the value to rotate
|
||||
@ -1426,35 +1400,6 @@ template <class T> inline T rotrMod(T x, unsigned int y)
|
||||
return T((x>>(y&MASK))|(x<<(-y&MASK)));
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) && 0
|
||||
template <word32, unsigned int R>
|
||||
inline word32 rotlImmediate<word32, unsigned int>(word32 x)
|
||||
{
|
||||
__asm__ ("roll %1, %0" : "+mq" (x) : "I" ((unsigned char)Y));
|
||||
return x;
|
||||
}
|
||||
template <word32, unsigned int R>
|
||||
inline T rotlImmediate<word32, unsigned int>(word32 x)
|
||||
{
|
||||
__asm__ ("rorl %1, %0" : "+mq" (x) : "I" ((unsigned char)Y));
|
||||
return x;
|
||||
}
|
||||
# if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32)
|
||||
template <>
|
||||
inline word64 rotlImmediate<word64, unsigned int>(word64 x)
|
||||
{
|
||||
__asm__ ("rolq %1, %0" : "+mq" (x) : "J" ((unsigned char)Y));
|
||||
return x;
|
||||
}
|
||||
template <>
|
||||
inline T rotlImmediate<word64, unsigned int>(word64 x)
|
||||
{
|
||||
__asm__ ("rorq %1, %0" : "+mq" (x) : "J" ((unsigned char)Y));
|
||||
return x;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
//! \brief Performs a left rotate
|
||||
|
Loading…
Reference in New Issue
Block a user