From 08a550f47a637536fded5280de1ae85de825637d Mon Sep 17 00:00:00 2001 From: Vitor Fernandes Date: Thu, 16 Jul 2020 01:31:28 +0100 Subject: [PATCH] More on refactor --- src/bmath/math.cpp | 9 ------ src/cpu/types.hpp | 69 ++++++++++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/bmath/math.cpp b/src/bmath/math.cpp index 8dee3c7..86923d3 100644 --- a/src/bmath/math.cpp +++ b/src/bmath/math.cpp @@ -6,15 +6,6 @@ #include #include -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 diff --git a/src/cpu/types.hpp b/src/cpu/types.hpp index 1cad1df..52f361f 100644 --- a/src/cpu/types.hpp +++ b/src/cpu/types.hpp @@ -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 \ No newline at end of file