diff --git a/src/cpu/x86/sse.cpp b/src/cpu/x86/sse.cpp index 303c6ca..0e27829 100644 --- a/src/cpu/x86/sse.cpp +++ b/src/cpu/x86/sse.cpp @@ -5,7 +5,7 @@ #include void cpu::SSE::add_128(UChar *a,UChar *b){ - asm volatile ( + asmv( "movdqa %0,%%xmm1\n" "paddb %1,%%xmm1\n" "movdqa %%xmm1,%0" @@ -16,7 +16,7 @@ //X86 Assembly to add two 128 bit numbers in the form of packed integers 32bit void cpu::SSE::add_128(UInt *a,UInt *b) { - asm volatile ( + asmv( "movdqa %0,%%xmm1\n" "paddw %1,%%xmm1\n" "movdqa %%xmm1, %0" @@ -28,7 +28,7 @@ //X86 Assembly to add two 128 bit numbers in the form of packed long 64bit void cpu::SSE::add_128(ULong *a,ULong *b) { - asm volatile ( + asmv( "movdqa %0,%%xmm1\n" "paddd %1,%%xmm1\n" "movdqa %%xmm1, %0" @@ -39,7 +39,7 @@ //X86 Assembly to add two 256 bit numbers in the form of packed byte vector void cpu::SSE::add_256(UChar *a,UChar *b) { - asm volatile ( + asmv( "vmovdqu %0,%%ymm1\n" "vmovdqu %1,%%ymm2\n" "vpaddb %%ymm3,%%ymm2,%%ymm1\n" @@ -51,7 +51,7 @@ //X86 Assembly to add two 256 bit numbers in the form of packed int 32bit void cpu::SSE::add_256(UInt *a,UInt *b) { - asm volatile( + asmv( "vmovdqu %0,%%ymm1\n" "vmovdqu %1,%%ymm2\n" "vpaddw %%ymm1, %%ymm2, %%ymm1\n" @@ -64,7 +64,7 @@ //X86 Assembly to add two 256 bit numbers in the form of packed long 64bit //Here we are using vmovdqu instead of vmovdqa because memory is not aligned. void cpu::SSE::add_256(ULong *a,ULong *b) { - asm volatile( + asmv( "vmovdqu %0, %%ymm1\n" "vmovdqu %1, %%ymm2\n" "vpaddd %%ymm1,%%ymm2,%%ymm1\n" diff --git a/src/platform/platform.hpp b/src/platform/platform.hpp index b287822..c3a7a38 100644 --- a/src/platform/platform.hpp +++ b/src/platform/platform.hpp @@ -17,3 +17,5 @@ #define ARCH_X86 #endif +//Redefine asm volatile as asmv to make inline assembly less verbose +#define asmv asm volatile \ No newline at end of file