From df14bb6ae5c21b857aa6ac1c9ffd9ca0616f0df1 Mon Sep 17 00:00:00 2001 From: Peter Pettersson Date: Mon, 22 Apr 2013 22:14:28 +0200 Subject: [PATCH] Minor cleanup. --- RandomWELL512a.h | 10 +++++----- RandomWELL512a_SSE2.h | 16 ++++++++-------- gcc/Makefile | 5 ++--- readme.txt | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/RandomWELL512a.h b/RandomWELL512a.h index 236b305..f9049df 100644 --- a/RandomWELL512a.h +++ b/RandomWELL512a.h @@ -28,8 +28,8 @@ #ifndef RANDOM_WELL512A_H #define RANDOM_WELL512A_H -#include // Needed for rand(). -#include // Needed for memcpy(). +#include // Needed for rand(). +#include // Needed for memcpy(). class RandomWELL512a { @@ -63,9 +63,9 @@ inline RandomWELL512a::RandomWELL512a(unsigned *seed) inline unsigned RandomWELL512a::GetUnsigned() { - #define MUTATE_LEFT(value, shift) value ^ (value << shift) - #define MUTATE_RIGHT(value, shift) value ^ (value >> shift) - #define MUTATE_LEFT_MIX(value, shift, mix) value ^ ((value << shift) & mix) + #define MUTATE_LEFT(value, shift) value ^ (value << shift) + #define MUTATE_RIGHT(value, shift) value ^ (value >> shift) + #define MUTATE_LEFT_MIX(value, shift, mix) value ^ ((value << shift) & mix) unsigned index_9 = (index + 9) & 15; unsigned index_13 = (index + 13) & 15; diff --git a/RandomWELL512a_SSE2.h b/RandomWELL512a_SSE2.h index cae462b..3a2256f 100644 --- a/RandomWELL512a_SSE2.h +++ b/RandomWELL512a_SSE2.h @@ -28,8 +28,8 @@ #ifndef RANDOM_WELL512A_SSE2_H #define RANDOM_WELL512A_SSE2_H -#include // SSE2 instrinsics. -#include // Needed for rand(). +#include // SSE2 instrinsics. +#include // Needed for rand(). class RandomWELL512a_SSE2 { @@ -86,12 +86,12 @@ inline double RandomWELL512a_SSE2::GetDouble() inline void RandomWELL512a_SSE2::GetUnsigned4(unsigned *result4) { - unsigned index_15 = (index + 15) & 15; - __m128i state_index = state[index]; - __m128i state_index_9 = state[(index + 9) & 15]; - __m128i state_index_13 = state[(index + 13) & 15]; - __m128i state_index_15 = state[index_15]; - const __m128i kMix = _mm_set1_epi32(0xda442d24); + unsigned index_15 = (index + 15) & 15; + __m128i state_index = state[index]; + __m128i state_index_9 = state[(index + 9) & 15]; + __m128i state_index_13 = state[(index + 13) & 15]; + __m128i state_index_15 = state[index_15]; + const __m128i kMix = _mm_set1_epi32(0xda442d24); __m128i left = _mm_xor_si128(state_index, _mm_slli_epi32(state_index, 16)); __m128i right = _mm_xor_si128(state_index_13, _mm_slli_epi32(state_index_13, 15)); diff --git a/gcc/Makefile b/gcc/Makefile index fb505c2..0b4b70d 100644 --- a/gcc/Makefile +++ b/gcc/Makefile @@ -92,8 +92,8 @@ cleanall: help: @echo "BUILD = Build mode. One of:" - @echo " debug (default)" - @echo " release (optimizations)" + @echo " debug (no optimizations)" + @echo " release (optimizations, the default)" @echo "APPS = Applications to build. Defaults to all." @echo "VERBOSE = Full output from commands if set." @@ -107,7 +107,6 @@ $(EXES): $(BUILD_DIR)/%.a: @mkdir -p $(@D) $(HUSH_GENERATE) $(AR) $(ARFLAGS) $@ $^ -# $(HUSH_GENERATE) $(AR) $(ARFLAGS) $@ $^ 2> /dev/null $(BUILD_DIR)/%.o: $(SRC_ROOT)/%.c @mkdir -p $(@D) diff --git a/readme.txt b/readme.txt index 8c5044e..6ce7df1 100644 --- a/readme.txt +++ b/readme.txt @@ -29,7 +29,7 @@ Original C 0.223 0.19 === REQUIREMENTS === -An SSE2 capable CPU (i.e. AMD Athlon 64, Intel Pentium 4 or newer. +An SSE2 capable CPU (i.e. AMD Athlon 64, Intel Pentium 4 or newer). It's been tested with Visual Studio 2012 and gcc 4.6.3 but should compile and run on other compilers as well.