svnno****@sourc*****
svnno****@sourc*****
2017年 2月 21日 (火) 14:41:39 JST
Revision: 6599 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6599 Author: doda Date: 2017-02-21 14:41:39 +0900 (Tue, 21 Feb 2017) Log Message: ----------- SFMT 1.5 に更新。 変更箇所は、 ・sfmt_to_res53() の誤りの修正 (Tera Term では未使用) ・ARM NEON 対応? (Web Page には記述無し) ・SSE2 非対応でビルドした時でも SSE2 用の static 変数が確保されていた事の 修正 (多分今までも最適化で消えてた) だけなので動作的には変わらないけど、念の為。 Modified Paths: -------------- trunk/teraterm/ttpmacro/SFMT.c trunk/teraterm/ttpmacro/SFMT.h -------------- next part -------------- Modified: trunk/teraterm/ttpmacro/SFMT.c =================================================================== --- trunk/teraterm/ttpmacro/SFMT.c 2017-02-21 04:05:58 UTC (rev 6598) +++ trunk/teraterm/ttpmacro/SFMT.c 2017-02-21 05:41:39 UTC (rev 6599) @@ -40,11 +40,6 @@ #undef ONLY64 #endif -/** - * parameters used by sse2. - */ -static const w128_t sse2_param_mask = {{SFMT_MSK1, SFMT_MSK2, - SFMT_MSK3, SFMT_MSK4}}; /*---------------- STATIC FUNCTIONS ----------------*/ @@ -60,11 +55,18 @@ #if defined(HAVE_ALTIVEC) #include "SFMT-alti.h" #elif defined(HAVE_SSE2) +/** + * parameters used by sse2. + */ + static const w128_t sse2_param_mask = {{SFMT_MSK1, SFMT_MSK2, + SFMT_MSK3, SFMT_MSK4}}; #if defined(_MSC_VER) #include "SFMT-sse2-msc.h" #else #include "SFMT-sse2.h" #endif +#elif defined(HAVE_NEON) + #include "SFMT-neon.h" #endif /** @@ -81,7 +83,7 @@ } #endif -#if (!defined(HAVE_ALTIVEC)) && (!defined(HAVE_SSE2)) +#if (!defined(HAVE_ALTIVEC)) && (!defined(HAVE_SSE2)) && (!defined(HAVE_NEON)) /** * This function fills the user-specified array with pseudorandom * integers. @@ -232,7 +234,7 @@ return SFMT_N64; } -#if !defined(HAVE_SSE2) && !defined(HAVE_ALTIVEC) +#if !defined(HAVE_SSE2) && !defined(HAVE_ALTIVEC) && !defined(HAVE_NEON) /** * This function fills the internal state array with pseudorandom * integers. Modified: trunk/teraterm/ttpmacro/SFMT.h =================================================================== --- trunk/teraterm/ttpmacro/SFMT.h 2017-02-21 04:05:58 UTC (rev 6598) +++ trunk/teraterm/ttpmacro/SFMT.h 2017-02-21 05:41:39 UTC (rev 6599) @@ -79,6 +79,15 @@ uint32_t u[4]; uint64_t u64[2]; }; +#elif defined(HAVE_NEON) + #include <arm_neon.h> + +/** 128-bit data structure */ +union W128_T { + uint32_t u[4]; + uint64_t u64[2]; + uint32x4_t si; +}; #elif defined(HAVE_SSE2) #include <emmintrin.h> @@ -247,7 +256,7 @@ */ inline static double sfmt_to_res53(uint64_t v) { - return v * (1.0/18446744073709551616.0); + return (v >> 11) * (1.0/9007199254740992.0); } /**