From 60d069924d9f69c1b9daf911493a945bf17d1d18 Mon Sep 17 00:00:00 2001 From: Balhau Date: Sun, 2 Dec 2018 10:40:04 +0000 Subject: [PATCH] Renaming methods To ease the naming we put the sse methods the same as the sse instructions it uses. --- src/core/cpu/sse.cpp | 4 ++-- src/core/cpu/sse.hpp | 4 ++-- src/core/cpu/utils.hpp | 2 +- sse.cpp | 6 ++++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core/cpu/sse.cpp b/src/core/cpu/sse.cpp index 98db493..43e7173 100644 --- a/src/core/cpu/sse.cpp +++ b/src/core/cpu/sse.cpp @@ -2,7 +2,7 @@ #include //X86 Assembly to add two 128 bit numbers in the form of packed integers 32bit -void Core::Cpu::SSE::sum_128(UInt *a,UInt *b) { +void Core::Cpu::SSE::paddw(UInt *a,UInt *b) { asm( "movdqa %0, %%xmm1\n" "paddw %1, %%xmm1\n" @@ -14,7 +14,7 @@ void Core::Cpu::SSE::sum_128(UInt *a,UInt *b) { //X86 Assembly to add two 128 bit numbers in the form of packed long 64bit -void Core::Cpu::SSE::sum_128(ULong *a,ULong *b) { +void Core::Cpu::SSE::paddd(ULong *a,ULong *b) { asm( "movdqa %0, %%xmm1\n" "paddd %1, %%xmm1\n" diff --git a/src/core/cpu/sse.hpp b/src/core/cpu/sse.hpp index 90a9e63..ecedcf2 100644 --- a/src/core/cpu/sse.hpp +++ b/src/core/cpu/sse.hpp @@ -11,8 +11,8 @@ namespace Core { namespace Cpu { class SSE { public: - static void sum_128(UInt *a,UInt *b); - static void sum_128(ULong *a,ULong *b); + static void paddw(UInt *a,UInt *b); + static void paddd(ULong *a,ULong *b); }; }; }; diff --git a/src/core/cpu/utils.hpp b/src/core/cpu/utils.hpp index e2c8bf7..53035b8 100644 --- a/src/core/cpu/utils.hpp +++ b/src/core/cpu/utils.hpp @@ -43,7 +43,7 @@ namespace Core { cout << ","; } } - cout << std << endl; + cout << std::dec << endl; }; /** diff --git a/sse.cpp b/sse.cpp index cb290bb..9928d18 100644 --- a/sse.cpp +++ b/sse.cpp @@ -28,6 +28,8 @@ int main(int argc, char** argcv){ Utils::int128BitToLong(v1_128,v1_128_l); Utils::int128BitToLong(v2_128,v2_128_l); + SSE::paddw(v1_128,v2_128); + long int start,end; Utils::printHex(v1_128,Utils::INT_LEN_128); @@ -45,14 +47,14 @@ int main(int argc, char** argcv){ start = gettime(); for(int i=0;i