Speed up on 64bit systems by using 64bit registers.
This commit is contained in:
parent
76b80ded3a
commit
2aa15abd13
|
@ -0,0 +1,19 @@
|
||||||
|
#ifndef _MACHINE_DEFINITIONS_HEADER
|
||||||
|
#define _MACHINE_DEFINITIONS_HEADER
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
#undef MACHINE_16BIT
|
||||||
|
#undef MACHINE_32BIT
|
||||||
|
#undef MACHINE_64BIT
|
||||||
|
|
||||||
|
#if UINTPTR_MAX == UINT32_MAX
|
||||||
|
#define MACHINE_32BIT
|
||||||
|
#elif UINTPTR_MAX == UINT64_MAX
|
||||||
|
#define MACHINE_64BIT
|
||||||
|
#elif UINTPTR_MAX == UINT16_MAX
|
||||||
|
#define MACHINE_16BIT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
9
tfdef.h
9
tfdef.h
|
@ -11,11 +11,18 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include "machdefs.h"
|
||||||
|
|
||||||
|
#if defined(MACHINE_64BIT)
|
||||||
|
#define TF_UNIT_TYPE uint64_t
|
||||||
|
#define TF_NR_BLOCK_BITS 256
|
||||||
|
#define TF_NR_KEY_BITS 512
|
||||||
|
#else
|
||||||
#define TF_UNIT_TYPE uint32_t
|
#define TF_UNIT_TYPE uint32_t
|
||||||
|
|
||||||
#define TF_NR_BLOCK_BITS 128
|
#define TF_NR_BLOCK_BITS 128
|
||||||
#define TF_NR_KEY_BITS 256
|
#define TF_NR_KEY_BITS 256
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TF_NR_BLOCK_UNITS 4
|
#define TF_NR_BLOCK_UNITS 4
|
||||||
#define TF_NR_KEY_UNITS 8
|
#define TF_NR_KEY_UNITS 8
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue