mirror of
https://github.com/dbalsom/x86_microcode.git
synced 2026-06-23 13:17:20 +03:00
Initial 80386 microcode commit.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#include "alfe/main.h"
|
||||
|
||||
#ifndef INCLUDED_MININUM_MAXIMUM_H
|
||||
#define INCLUDED_MININUM_MAXIMUM_H
|
||||
|
||||
template<class T> T max(const T& a, const T& b) { return a > b ? a : b; }
|
||||
|
||||
template<class T> T min(const T& a, const T& b) { return a < b ? a : b; }
|
||||
|
||||
template<class T> T clamp(T low, T value, T high)
|
||||
{
|
||||
return min(max(low, value), high);
|
||||
}
|
||||
|
||||
template<class T> Byte byteClamp(T value)
|
||||
{
|
||||
return clamp(0, static_cast<int>(value), 0xff);
|
||||
}
|
||||
|
||||
template<class T> T max(const T& a, const T& b, const T& c)
|
||||
{
|
||||
return max(a, max(b, c));
|
||||
}
|
||||
|
||||
|
||||
template<class T> T min(const T& a, const T& b, const T& c)
|
||||
{
|
||||
return min(a, min(b, c));
|
||||
}
|
||||
|
||||
|
||||
template<class T> T max(const T& a, const T& b, const T& c, const T& d)
|
||||
{
|
||||
return max(a, max(b, c, d));
|
||||
}
|
||||
|
||||
|
||||
template<class T> T min(const T& a, const T& b, const T& c, const T& d)
|
||||
{
|
||||
return min(a, min(b, c, d));
|
||||
}
|
||||
|
||||
#endif // INCLUDED_MININUM_MAXIMUM_H
|
||||
Reference in New Issue
Block a user