Browse Source

cpu: Support all platform-applicable assembly algorithms, even if used CFLAGS don't support them

Luke Dashjr 12 years ago
parent
commit
2f4481d130
2 changed files with 12 additions and 8 deletions
  1. 7 3
      Makefile.am
  2. 5 5
      driver-cpu.h

+ 7 - 3
Makefile.am

@@ -72,13 +72,17 @@ bfgminer_SOURCES += scrypt.c scrypt.h
 endif
 
 if HAS_CPUMINE
-# original CPU related sources, unchanged
 bfgminer_SOURCES	+= \
-		  sha256_generic.c sha256_4way.c sha256_via.c	\
+		  sha256_generic.c sha256_via.c	\
 		  sha256_cryptopp.c sha256_sse2_amd64.c		\
-		  sha256_sse4_amd64.c sha256_sse2_i386.c	\
+		  sha256_sse4_amd64.c 	\
 		  sha256_altivec_4way.c
 
+bfgminer_LDADD += libsse2cpuminer.a
+noinst_LIBRARIES = libsse2cpuminer.a
+libsse2cpuminer_a_SOURCES = sha256_4way.c sha256_sse2_i386.c
+libsse2cpuminer_a_CFLAGS = $(bfgminer_CPPFLAGS) -msse2
+
 # the CPU portion extracted from original main.c
 bfgminer_SOURCES += driver-cpu.h driver-cpu.c
 

+ 5 - 5
driver-cpu.h

@@ -10,7 +10,7 @@
 #define OPT_SHOW_LEN 80
 #endif
 
-#ifdef __SSE2__
+#ifdef __i386__
 #define WANT_SSE2_4WAY 1
 #endif
 
@@ -18,19 +18,19 @@
 #define WANT_ALTIVEC_4WAY 1
 #endif
 
-#if defined(__i386__) && defined(HAS_YASM) && defined(__SSE2__)
+#ifdef __i386__
 #define WANT_X8632_SSE2 1
 #endif
 
-#if (defined(__i386__) || defined(__x86_64__)) &&  !defined(__APPLE__)
+#ifdef __i386__
 #define WANT_VIA_PADLOCK 1
 #endif
 
-#if defined(__x86_64__) && defined(HAS_YASM)
+#ifdef __x86_64__
 #define WANT_X8664_SSE2 1
 #endif
 
-#if defined(__x86_64__) && defined(HAS_YASM) && defined(__SSE4_1__)
+#ifdef __x86_64__
 #define WANT_X8664_SSE4 1
 #endif