More on refactor
This commit is contained in:
parent
1a0b36e390
commit
08a550f47a
2 changed files with 39 additions and 39 deletions
|
@ -6,15 +6,6 @@
|
|||
#include <limits.h>
|
||||
#include <iostream>
|
||||
|
||||
typedef union {
|
||||
struct
|
||||
{
|
||||
Int value : 31;
|
||||
Int signal : 1;
|
||||
} int_with_msb;
|
||||
Int signed_int;
|
||||
} SignedInt;
|
||||
|
||||
/**
|
||||
* This will get the most significant bit of the Int value. If the most significant bit is 1 then the number is
|
||||
* 0x11111111 --> equals to -1 integer
|
||||
|
|
|
@ -3,40 +3,49 @@
|
|||
* Types for x86 architectures
|
||||
*/
|
||||
#if defined(__x86_64__)
|
||||
//Signed type alias
|
||||
typedef int Int;
|
||||
typedef long Long;
|
||||
typedef char Char;
|
||||
typedef short Short;
|
||||
//Signed type alias
|
||||
typedef int Int;
|
||||
typedef long Long;
|
||||
typedef char Char;
|
||||
typedef short Short;
|
||||
|
||||
//IEEE floating point alias
|
||||
typedef float Float;
|
||||
typedef double Double;
|
||||
typedef union {
|
||||
struct
|
||||
{
|
||||
Int value : 31;
|
||||
Int signal : 1;
|
||||
} int_with_msb;
|
||||
Int signed_int;
|
||||
} SignedInt;
|
||||
|
||||
//Unsigned type alias
|
||||
typedef unsigned char UChar;
|
||||
typedef unsigned short UShort;
|
||||
typedef unsigned int UInt;
|
||||
typedef unsigned long ULong;
|
||||
//IEEE floating point alias
|
||||
typedef float Float;
|
||||
typedef double Double;
|
||||
|
||||
//SSE DataTypes
|
||||
#define INT_LEN_64 2
|
||||
#define INT_LEN_128 4
|
||||
#define INT_LEN_256 8
|
||||
#define INT_LEN_512 16
|
||||
//Unsigned type alias
|
||||
typedef unsigned char UChar;
|
||||
typedef unsigned short UShort;
|
||||
typedef unsigned int UInt;
|
||||
typedef unsigned long ULong;
|
||||
|
||||
#define LONG_LEN_64 1
|
||||
#define LONG_LEN_128 2
|
||||
#define LONG_LEN_256 4
|
||||
#define LONG_LEN_512 8
|
||||
//SSE DataTypes
|
||||
#define INT_LEN_64 2
|
||||
#define INT_LEN_128 4
|
||||
#define INT_LEN_256 8
|
||||
#define INT_LEN_512 16
|
||||
|
||||
//Masks
|
||||
#define MASK_32 0xFFFFFFFF
|
||||
#define MASK_16 0xFFFF
|
||||
#define MASK_8 0xFF
|
||||
#define LONG_LEN_64 1
|
||||
#define LONG_LEN_128 2
|
||||
#define LONG_LEN_256 4
|
||||
#define LONG_LEN_512 8
|
||||
|
||||
//Shifts
|
||||
#define SHIFT_32 32
|
||||
#define SHIFT_16 16
|
||||
#define SHIFT_8 8
|
||||
//Masks
|
||||
#define MASK_32 0xFFFFFFFF
|
||||
#define MASK_16 0xFFFF
|
||||
#define MASK_8 0xFF
|
||||
|
||||
//Shifts
|
||||
#define SHIFT_32 32
|
||||
#define SHIFT_16 16
|
||||
#define SHIFT_8 8
|
||||
#endif
|
Loading…
Reference in a new issue