driver-cpu.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef __DEVICE_CPU_H__
  2. #define __DEVICE_CPU_H__
  3. #include "miner.h"
  4. #include "config.h"
  5. #include <stdbool.h>
  6. #ifndef OPT_SHOW_LEN
  7. #define OPT_SHOW_LEN 80
  8. #endif
  9. #ifdef __i386__
  10. #define WANT_SSE2_4WAY 1
  11. #endif
  12. #ifdef __ALTIVEC__
  13. #define WANT_ALTIVEC_4WAY 1
  14. #endif
  15. #if defined(__i386__) && defined(HAVE_YASM)
  16. #define WANT_X8632_SSE2 1
  17. #endif
  18. #ifdef __i386__
  19. #define WANT_VIA_PADLOCK 1
  20. #endif
  21. #if defined(__x86_64__) && defined(HAVE_YASM)
  22. #define WANT_X8664_SSE2 1
  23. #endif
  24. #if defined(__x86_64__) && defined(HAVE_YASM)
  25. #define WANT_X8664_SSE4 1
  26. #endif
  27. #ifdef USE_SCRYPT
  28. #define WANT_SCRYPT
  29. #endif
  30. enum sha256_algos {
  31. ALGO_C, /* plain C */
  32. ALGO_4WAY, /* parallel SSE2 */
  33. ALGO_VIA, /* VIA padlock */
  34. ALGO_CRYPTOPP, /* Crypto++ (C) */
  35. ALGO_CRYPTOPP_ASM32, /* Crypto++ 32-bit assembly */
  36. ALGO_SSE2_32, /* SSE2 for x86_32 */
  37. ALGO_SSE2_64, /* SSE2 for x86_64 */
  38. ALGO_SSE4_64, /* SSE4 for x86_64 */
  39. ALGO_ALTIVEC_4WAY, /* parallel Altivec */
  40. ALGO_SCRYPT, /* scrypt */
  41. ALGO_FASTAUTO, /* fast autodetect */
  42. ALGO_AUTO /* autodetect */
  43. };
  44. extern const char *algo_names[];
  45. extern bool opt_usecpu;
  46. extern struct device_drv cpu_drv;
  47. extern char *set_algo(const char *arg, enum sha256_algos *algo);
  48. extern void show_algo(char buf[OPT_SHOW_LEN], const enum sha256_algos *algo);
  49. extern char *force_nthreads_int(const char *arg, int *i);
  50. extern void init_max_name_len();
  51. extern double bench_algo_stage3(enum sha256_algos algo);
  52. extern void set_scrypt_algo(enum sha256_algos *algo);
  53. #endif /* __DEVICE_CPU_H__ */