]> Git Repo - cpuminer-multi.git/commitdiff
version: add compiler and pthreads version
authorunknown <C:\TheBatPortable\Data\Mail>
Fri, 31 Oct 2014 02:43:22 +0000 (03:43 +0100)
committerunknown <C:\TheBatPortable\Data\Mail>
Fri, 31 Oct 2014 03:36:07 +0000 (04:36 +0100)
fix also some remaining aligned attributes for VC++

TODO: support ASM linkage in VC2013 (USE_ASM define)

cpu-miner.c
cpuminer.vcxproj
miner.h
scrypt.c
sha2.c
util.c

index 500730b65438e5f0a8e1bd591179d5fda60fa9f7..66dc7b6226c6386711216f39f8062d959510a4e7 100644 (file)
@@ -919,7 +919,7 @@ static void share_result(int result, struct work *work, const char *reason)
                                100. * accepted_count / (accepted_count + rejected_count), s,
                                (((double) 0xffffffff) / (work ? work->target[7] : rpc2_target)),
                                use_colors ?
-                                       (result ? CL_GRN "(yay!!!)" : CL_RED "(booooo)")
+                                       (result ? CL_GRN "yay!!!" : CL_RED "booooo")
                                :       (result ? "(yay!!!)" : "(booooo)"));
                break;
        default:
@@ -2078,7 +2078,15 @@ out:
 
 static void show_version_and_exit(void)
 {
-       printf(PACKAGE_STRING "\n built on " __DATE__ "\n features:"
+       printf("\n built on " __DATE__
+#ifdef _MSC_VER
+        " with VC++ 2013\n");
+#elif defined(__GNUC__)
+        " with GCC");
+       printf(" %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
+#endif
+
+       printf(" features:"
 #if defined(USE_ASM) && defined(__i386__)
                " i386"
 #endif
@@ -2113,12 +2121,19 @@ static void show_version_and_exit(void)
                " NEON"
 #endif
 #endif
-               "\n");
+               "\n\n");
 
+       /* dependencies versions */
        printf("%s\n", curl_version());
 #ifdef JANSSON_VERSION
-       printf("libjansson %s\n", JANSSON_VERSION);
+       printf("libjansson/%s ", JANSSON_VERSION);
+#else
+       printf("libjansson/1.3 "); /* windows */
 #endif
+#ifdef PTW32_VERSION
+       printf("pthreads/%d.%d.%d.%d ", PTW32_VERSION);
+#endif
+       printf("\n");
        exit(0);
 }
 
@@ -2525,11 +2540,7 @@ static bool has_aes_ni()
 static void show_credits()
 {
        printf(PROGRAM_NAME " by Lucas Jones and Tanguy Pruvot\n");
-#ifdef _MSC_VER
-       printf(CL_GRY " This is version " PACKAGE_VERSION ", built with VC++ 2013" CL_N "\n");
-#else
        printf(CL_GRY " This is version " PACKAGE_VERSION CL_N "\n");
-#endif
        printf(CL_GRY " based on pooler cpuminer 2.4" CL_N "\n");
 }
 
@@ -2713,7 +2724,7 @@ int main(int argc, char *argv[]) {
        /* main loop - simply wait for workio thread to exit */
        pthread_join(thr_info[work_thr_id].pth, NULL);
 
-       applog(LOG_INFO, "workio thread dead, exiting.");
+       applog(LOG_WARNING, "workio thread dead, exiting.");
 
        return 0;
 }
index f63e2fcd4e59a906a7335d89d6ccf823155d532c..88cb692b943aac3305a3bc42af97b07d4374fee8 100644 (file)
@@ -82,7 +82,8 @@
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;USE_AVX;USE_AVX2;USE_XOP;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>.;compat;compat\curl-for-windows\curl\include;compat\jansson;compat\getopt;compat\pthreads;compat\curl-for-windows\openssl\openssl\include;compat\curl-for-windows\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
@@ -98,7 +99,8 @@
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;USE_AVX;USE_AVX2;USE_XOP;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>.;compat;compat\curl-for-windows\curl\include;compat\jansson;compat\getopt;compat\pthreads;compat\curl-for-windows\openssl\openssl\include;compat\curl-for-windows\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <CompileAsManaged>false</CompileAsManaged>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;MAXWELL_OR_FERMI=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;USE_AVX;USE_AVX2;USE_XOP;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>.;compat;compat\curl-for-windows\curl\include;compat\jansson;compat\getopt;compat\pthreads;compat\curl-for-windows\openssl\openssl\include;compat\curl-for-windows\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ExceptionHandling>SyncCThrow</ExceptionHandling>
     </ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
       <CompileAsManaged>false</CompileAsManaged>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;MAXWELL_OR_FERMI=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;USE_AVX;USE_AVX2;USE_XOP;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>.;compat;compat\curl-for-windows\curl\include;compat\jansson;compat\getopt;compat\pthreads;compat\curl-for-windows\openssl\openssl\include;compat\curl-for-windows\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
diff --git a/miner.h b/miner.h
index a89463135f96d05f6111a8c77f529c41d1399411..59782b82b9d48e6d2bc081c9538e411d4ac211c5 100644 (file)
--- a/miner.h
+++ b/miner.h
@@ -39,7 +39,6 @@ void *alloca (size_t);
 #endif
 
 #ifdef _MSC_VER
-#define strncasecmp(x,y,z) _strnicmp(x,y,z)
        #define strncasecmp(x,y,z) _strnicmp(x,y,z)
        #define strcasecmp(x,y) _stricmp(x,y)
        typedef int ssize_t;
