#ifndef CORE_CPU_UTILS_H #define CORE_CPU_UTILS_H #include #include "types.hpp" using namespace::std; namespace Core { namespace Cpu { class Utils { public: //Lengths static const UChar INT_LEN_64 = 2; static const UChar INT_LEN_128 = 4; static const UChar INT_LEN_256 = 8; static const UChar INT_LEN_512 = 16; static const UChar LONG_LEN_64 = 1; static const UChar LONG_LEN_128 = 2; static const UChar LONG_LEN_256 = 4; static const UChar LONG_LEN_512 = 8; //Masks static const UInt MASK_32=0xFFFFFFFF; static const UInt MASK_16=0xFFFF; static const UInt MASK_8=0xFF; //Shifts static const UChar SHIFT_32 = 32; static const UChar SHIFT_16 = 16; static const UChar SHIFT_8 = 8; /** * Template function (generics) to enable the printing of several datatypes */ template static void printHex(Number *num,Int len) { for(int i=0;i> SHIFT_32; //Unpack second long packedUInteger[2] = packedULong[1] && MASK_32; packedUInteger[3] = packedULong[1] >> SHIFT_32; }; }; }; }; #endif