index 4f9ba3ee17e261578a6c4e171de673cbdf080e80..489ff320d2ac583645ef87b12545a56fc1adf0eb 100644 (file)
--- a/scrypt.c
+++ b/scrypt.c
@@ -158,7 +158,7 @@ static const uint32_t outerpad_4way[4 * 8] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000300, 0x00000300, 0x00000300, 0x00000300
 };
-static const uint32_t finalblk_4way[4 * 16] __attribute__((aligned(16))) = {
+static const uint32_t _ALIGN(16) finalblk_4way[4 * 16] = {
        0x00000001, 0x00000001, 0x00000001, 0x00000001,
        0x80000000, 0x80000000, 0x80000000, 0x80000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -180,8 +180,8 @@ static const uint32_t finalblk_4way[4 * 16] __attribute__((aligned(16))) = {
 static inline void HMAC_SHA256_80_init_4way(const uint32_t *key,
        uint32_t *tstate, uint32_t *ostate)
 {
-       uint32_t ihash[4 * 8] __attribute__((aligned(16)));
-       uint32_t pad[4 * 16] __attribute__((aligned(16)));
+       uint32_t _ALIGN(16) ihash[4 * 8];
+       uint32_t _ALIGN(16) pad[4 * 16];
        int i;
 
        /* tstate is assumed to contain the midstate of key */
@@ -208,10 +208,10 @@ static inline void HMAC_SHA256_80_init_4way(const uint32_t *key,
 static inline void PBKDF2_SHA256_80_128_4way(const uint32_t *tstate,
        const uint32_t *ostate, const uint32_t *salt, uint32_t *output)
 {
-       uint32_t istate[4 * 8] __attribute__((aligned(16)));
-       uint32_t ostate2[4 * 8] __attribute__((aligned(16)));
-       uint32_t ibuf[4 * 16] __attribute__((aligned(16)));
-       uint32_t obuf[4 * 16] __attribute__((aligned(16)));
+       uint32_t _ALIGN(16) istate[4 * 8];
+       uint32_t _ALIGN(16) ostate2[4 * 8];
+       uint32_t _ALIGN(16) ibuf[4 * 16];
+       uint32_t _ALIGN(16) obuf[4 * 16];
        int i, j;
 
        memcpy(istate, tstate, 4 * 32);
@@ -239,7 +239,7 @@ static inline void PBKDF2_SHA256_80_128_4way(const uint32_t *tstate,
 static inline void PBKDF2_SHA256_128_32_4way(uint32_t *tstate,
        uint32_t *ostate, const uint32_t *salt, uint32_t *output)
 {
-       uint32_t buf[4 * 16] __attribute__((aligned(16)));
+       uint32_t _ALIGN(16) buf[4 * 16];
        int i;
        
        sha256_transform_4way(tstate, salt, 1);
@@ -531,10 +531,10 @@ static void scrypt_1024_1_1_256(const uint32_t *input, uint32_t *output,
 static void scrypt_1024_1_1_256_4way(const uint32_t *input,
        uint32_t *output, uint32_t *midstate, unsigned char *scratchpad, int N)
 {
-       uint32_t tstate[4 * 8] __attribute__((aligned(128)));
-       uint32_t ostate[4 * 8] __attribute__((aligned(128)));
-       uint32_t W[4 * 32] __attribute__((aligned(128)));
-       uint32_t X[4 * 32] __attribute__((aligned(128)));
+       uint32_t _ALIGN(128) tstate[4 * 8];
+       uint32_t _ALIGN(128) ostate[4 * 8];
+       uint32_t _ALIGN(128) W[4 * 32];
+       uint32_t _ALIGN(128) X[4 * 32];
        uint32_t *V;
        int i, k;
        
diff --git a/sha2.c b/sha2.c
index 08454733089e4846e83011fee61b453d133de3e0..77608364e098e39da939b0514ce38705959ddae7 100644 (file)
--- a/sha2.c
+++ b/sha2.c
@@ -471,10 +471,10 @@ void sha256d_ms_4way(uint32_t *hash,  uint32_t *data,
 static inline int scanhash_sha256d_4way(int thr_id, uint32_t *pdata,
        const uint32_t *ptarget, uint32_t max_nonce, uint64_t *hashes_done)
 {
-       uint32_t data[4 * 64] __attribute__((aligned(128)));
-       uint32_t hash[4 * 8] __attribute__((aligned(32)));
-       uint32_t midstate[4 * 8] __attribute__((aligned(32)));
-       uint32_t prehash[4 * 8] __attribute__((aligned(32)));
+       uint32_t _ALIGN(128) data[4 * 64];
+       uint32_t _ALIGN(32) hash[4 * 8];
+       uint32_t _ALIGN(32) midstate[4 * 8];
+       uint32_t _ALIGN(32) prehash[4 * 8];
        uint32_t n = pdata[19] - 1;
        const uint32_t first_nonce = pdata[19];
        const uint32_t Htarg = ptarget[7];
diff --git a/util.c b/util.c
index 7c788bca42a5c19c9a6a8fd460c0618e755781c3..ef4801e63f927284df9bef91320829992ddce24c 100644 (file)
--- a/util.c
+++ b/util.c
@@ -117,7 +117,7 @@ void applog(int prio, const char *fmt, ...)
                        case LOG_WARNING: color = CL_YLW; break;
                        case LOG_NOTICE:  color = CL_WHT; break;
                        case LOG_INFO:    color = ""; break;
-                       case LOG_DEBUG:   color = ""; break;
+                       case LOG_DEBUG:   color = CL_GRY; break;
 
                        case LOG_BLUE:
                                prio = LOG_NOTICE;
This page took 0.040728 seconds and 4 git commands to generate.