Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

simd.c File Reference
#include <stddef.h>
#include <string.h>
#include <limits.h>
#include "sph_simd.h"
+ Include dependency graph for simd.c:

Go to the source code of this file.

Macros

#define C32   SPH_C32
 
#define T32   SPH_T32
 
#define ROL32   SPH_ROTL32
 
#define XCAT(x, y)   XCAT_(x, y)
 
#define XCAT_(x, y)   x ## y
 
#define REDS1(x)   (((x) & 0xFF) - ((x) >> 8))
 
#define REDS2(x)   (((x) & 0xFFFF) + ((x) >> 16))
 
#define FFT_LOOP(rb, hk, as, id)
 
#define FFT8(xb, xs, d)
 
#define FFT16(xb, xs, rb)
 
#define FFT32(xb, xs, rb, id)
 
#define FFT64(xb, xs, rb, id)
 
#define FFT128(xb, xs, rb, id)
 
#define FFT256(xb, xs, rb, id)
 
#define INNER(l, h, mm)
 
#define W_SMALL(sb, o1, o2, mm)
 
#define WS_0_0   W_SMALL( 4, 0, 1, 185)
 
#define WS_0_1   W_SMALL( 6, 0, 1, 185)
 
#define WS_0_2   W_SMALL( 0, 0, 1, 185)
 
#define WS_0_3   W_SMALL( 2, 0, 1, 185)
 
#define WS_0_4   W_SMALL( 7, 0, 1, 185)
 
#define WS_0_5   W_SMALL( 5, 0, 1, 185)
 
#define WS_0_6   W_SMALL( 3, 0, 1, 185)
 
#define WS_0_7   W_SMALL( 1, 0, 1, 185)
 
#define WS_1_0   W_SMALL(15, 0, 1, 185)
 
#define WS_1_1   W_SMALL(11, 0, 1, 185)
 
#define WS_1_2   W_SMALL(12, 0, 1, 185)
 
#define WS_1_3   W_SMALL( 8, 0, 1, 185)
 
#define WS_1_4   W_SMALL( 9, 0, 1, 185)
 
#define WS_1_5   W_SMALL(13, 0, 1, 185)
 
#define WS_1_6   W_SMALL(10, 0, 1, 185)
 
#define WS_1_7   W_SMALL(14, 0, 1, 185)
 
#define WS_2_0   W_SMALL(17, -128, -64, 233)
 
#define WS_2_1   W_SMALL(18, -128, -64, 233)
 
#define WS_2_2   W_SMALL(23, -128, -64, 233)
 
#define WS_2_3   W_SMALL(20, -128, -64, 233)
 
#define WS_2_4   W_SMALL(22, -128, -64, 233)
 
#define WS_2_5   W_SMALL(21, -128, -64, 233)
 
#define WS_2_6   W_SMALL(16, -128, -64, 233)
 
#define WS_2_7   W_SMALL(19, -128, -64, 233)
 
#define WS_3_0   W_SMALL(30, -191, -127, 233)
 
#define WS_3_1   W_SMALL(24, -191, -127, 233)
 
#define WS_3_2   W_SMALL(25, -191, -127, 233)
 
#define WS_3_3   W_SMALL(31, -191, -127, 233)
 
#define WS_3_4   W_SMALL(27, -191, -127, 233)
 
#define WS_3_5   W_SMALL(29, -191, -127, 233)
 
#define WS_3_6   W_SMALL(28, -191, -127, 233)
 
#define WS_3_7   W_SMALL(26, -191, -127, 233)
 
#define W_BIG(sb, o1, o2, mm)
 
#define WB_0_0   W_BIG( 4, 0, 1, 185)
 
#define WB_0_1   W_BIG( 6, 0, 1, 185)
 
#define WB_0_2   W_BIG( 0, 0, 1, 185)
 
#define WB_0_3   W_BIG( 2, 0, 1, 185)
 
#define WB_0_4   W_BIG( 7, 0, 1, 185)
 
#define WB_0_5   W_BIG( 5, 0, 1, 185)
 
#define WB_0_6   W_BIG( 3, 0, 1, 185)
 
#define WB_0_7   W_BIG( 1, 0, 1, 185)
 
#define WB_1_0   W_BIG(15, 0, 1, 185)
 
#define WB_1_1   W_BIG(11, 0, 1, 185)
 
#define WB_1_2   W_BIG(12, 0, 1, 185)
 
#define WB_1_3   W_BIG( 8, 0, 1, 185)
 
#define WB_1_4   W_BIG( 9, 0, 1, 185)
 
#define WB_1_5   W_BIG(13, 0, 1, 185)
 
#define WB_1_6   W_BIG(10, 0, 1, 185)
 
#define WB_1_7   W_BIG(14, 0, 1, 185)
 
#define WB_2_0   W_BIG(17, -256, -128, 233)
 
#define WB_2_1   W_BIG(18, -256, -128, 233)
 
#define WB_2_2   W_BIG(23, -256, -128, 233)
 
#define WB_2_3   W_BIG(20, -256, -128, 233)
 
#define WB_2_4   W_BIG(22, -256, -128, 233)
 
#define WB_2_5   W_BIG(21, -256, -128, 233)
 
#define WB_2_6   W_BIG(16, -256, -128, 233)
 
#define WB_2_7   W_BIG(19, -256, -128, 233)
 
#define WB_3_0   W_BIG(30, -383, -255, 233)
 
#define WB_3_1   W_BIG(24, -383, -255, 233)
 
#define WB_3_2   W_BIG(25, -383, -255, 233)
 
#define WB_3_3   W_BIG(31, -383, -255, 233)
 
#define WB_3_4   W_BIG(27, -383, -255, 233)
 
#define WB_3_5   W_BIG(29, -383, -255, 233)
 
#define WB_3_6   W_BIG(28, -383, -255, 233)
 
#define WB_3_7   W_BIG(26, -383, -255, 233)
 
#define IF(x, y, z)   ((((y) ^ (z)) & (x)) ^ (z))
 
#define MAJ(x, y, z)   (((x) & (y)) | (((x) | (y)) & (z)))
 
#define PP4_0_0   1
 
#define PP4_0_1   0
 
#define PP4_0_2   3
 
#define PP4_0_3   2
 
#define PP4_1_0   2
 
#define PP4_1_1   3
 
#define PP4_1_2   0
 
#define PP4_1_3   1
 
#define PP4_2_0   3
 
#define PP4_2_1   2
 
#define PP4_2_2   1
 
#define PP4_2_3   0
 
#define PP8_0_0   1
 
#define PP8_0_1   0
 
#define PP8_0_2   3
 
#define PP8_0_3   2
 
#define PP8_0_4   5
 
#define PP8_0_5   4
 
#define PP8_0_6   7
 
#define PP8_0_7   6
 
#define PP8_1_0   6
 
#define PP8_1_1   7
 
#define PP8_1_2   4
 
#define PP8_1_3   5
 
#define PP8_1_4   2
 
#define PP8_1_5   3
 
#define PP8_1_6   0
 
#define PP8_1_7   1
 
#define PP8_2_0   2
 
#define PP8_2_1   3
 
#define PP8_2_2   0
 
#define PP8_2_3   1
 
#define PP8_2_4   6
 
#define PP8_2_5   7
 
#define PP8_2_6   4
 
#define PP8_2_7   5
 
#define PP8_3_0   3
 
#define PP8_3_1   2
 
#define PP8_3_2   1
 
#define PP8_3_3   0
 
#define PP8_3_4   7
 
#define PP8_3_5   6
 
#define PP8_3_6   5
 
#define PP8_3_7   4
 
#define PP8_4_0   5
 
#define PP8_4_1   4
 
#define PP8_4_2   7
 
#define PP8_4_3   6
 
#define PP8_4_4   1
 
#define PP8_4_5   0
 
#define PP8_4_6   3
 
#define PP8_4_7   2
 
#define PP8_5_0   7
 
#define PP8_5_1   6
 
#define PP8_5_2   5
 
#define PP8_5_3   4
 
#define PP8_5_4   3
 
#define PP8_5_5   2
 
#define PP8_5_6   1
 
#define PP8_5_7   0
 
#define PP8_6_0   4
 
#define PP8_6_1   5
 
#define PP8_6_2   6
 
#define PP8_6_3   7
 
#define PP8_6_4   0
 
#define PP8_6_5   1
 
#define PP8_6_6   2
 
#define PP8_6_7   3
 
#define DECL_STATE_SMALL   u32 A0, A1, A2, A3, B0, B1, B2, B3, C0, C1, C2, C3, D0, D1, D2, D3;
 
#define READ_STATE_SMALL(sc)
 
#define WRITE_STATE_SMALL(sc)
 
#define DECL_STATE_BIG
 
#define READ_STATE_BIG(sc)
 
#define WRITE_STATE_BIG(sc)
 
#define STEP_ELT(n, w, fun, s, ppb)
 
#define STEP_SMALL(w0, w1, w2, w3, fun, r, s, pp4b)
 
#define STEP_BIG(w0, w1, w2, w3, w4, w5, w6, w7, fun, r, s, pp8b)
 
#define M3_0_0   0_
 
#define M3_1_0   1_
 
#define M3_2_0   2_
 
#define M3_3_0   0_
 
#define M3_4_0   1_
 
#define M3_5_0   2_
 
#define M3_6_0   0_
 
#define M3_7_0   1_
 
#define M3_0_1   1_
 
#define M3_1_1   2_
 
#define M3_2_1   0_
 
#define M3_3_1   1_
 
#define M3_4_1   2_
 
#define M3_5_1   0_
 
#define M3_6_1   1_
 
#define M3_7_1   2_
 
#define M3_0_2   2_
 
#define M3_1_2   0_
 
#define M3_2_2   1_
 
#define M3_3_2   2_
 
#define M3_4_2   0_
 
#define M3_5_2   1_
 
#define M3_6_2   2_
 
#define M3_7_2   0_
 
#define STEP_SMALL_(w, fun, r, s, pp4b)   STEP_SMALL w, fun, r, s, pp4b)
 
#define ONE_ROUND_SMALL(ri, isp, p0, p1, p2, p3)
 
#define M7_0_0   0_
 
#define M7_1_0   1_
 
#define M7_2_0   2_
 
#define M7_3_0   3_
 
#define M7_4_0   4_
 
#define M7_5_0   5_
 
#define M7_6_0   6_
 
#define M7_7_0   0_
 
#define M7_0_1   1_
 
#define M7_1_1   2_
 
#define M7_2_1   3_
 
#define M7_3_1   4_
 
#define M7_4_1   5_
 
#define M7_5_1   6_
 
#define M7_6_1   0_
 
#define M7_7_1   1_
 
#define M7_0_2   2_
 
#define M7_1_2   3_
 
#define M7_2_2   4_
 
#define M7_3_2   5_
 
#define M7_4_2   6_
 
#define M7_5_2   0_
 
#define M7_6_2   1_
 
#define M7_7_2   2_
 
#define M7_0_3   3_
 
#define M7_1_3   4_
 
#define M7_2_3   5_
 
#define M7_3_3   6_
 
#define M7_4_3   0_
 
#define M7_5_3   1_
 
#define M7_6_3   2_
 
#define M7_7_3   3_
 
#define STEP_BIG_(w, fun, r, s, pp8b)   STEP_BIG w, fun, r, s, pp8b)
 
#define ONE_ROUND_BIG(ri, isp, p0, p1, p2, p3)
 

Typedefs

typedef sph_u32 u32
 
typedef sph_s32 s32
 

Functions

static void fft64 (unsigned char *x, size_t xs, s32 *q)
 
static void compress_small (sph_simd_small_context *sc, int last)
 
static void compress_big (sph_simd_big_context *sc, int last)
 
static void init_small (void *cc, const u32 *iv)
 
static void init_big (void *cc, const u32 *iv)
 
static void update_small (void *cc, const void *data, size_t len)
 
static void update_big (void *cc, const void *data, size_t len)
 
static void encode_count_small (unsigned char *dst, u32 low, u32 high, size_t ptr, unsigned n)
 
static void encode_count_big (unsigned char *dst, u32 low, u32 high, size_t ptr, unsigned n)
 
static void finalize_small (void *cc, unsigned ub, unsigned n, void *dst, size_t dst_len)
 
static void finalize_big (void *cc, unsigned ub, unsigned n, void *dst, size_t dst_len)
 
void sph_simd224_init (void *cc)
 Initialize an SIMD-224 context. More...
 
void sph_simd224 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_simd224_close (void *cc, void *dst)
 Terminate the current SIMD-224 computation and output the result into the provided buffer. More...
 
void sph_simd224_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst)
 Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (28 bytes). More...
 
void sph_simd256_init (void *cc)
 Initialize an SIMD-256 context. More...
 
void sph_simd256 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_simd256_close (void *cc, void *dst)
 Terminate the current SIMD-256 computation and output the result into the provided buffer. More...
 
void sph_simd256_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst)
 Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (32 bytes). More...
 
void sph_simd384_init (void *cc)
 Initialize an SIMD-384 context. More...
 
void sph_simd384 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_simd384_close (void *cc, void *dst)
 Terminate the current SIMD-384 computation and output the result into the provided buffer. More...
 
void sph_simd384_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst)
 Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (48 bytes). More...
 
void sph_simd512_init (void *cc)
 Initialize an SIMD-512 context. More...
 
void sph_simd512 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_simd512_close (void *cc, void *dst)
 Terminate the current SIMD-512 computation and output the result into the provided buffer. More...
 
void sph_simd512_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst)
 Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (64 bytes). More...
 

Variables

static const s32 alpha_tab []
 
static const unsigned short yoff_s_n []
 
static const unsigned short yoff_s_f []
 
static const unsigned short yoff_b_n []
 
static const unsigned short yoff_b_f []
 
static const u32 IV224 []
 
static const u32 IV256 []
 
static const u32 IV384 []
 
static const u32 IV512 []
 

Macro Definition Documentation

◆ C32

#define C32   SPH_C32

Definition at line 53 of file simd.c.

◆ DECL_STATE_BIG

#define DECL_STATE_BIG
Value:
u32 A0, A1, A2, A3, A4, A5, A6, A7; \
u32 B0, B1, B2, B3, B4, B5, B6, B7; \
u32 C0, C1, C2, C3, C4, C5, C6, C7; \
u32 D0, D1, D2, D3, D4, D5, D6, D7;
sph_u32 u32
Definition: simd.c:51

Definition at line 589 of file simd.c.

Referenced by compress_big().

◆ DECL_STATE_SMALL

#define DECL_STATE_SMALL   u32 A0, A1, A2, A3, B0, B1, B2, B3, C0, C1, C2, C3, D0, D1, D2, D3;

Definition at line 548 of file simd.c.

Referenced by compress_small().

◆ FFT128

#define FFT128 (   xb,
  xs,
  rb,
  id 
)
Value:
do { \
FFT64(xb, (xs) << 1, rb, XCAT(id, a)); \
FFT64((xb) + (xs), (xs) << 1, (rb) + 64, XCAT(id, b)); \
FFT_LOOP(rb, 64, 2, id); \
} while (0)
#define XCAT(x, y)
Definition: simd.c:57

Definition at line 245 of file simd.c.

Referenced by compress_small().

◆ FFT16

#define FFT16 (   xb,
  xs,
  rb 
)
Value:
do { \
s32 d1_0, d1_1, d1_2, d1_3, d1_4, d1_5, d1_6, d1_7; \
s32 d2_0, d2_1, d2_2, d2_3, d2_4, d2_5, d2_6, d2_7; \
FFT8(xb, (xs) << 1, d1_); \
FFT8((xb) + (xs), (xs) << 1, d2_); \
q[(rb) + 0] = d1_0 + d2_0; \
q[(rb) + 1] = d1_1 + (d2_1 << 1); \
q[(rb) + 2] = d1_2 + (d2_2 << 2); \
q[(rb) + 3] = d1_3 + (d2_3 << 3); \
q[(rb) + 4] = d1_4 + (d2_4 << 4); \
q[(rb) + 5] = d1_5 + (d2_5 << 5); \
q[(rb) + 6] = d1_6 + (d2_6 << 6); \
q[(rb) + 7] = d1_7 + (d2_7 << 7); \
q[(rb) + 8] = d1_0 - d2_0; \
q[(rb) + 9] = d1_1 - (d2_1 << 1); \
q[(rb) + 10] = d1_2 - (d2_2 << 2); \
q[(rb) + 11] = d1_3 - (d2_3 << 3); \
q[(rb) + 12] = d1_4 - (d2_4 << 4); \
q[(rb) + 13] = d1_5 - (d2_5 << 5); \
q[(rb) + 14] = d1_6 - (d2_6 << 6); \
q[(rb) + 15] = d1_7 - (d2_7 << 7); \
} while (0)

Definition at line 176 of file simd.c.

◆ FFT256

#define FFT256 (   xb,
  xs,
  rb,
  id 
)
Value:
do { \
fft64(x + (xb) + ((xs) * 0), (xs) << 2, &q[(rb) + 0]); \
fft64(x + (xb) + ((xs) * 2), (xs) << 2, &q[(rb) + 64]); \
FFT_LOOP(rb, 64, 2, XCAT(id, aa)); \
fft64(x + (xb) + ((xs) * 1), (xs) << 2, &q[(rb) + 128]); \
fft64(x + (xb) + ((xs) * 3), (xs) << 2, &q[(rb) + 192]); \
FFT_LOOP((rb) + 128, 64, 2, XCAT(id, ab)); \
FFT_LOOP(rb, 128, 1, XCAT(id, a)); \
} while (0)
#define XCAT(x, y)
Definition: simd.c:57

Definition at line 273 of file simd.c.

Referenced by compress_big().

◆ FFT32

#define FFT32 (   xb,
  xs,
  rb,
  id 
)
Value:
do { \
FFT16(xb, (xs) << 1, rb); \
FFT16((xb) + (xs), (xs) << 1, (rb) + 16); \
FFT_LOOP(rb, 16, 8, id); \
} while (0)

Definition at line 202 of file simd.c.

Referenced by fft64().

◆ FFT64

#define FFT64 (   xb,
  xs,
  rb,
  id 
)
Value:
do { \
FFT32(xb, (xs) << 1, rb, XCAT(id, a)); \
FFT32((xb) + (xs), (xs) << 1, (rb) + 32, XCAT(id, b)); \
FFT_LOOP(rb, 32, 4, id); \
} while (0)
#define XCAT(x, y)
Definition: simd.c:57

Definition at line 211 of file simd.c.

◆ FFT8

#define FFT8 (   xb,
  xs,
 
)
Value:
do { \
s32 x0 = x[(xb)]; \
s32 x1 = x[(xb) + (xs)]; \
s32 x2 = x[(xb) + 2 * (xs)]; \
s32 x3 = x[(xb) + 3 * (xs)]; \
s32 a0 = x0 + x2; \
s32 a1 = x0 + (x2 << 4); \
s32 a2 = x0 - x2; \
s32 a3 = x0 - (x2 << 4); \
s32 b0 = x1 + x3; \
s32 b1 = REDS1((x1 << 2) + (x3 << 6)); \
s32 b2 = (x1 << 4) - (x3 << 4); \
s32 b3 = REDS1((x1 << 6) + (x3 << 2)); \
d ## 0 = a0 + b0; \
d ## 1 = a1 + b1; \
d ## 2 = a2 + b2; \
d ## 3 = a3 + b3; \
d ## 4 = a0 - b0; \
d ## 5 = a1 - b1; \
d ## 6 = a2 - b2; \
d ## 7 = a3 - b3; \
} while (0)
#define REDS1(x)
Definition: simd.c:93

Definition at line 147 of file simd.c.

◆ FFT_LOOP

#define FFT_LOOP (   rb,
  hk,
  as,
  id 
)

Definition at line 102 of file simd.c.

Referenced by fft64().

◆ IF

#define IF (   x,
  y,
 
)    ((((y) ^ (z)) & (x)) ^ (z))

Definition at line 458 of file simd.c.

Referenced by compress_big(), and compress_small().

◆ INNER

#define INNER (   l,
  h,
  mm 
)
Value:
(((u32)((l) * (mm)) & 0xFFFFU) \
+ ((u32)((h) * (mm)) << 16))
sph_u32 u32
Definition: simd.c:51

Definition at line 373 of file simd.c.

◆ M3_0_0

#define M3_0_0   0_

Definition at line 705 of file simd.c.

◆ M3_0_1

#define M3_0_1   1_

Definition at line 714 of file simd.c.

◆ M3_0_2

#define M3_0_2   2_

Definition at line 723 of file simd.c.

◆ M3_1_0

#define M3_1_0   1_

Definition at line 706 of file simd.c.

◆ M3_1_1

#define M3_1_1   2_

Definition at line 715 of file simd.c.

◆ M3_1_2

#define M3_1_2   0_

Definition at line 724 of file simd.c.

◆ M3_2_0

#define M3_2_0   2_

Definition at line 707 of file simd.c.

◆ M3_2_1

#define M3_2_1   0_

Definition at line 716 of file simd.c.

◆ M3_2_2

#define M3_2_2   1_

Definition at line 725 of file simd.c.

◆ M3_3_0

#define M3_3_0   0_

Definition at line 708 of file simd.c.

◆ M3_3_1

#define M3_3_1   1_

Definition at line 717 of file simd.c.

◆ M3_3_2

#define M3_3_2   2_

Definition at line 726 of file simd.c.

◆ M3_4_0

#define M3_4_0   1_

Definition at line 709 of file simd.c.

◆ M3_4_1

#define M3_4_1   2_

Definition at line 718 of file simd.c.

◆ M3_4_2

#define M3_4_2   0_

Definition at line 727 of file simd.c.

◆ M3_5_0

#define M3_5_0   2_

Definition at line 710 of file simd.c.

◆ M3_5_1

#define M3_5_1   0_

Definition at line 719 of file simd.c.

◆ M3_5_2

#define M3_5_2   1_

Definition at line 728 of file simd.c.

◆ M3_6_0

#define M3_6_0   0_

Definition at line 711 of file simd.c.

◆ M3_6_1

#define M3_6_1   1_

Definition at line 720 of file simd.c.

◆ M3_6_2

#define M3_6_2   2_

Definition at line 729 of file simd.c.

◆ M3_7_0

#define M3_7_0   1_

Definition at line 712 of file simd.c.

◆ M3_7_1

#define M3_7_1   2_

Definition at line 721 of file simd.c.

◆ M3_7_2

#define M3_7_2   0_

Definition at line 730 of file simd.c.

◆ M7_0_0

#define M7_0_0   0_

Definition at line 753 of file simd.c.

◆ M7_0_1

#define M7_0_1   1_

Definition at line 762 of file simd.c.

◆ M7_0_2

#define M7_0_2   2_

Definition at line 771 of file simd.c.

◆ M7_0_3

#define M7_0_3   3_

Definition at line 780 of file simd.c.

◆ M7_1_0

#define M7_1_0   1_

Definition at line 754 of file simd.c.

◆ M7_1_1

#define M7_1_1   2_

Definition at line 763 of file simd.c.

◆ M7_1_2

#define M7_1_2   3_

Definition at line 772 of file simd.c.

◆ M7_1_3

#define M7_1_3   4_

Definition at line 781 of file simd.c.

◆ M7_2_0

#define M7_2_0   2_

Definition at line 755 of file simd.c.

◆ M7_2_1

#define M7_2_1   3_

Definition at line 764 of file simd.c.

◆ M7_2_2

#define M7_2_2   4_

Definition at line 773 of file simd.c.

◆ M7_2_3

#define M7_2_3   5_

Definition at line 782 of file simd.c.

◆ M7_3_0

#define M7_3_0   3_

Definition at line 756 of file simd.c.

◆ M7_3_1

#define M7_3_1   4_

Definition at line 765 of file simd.c.

◆ M7_3_2

#define M7_3_2   5_

Definition at line 774 of file simd.c.

◆ M7_3_3

#define M7_3_3   6_

Definition at line 783 of file simd.c.

◆ M7_4_0

#define M7_4_0   4_

Definition at line 757 of file simd.c.

◆ M7_4_1

#define M7_4_1   5_

Definition at line 766 of file simd.c.

◆ M7_4_2

#define M7_4_2   6_

Definition at line 775 of file simd.c.

◆ M7_4_3

#define M7_4_3   0_

Definition at line 784 of file simd.c.

◆ M7_5_0

#define M7_5_0   5_

Definition at line 758 of file simd.c.

◆ M7_5_1

#define M7_5_1   6_

Definition at line 767 of file simd.c.

◆ M7_5_2

#define M7_5_2   0_

Definition at line 776 of file simd.c.

◆ M7_5_3

#define M7_5_3   1_

Definition at line 785 of file simd.c.

◆ M7_6_0

#define M7_6_0   6_

Definition at line 759 of file simd.c.

◆ M7_6_1

#define M7_6_1   0_

Definition at line 768 of file simd.c.

◆ M7_6_2

#define M7_6_2   1_

Definition at line 777 of file simd.c.

◆ M7_6_3

#define M7_6_3   2_

Definition at line 786 of file simd.c.

◆ M7_7_0

#define M7_7_0   0_

Definition at line 760 of file simd.c.

◆ M7_7_1

#define M7_7_1   1_

Definition at line 769 of file simd.c.

◆ M7_7_2

#define M7_7_2   2_

Definition at line 778 of file simd.c.

◆ M7_7_3

#define M7_7_3   3_

Definition at line 787 of file simd.c.

◆ MAJ

#define MAJ (   x,
  y,
 
)    (((x) & (y)) | (((x) | (y)) & (z)))

Definition at line 459 of file simd.c.

◆ ONE_ROUND_BIG

#define ONE_ROUND_BIG (   ri,
  isp,
  p0,
  p1,
  p2,
  p3 
)
Value:
do { \
STEP_BIG_(WB_ ## ri ## 0, \
IF, p0, p1, XCAT(PP8_, M7_0_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 1, \
IF, p1, p2, XCAT(PP8_, M7_1_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 2, \
IF, p2, p3, XCAT(PP8_, M7_2_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 3, \
IF, p3, p0, XCAT(PP8_, M7_3_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 4, \
MAJ, p0, p1, XCAT(PP8_, M7_4_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 5, \
MAJ, p1, p2, XCAT(PP8_, M7_5_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 6, \
MAJ, p2, p3, XCAT(PP8_, M7_6_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 7, \
MAJ, p3, p0, XCAT(PP8_, M7_7_ ## isp)); \
} while (0)
#define IF(x, y, z)
Definition: simd.c:458
#define XCAT(x, y)
Definition: simd.c:57
#define MAJ(x, y, z)
Definition: simd.c:459

Definition at line 791 of file simd.c.

Referenced by compress_big().

◆ ONE_ROUND_SMALL

#define ONE_ROUND_SMALL (   ri,
  isp,
  p0,
  p1,
  p2,
  p3 
)
Value:
do { \
STEP_SMALL_(WS_ ## ri ## 0, \
IF, p0, p1, XCAT(PP4_, M3_0_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 1, \
IF, p1, p2, XCAT(PP4_, M3_1_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 2, \
IF, p2, p3, XCAT(PP4_, M3_2_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 3, \
IF, p3, p0, XCAT(PP4_, M3_3_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 4, \
MAJ, p0, p1, XCAT(PP4_, M3_4_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 5, \
MAJ, p1, p2, XCAT(PP4_, M3_5_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 6, \
MAJ, p2, p3, XCAT(PP4_, M3_6_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 7, \
MAJ, p3, p0, XCAT(PP4_, M3_7_ ## isp)); \
} while (0)
#define IF(x, y, z)
Definition: simd.c:458
#define XCAT(x, y)
Definition: simd.c:57
#define MAJ(x, y, z)
Definition: simd.c:459

Definition at line 734 of file simd.c.

Referenced by compress_small().

◆ PP4_0_0

#define PP4_0_0   1

Definition at line 461 of file simd.c.

◆ PP4_0_1

#define PP4_0_1   0

Definition at line 462 of file simd.c.

◆ PP4_0_2

#define PP4_0_2   3

Definition at line 463 of file simd.c.

◆ PP4_0_3

#define PP4_0_3   2

Definition at line 464 of file simd.c.

◆ PP4_1_0

#define PP4_1_0   2

Definition at line 465 of file simd.c.

◆ PP4_1_1

#define PP4_1_1   3

Definition at line 466 of file simd.c.

◆ PP4_1_2

#define PP4_1_2   0

Definition at line 467 of file simd.c.

◆ PP4_1_3

#define PP4_1_3   1

Definition at line 468 of file simd.c.

◆ PP4_2_0

#define PP4_2_0   3

Definition at line 469 of file simd.c.

◆ PP4_2_1

#define PP4_2_1   2

Definition at line 470 of file simd.c.

◆ PP4_2_2

#define PP4_2_2   1

Definition at line 471 of file simd.c.

◆ PP4_2_3

#define PP4_2_3   0

Definition at line 472 of file simd.c.

◆ PP8_0_0

#define PP8_0_0   1

Definition at line 474 of file simd.c.

◆ PP8_0_1

#define PP8_0_1   0

Definition at line 475 of file simd.c.

◆ PP8_0_2

#define PP8_0_2   3

Definition at line 476 of file simd.c.

◆ PP8_0_3

#define PP8_0_3   2

Definition at line 477 of file simd.c.

◆ PP8_0_4

#define PP8_0_4   5

Definition at line 478 of file simd.c.

◆ PP8_0_5

#define PP8_0_5   4

Definition at line 479 of file simd.c.

◆ PP8_0_6

#define PP8_0_6   7

Definition at line 480 of file simd.c.

◆ PP8_0_7

#define PP8_0_7   6

Definition at line 481 of file simd.c.

◆ PP8_1_0

#define PP8_1_0   6

Definition at line 483 of file simd.c.

◆ PP8_1_1

#define PP8_1_1   7

Definition at line 484 of file simd.c.

◆ PP8_1_2

#define PP8_1_2   4

Definition at line 485 of file simd.c.

◆ PP8_1_3

#define PP8_1_3   5

Definition at line 486 of file simd.c.

◆ PP8_1_4

#define PP8_1_4   2

Definition at line 487 of file simd.c.

◆ PP8_1_5

#define PP8_1_5   3

Definition at line 488 of file simd.c.

◆ PP8_1_6

#define PP8_1_6   0

Definition at line 489 of file simd.c.

◆ PP8_1_7

#define PP8_1_7   1

Definition at line 490 of file simd.c.

◆ PP8_2_0

#define PP8_2_0   2

Definition at line 492 of file simd.c.

◆ PP8_2_1

#define PP8_2_1   3

Definition at line 493 of file simd.c.

◆ PP8_2_2

#define PP8_2_2   0

Definition at line 494 of file simd.c.

◆ PP8_2_3

#define PP8_2_3   1

Definition at line 495 of file simd.c.

◆ PP8_2_4

#define PP8_2_4   6

Definition at line 496 of file simd.c.

◆ PP8_2_5

#define PP8_2_5   7

Definition at line 497 of file simd.c.

◆ PP8_2_6

#define PP8_2_6   4

Definition at line 498 of file simd.c.

◆ PP8_2_7

#define PP8_2_7   5

Definition at line 499 of file simd.c.

◆ PP8_3_0

#define PP8_3_0   3

Definition at line 501 of file simd.c.

◆ PP8_3_1

#define PP8_3_1   2

Definition at line 502 of file simd.c.

◆ PP8_3_2

#define PP8_3_2   1

Definition at line 503 of file simd.c.

◆ PP8_3_3

#define PP8_3_3   0

Definition at line 504 of file simd.c.

◆ PP8_3_4

#define PP8_3_4   7

Definition at line 505 of file simd.c.

◆ PP8_3_5

#define PP8_3_5   6

Definition at line 506 of file simd.c.

◆ PP8_3_6

#define PP8_3_6   5

Definition at line 507 of file simd.c.

◆ PP8_3_7

#define PP8_3_7   4

Definition at line 508 of file simd.c.

◆ PP8_4_0

#define PP8_4_0   5

Definition at line 510 of file simd.c.

◆ PP8_4_1

#define PP8_4_1   4

Definition at line 511 of file simd.c.

◆ PP8_4_2

#define PP8_4_2   7

Definition at line 512 of file simd.c.

◆ PP8_4_3

#define PP8_4_3   6

Definition at line 513 of file simd.c.

◆ PP8_4_4

#define PP8_4_4   1

Definition at line 514 of file simd.c.

◆ PP8_4_5

#define PP8_4_5   0

Definition at line 515 of file simd.c.

◆ PP8_4_6

#define PP8_4_6   3

Definition at line 516 of file simd.c.

◆ PP8_4_7

#define PP8_4_7   2

Definition at line 517 of file simd.c.

◆ PP8_5_0

#define PP8_5_0   7

Definition at line 519 of file simd.c.

◆ PP8_5_1

#define PP8_5_1   6

Definition at line 520 of file simd.c.

◆ PP8_5_2

#define PP8_5_2   5

Definition at line 521 of file simd.c.

◆ PP8_5_3

#define PP8_5_3   4

Definition at line 522 of file simd.c.

◆ PP8_5_4

#define PP8_5_4   3

Definition at line 523 of file simd.c.

◆ PP8_5_5

#define PP8_5_5   2

Definition at line 524 of file simd.c.

◆ PP8_5_6

#define PP8_5_6   1

Definition at line 525 of file simd.c.

◆ PP8_5_7

#define PP8_5_7   0

Definition at line 526 of file simd.c.

◆ PP8_6_0

#define PP8_6_0   4

Definition at line 528 of file simd.c.

◆ PP8_6_1

#define PP8_6_1   5

Definition at line 529 of file simd.c.

◆ PP8_6_2

#define PP8_6_2   6

Definition at line 530 of file simd.c.

◆ PP8_6_3

#define PP8_6_3   7

Definition at line 531 of file simd.c.

◆ PP8_6_4

#define PP8_6_4   0

Definition at line 532 of file simd.c.

◆ PP8_6_5

#define PP8_6_5   1

Definition at line 533 of file simd.c.

◆ PP8_6_6

#define PP8_6_6   2

Definition at line 534 of file simd.c.

◆ PP8_6_7

#define PP8_6_7   3

Definition at line 535 of file simd.c.

◆ READ_STATE_BIG

#define READ_STATE_BIG (   sc)

Definition at line 595 of file simd.c.

Referenced by compress_big().

◆ READ_STATE_SMALL

#define READ_STATE_SMALL (   sc)
Value:
do { \
A0 = (sc)->state[ 0]; \
A1 = (sc)->state[ 1]; \
A2 = (sc)->state[ 2]; \
A3 = (sc)->state[ 3]; \
B0 = (sc)->state[ 4]; \
B1 = (sc)->state[ 5]; \
B2 = (sc)->state[ 6]; \
B3 = (sc)->state[ 7]; \
C0 = (sc)->state[ 8]; \
C1 = (sc)->state[ 9]; \
C2 = (sc)->state[10]; \
C3 = (sc)->state[11]; \
D0 = (sc)->state[12]; \
D1 = (sc)->state[13]; \
D2 = (sc)->state[14]; \
D3 = (sc)->state[15]; \
} while (0)

Definition at line 551 of file simd.c.

Referenced by compress_small().

◆ REDS1

#define REDS1 (   x)    (((x) & 0xFF) - ((x) >> 8))

Definition at line 93 of file simd.c.

Referenced by compress_big(), and compress_small().

◆ REDS2

#define REDS2 (   x)    (((x) & 0xFFFF) + ((x) >> 16))

Definition at line 94 of file simd.c.

Referenced by compress_big(), and compress_small().

◆ ROL32

#define ROL32   SPH_ROTL32

Definition at line 55 of file simd.c.

◆ STEP_BIG

#define STEP_BIG (   w0,
  w1,
  w2,
  w3,
  w4,
  w5,
  w6,
  w7,
  fun,
  r,
  s,
  pp8b 
)
Value:
do { \
u32 tA0 = ROL32(A0, r); \
u32 tA1 = ROL32(A1, r); \
u32 tA2 = ROL32(A2, r); \
u32 tA3 = ROL32(A3, r); \
u32 tA4 = ROL32(A4, r); \
u32 tA5 = ROL32(A5, r); \
u32 tA6 = ROL32(A6, r); \
u32 tA7 = ROL32(A7, r); \
STEP_ELT(0, w0, fun, s, pp8b); \
STEP_ELT(1, w1, fun, s, pp8b); \
STEP_ELT(2, w2, fun, s, pp8b); \
STEP_ELT(3, w3, fun, s, pp8b); \
STEP_ELT(4, w4, fun, s, pp8b); \
STEP_ELT(5, w5, fun, s, pp8b); \
STEP_ELT(6, w6, fun, s, pp8b); \
STEP_ELT(7, w7, fun, s, pp8b); \
} while (0)
#define ROL32
Definition: simd.c:55

Definition at line 686 of file simd.c.

Referenced by compress_big().

◆ STEP_BIG_

#define STEP_BIG_ (   w,
  fun,
  r,
  s,
  pp8b 
)    STEP_BIG w, fun, r, s, pp8b)

Definition at line 789 of file simd.c.

◆ STEP_ELT

#define STEP_ELT (   n,
  w,
  fun,
  s,
  ppb 
)
Value:
do { \
u32 tt = T32(D ## n + (w) + fun(A ## n, B ## n, C ## n)); \
A ## n = T32(ROL32(tt, s) + XCAT(tA, XCAT(ppb, n))); \
D ## n = C ## n; \
C ## n = B ## n; \
B ## n = tA ## n; \
} while (0)
static const sph_u32 C[]
Definition: jh.c:370
#define XCAT(x, y)
Definition: simd.c:57
#define T32
Definition: simd.c:54
#define ROL32
Definition: simd.c:55

Definition at line 667 of file simd.c.

◆ STEP_SMALL

#define STEP_SMALL (   w0,
  w1,
  w2,
  w3,
  fun,
  r,
  s,
  pp4b 
)
Value:
do { \
u32 tA0 = ROL32(A0, r); \
u32 tA1 = ROL32(A1, r); \
u32 tA2 = ROL32(A2, r); \
u32 tA3 = ROL32(A3, r); \
STEP_ELT(0, w0, fun, s, pp4b); \
STEP_ELT(1, w1, fun, s, pp4b); \
STEP_ELT(2, w2, fun, s, pp4b); \
STEP_ELT(3, w3, fun, s, pp4b); \
} while (0)
#define ROL32
Definition: simd.c:55

Definition at line 675 of file simd.c.

Referenced by compress_small().

◆ STEP_SMALL_

#define STEP_SMALL_ (   w,
  fun,
  r,
  s,
  pp4b 
)    STEP_SMALL w, fun, r, s, pp4b)

Definition at line 732 of file simd.c.

◆ T32

#define T32   SPH_T32

Definition at line 54 of file simd.c.

Referenced by encode_count_big(), encode_count_small(), update_big(), and update_small().

◆ W_BIG

#define W_BIG (   sb,
  o1,
  o2,
  mm 
)
Value:
(INNER(q[16 * (sb) + 2 * 0 + o1], q[16 * (sb) + 2 * 0 + o2], mm), \
INNER(q[16 * (sb) + 2 * 1 + o1], q[16 * (sb) + 2 * 1 + o2], mm), \
INNER(q[16 * (sb) + 2 * 2 + o1], q[16 * (sb) + 2 * 2 + o2], mm), \
INNER(q[16 * (sb) + 2 * 3 + o1], q[16 * (sb) + 2 * 3 + o2], mm), \
INNER(q[16 * (sb) + 2 * 4 + o1], q[16 * (sb) + 2 * 4 + o2], mm), \
INNER(q[16 * (sb) + 2 * 5 + o1], q[16 * (sb) + 2 * 5 + o2], mm), \
INNER(q[16 * (sb) + 2 * 6 + o1], q[16 * (sb) + 2 * 6 + o2], mm), \
INNER(q[16 * (sb) + 2 * 7 + o1], q[16 * (sb) + 2 * 7 + o2], mm)
#define INNER(l, h, mm)
Definition: simd.c:373

Definition at line 415 of file simd.c.

◆ W_SMALL

#define W_SMALL (   sb,
  o1,
  o2,
  mm 
)
Value:
(INNER(q[8 * (sb) + 2 * 0 + o1], q[8 * (sb) + 2 * 0 + o2], mm), \
INNER(q[8 * (sb) + 2 * 1 + o1], q[8 * (sb) + 2 * 1 + o2], mm), \
INNER(q[8 * (sb) + 2 * 2 + o1], q[8 * (sb) + 2 * 2 + o2], mm), \
INNER(q[8 * (sb) + 2 * 3 + o1], q[8 * (sb) + 2 * 3 + o2], mm)
#define INNER(l, h, mm)
Definition: simd.c:373

Definition at line 376 of file simd.c.

◆ WB_0_0

#define WB_0_0   W_BIG( 4, 0, 1, 185)

Definition at line 425 of file simd.c.

◆ WB_0_1

#define WB_0_1   W_BIG( 6, 0, 1, 185)

Definition at line 426 of file simd.c.

◆ WB_0_2

#define WB_0_2   W_BIG( 0, 0, 1, 185)

Definition at line 427 of file simd.c.

◆ WB_0_3

#define WB_0_3   W_BIG( 2, 0, 1, 185)

Definition at line 428 of file simd.c.

◆ WB_0_4

#define WB_0_4   W_BIG( 7, 0, 1, 185)

Definition at line 429 of file simd.c.

◆ WB_0_5

#define WB_0_5   W_BIG( 5, 0, 1, 185)

Definition at line 430 of file simd.c.

◆ WB_0_6

#define WB_0_6   W_BIG( 3, 0, 1, 185)

Definition at line 431 of file simd.c.

◆ WB_0_7

#define WB_0_7   W_BIG( 1, 0, 1, 185)

Definition at line 432 of file simd.c.

◆ WB_1_0

#define WB_1_0   W_BIG(15, 0, 1, 185)

Definition at line 433 of file simd.c.

◆ WB_1_1

#define WB_1_1   W_BIG(11, 0, 1, 185)

Definition at line 434 of file simd.c.

◆ WB_1_2

#define WB_1_2   W_BIG(12, 0, 1, 185)

Definition at line 435 of file simd.c.

◆ WB_1_3

#define WB_1_3   W_BIG( 8, 0, 1, 185)

Definition at line 436 of file simd.c.

◆ WB_1_4

#define WB_1_4   W_BIG( 9, 0, 1, 185)

Definition at line 437 of file simd.c.

◆ WB_1_5

#define WB_1_5   W_BIG(13, 0, 1, 185)

Definition at line 438 of file simd.c.

◆ WB_1_6

#define WB_1_6   W_BIG(10, 0, 1, 185)

Definition at line 439 of file simd.c.

◆ WB_1_7

#define WB_1_7   W_BIG(14, 0, 1, 185)

Definition at line 440 of file simd.c.

◆ WB_2_0

#define WB_2_0   W_BIG(17, -256, -128, 233)

Definition at line 441 of file simd.c.

◆ WB_2_1

#define WB_2_1   W_BIG(18, -256, -128, 233)

Definition at line 442 of file simd.c.

◆ WB_2_2

#define WB_2_2   W_BIG(23, -256, -128, 233)

Definition at line 443 of file simd.c.

◆ WB_2_3

#define WB_2_3   W_BIG(20, -256, -128, 233)

Definition at line 444 of file simd.c.

◆ WB_2_4

#define WB_2_4   W_BIG(22, -256, -128, 233)

Definition at line 445 of file simd.c.

◆ WB_2_5

#define WB_2_5   W_BIG(21, -256, -128, 233)

Definition at line 446 of file simd.c.

◆ WB_2_6

#define WB_2_6   W_BIG(16, -256, -128, 233)

Definition at line 447 of file simd.c.

◆ WB_2_7

#define WB_2_7   W_BIG(19, -256, -128, 233)

Definition at line 448 of file simd.c.

◆ WB_3_0

#define WB_3_0   W_BIG(30, -383, -255, 233)

Definition at line 449 of file simd.c.

◆ WB_3_1

#define WB_3_1   W_BIG(24, -383, -255, 233)

Definition at line 450 of file simd.c.

◆ WB_3_2

#define WB_3_2   W_BIG(25, -383, -255, 233)

Definition at line 451 of file simd.c.

◆ WB_3_3

#define WB_3_3   W_BIG(31, -383, -255, 233)

Definition at line 452 of file simd.c.

◆ WB_3_4

#define WB_3_4   W_BIG(27, -383, -255, 233)

Definition at line 453 of file simd.c.

◆ WB_3_5

#define WB_3_5   W_BIG(29, -383, -255, 233)

Definition at line 454 of file simd.c.

◆ WB_3_6

#define WB_3_6   W_BIG(28, -383, -255, 233)

Definition at line 455 of file simd.c.

◆ WB_3_7

#define WB_3_7   W_BIG(26, -383, -255, 233)

Definition at line 456 of file simd.c.

◆ WRITE_STATE_BIG

#define WRITE_STATE_BIG (   sc)

Definition at line 630 of file simd.c.

Referenced by compress_big().

◆ WRITE_STATE_SMALL

#define WRITE_STATE_SMALL (   sc)
Value:
do { \
(sc)->state[ 0] = A0; \
(sc)->state[ 1] = A1; \
(sc)->state[ 2] = A2; \
(sc)->state[ 3] = A3; \
(sc)->state[ 4] = B0; \
(sc)->state[ 5] = B1; \
(sc)->state[ 6] = B2; \
(sc)->state[ 7] = B3; \
(sc)->state[ 8] = C0; \
(sc)->state[ 9] = C1; \
(sc)->state[10] = C2; \
(sc)->state[11] = C3; \
(sc)->state[12] = D0; \
(sc)->state[13] = D1; \
(sc)->state[14] = D2; \
(sc)->state[15] = D3; \
} while (0)

Definition at line 570 of file simd.c.

Referenced by compress_small().

◆ WS_0_0

#define WS_0_0   W_SMALL( 4, 0, 1, 185)

Definition at line 382 of file simd.c.

◆ WS_0_1

#define WS_0_1   W_SMALL( 6, 0, 1, 185)

Definition at line 383 of file simd.c.

◆ WS_0_2

#define WS_0_2   W_SMALL( 0, 0, 1, 185)

Definition at line 384 of file simd.c.

◆ WS_0_3

#define WS_0_3   W_SMALL( 2, 0, 1, 185)

Definition at line 385 of file simd.c.

◆ WS_0_4

#define WS_0_4   W_SMALL( 7, 0, 1, 185)

Definition at line 386 of file simd.c.

◆ WS_0_5

#define WS_0_5   W_SMALL( 5, 0, 1, 185)

Definition at line 387 of file simd.c.

◆ WS_0_6

#define WS_0_6   W_SMALL( 3, 0, 1, 185)

Definition at line 388 of file simd.c.

◆ WS_0_7

#define WS_0_7   W_SMALL( 1, 0, 1, 185)

Definition at line 389 of file simd.c.

◆ WS_1_0

#define WS_1_0   W_SMALL(15, 0, 1, 185)

Definition at line 390 of file simd.c.

◆ WS_1_1

#define WS_1_1   W_SMALL(11, 0, 1, 185)

Definition at line 391 of file simd.c.

◆ WS_1_2

#define WS_1_2   W_SMALL(12, 0, 1, 185)

Definition at line 392 of file simd.c.

◆ WS_1_3

#define WS_1_3   W_SMALL( 8, 0, 1, 185)

Definition at line 393 of file simd.c.

◆ WS_1_4

#define WS_1_4   W_SMALL( 9, 0, 1, 185)

Definition at line 394 of file simd.c.

◆ WS_1_5

#define WS_1_5   W_SMALL(13, 0, 1, 185)

Definition at line 395 of file simd.c.

◆ WS_1_6

#define WS_1_6   W_SMALL(10, 0, 1, 185)

Definition at line 396 of file simd.c.

◆ WS_1_7

#define WS_1_7   W_SMALL(14, 0, 1, 185)

Definition at line 397 of file simd.c.

◆ WS_2_0

#define WS_2_0   W_SMALL(17, -128, -64, 233)

Definition at line 398 of file simd.c.

◆ WS_2_1

#define WS_2_1   W_SMALL(18, -128, -64, 233)

Definition at line 399 of file simd.c.

◆ WS_2_2

#define WS_2_2   W_SMALL(23, -128, -64, 233)

Definition at line 400 of file simd.c.

◆ WS_2_3

#define WS_2_3   W_SMALL(20, -128, -64, 233)

Definition at line 401 of file simd.c.

◆ WS_2_4

#define WS_2_4   W_SMALL(22, -128, -64, 233)

Definition at line 402 of file simd.c.

◆ WS_2_5

#define WS_2_5   W_SMALL(21, -128, -64, 233)

Definition at line 403 of file simd.c.

◆ WS_2_6

#define WS_2_6   W_SMALL(16, -128, -64, 233)

Definition at line 404 of file simd.c.

◆ WS_2_7

#define WS_2_7   W_SMALL(19, -128, -64, 233)

Definition at line 405 of file simd.c.

◆ WS_3_0

#define WS_3_0   W_SMALL(30, -191, -127, 233)

Definition at line 406 of file simd.c.

◆ WS_3_1

#define WS_3_1   W_SMALL(24, -191, -127, 233)

Definition at line 407 of file simd.c.

◆ WS_3_2

#define WS_3_2   W_SMALL(25, -191, -127, 233)

Definition at line 408 of file simd.c.

◆ WS_3_3

#define WS_3_3   W_SMALL(31, -191, -127, 233)

Definition at line 409 of file simd.c.

◆ WS_3_4

#define WS_3_4   W_SMALL(27, -191, -127, 233)

Definition at line 410 of file simd.c.

◆ WS_3_5

#define WS_3_5   W_SMALL(29, -191, -127, 233)

Definition at line 411 of file simd.c.

◆ WS_3_6

#define WS_3_6   W_SMALL(28, -191, -127, 233)

Definition at line 412 of file simd.c.

◆ WS_3_7

#define WS_3_7   W_SMALL(26, -191, -127, 233)

Definition at line 413 of file simd.c.

◆ XCAT

#define XCAT (   x,
 
)    XCAT_(x, y)

Definition at line 57 of file simd.c.

◆ XCAT_

#define XCAT_ (   x,
 
)    x ## y

Definition at line 58 of file simd.c.

Typedef Documentation

◆ s32

typedef sph_s32 s32

Definition at line 52 of file simd.c.

◆ u32

typedef sph_u32 u32

Definition at line 51 of file simd.c.

Function Documentation

◆ compress_big()

◆ compress_small()

◆ encode_count_big()

static void encode_count_big ( unsigned char *  dst,
u32  low,
u32  high,
size_t  ptr,
unsigned  n 
)
static

Definition at line 1644 of file simd.c.

References high, low, sph_enc32le(), and T32.

Referenced by finalize_big().

◆ encode_count_small()

static void encode_count_small ( unsigned char *  dst,
u32  low,
u32  high,
size_t  ptr,
unsigned  n 
)
static

Definition at line 1633 of file simd.c.

References high, low, sph_enc32le(), and T32.

Referenced by finalize_small().

◆ fft64()

static void fft64 ( unsigned char *  x,
size_t  xs,
s32 q 
)
static

Definition at line 260 of file simd.c.

References FFT32, and FFT_LOOP.

◆ finalize_big()

static void finalize_big ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst,
size_t  dst_len 
)
static

◆ finalize_small()

static void finalize_small ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst,
size_t  dst_len 
)
static

◆ init_big()

static void init_big ( void *  cc,
const u32 iv 
)
static

◆ init_small()

static void init_small ( void *  cc,
const u32 iv 
)
static

◆ sph_simd224()

void sph_simd224 ( void *  cc,
const void *  data,
size_t  len 
)

Process some data bytes.

It is acceptable that len is zero (in which case this function does nothing).

Parameters
ccthe SIMD-224 context
datathe input data
lenthe input data length (in bytes)

Definition at line 1705 of file simd.c.

References update_small().

◆ sph_simd224_addbits_and_close()

void sph_simd224_addbits_and_close ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst 
)

Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (28 bytes).

If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.

Parameters
ccthe SIMD-224 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 1717 of file simd.c.

References finalize_small(), and sph_simd224_init().

Referenced by sph_simd224_close().

◆ sph_simd224_close()

void sph_simd224_close ( void *  cc,
void *  dst 
)

Terminate the current SIMD-224 computation and output the result into the provided buffer.

The destination buffer must be wide enough to accomodate the result (28 bytes). The context is automatically reinitialized.

Parameters
ccthe SIMD-224 context
dstthe destination buffer

Definition at line 1711 of file simd.c.

References sph_simd224_addbits_and_close().

◆ sph_simd224_init()

void sph_simd224_init ( void *  cc)

Initialize an SIMD-224 context.

This process performs no memory allocation.

Parameters
ccthe SIMD-224 context (pointer to a sph_simd224_context)

Definition at line 1699 of file simd.c.

References init_small(), and IV224.

Referenced by sph_simd224_addbits_and_close().

◆ sph_simd256()

void sph_simd256 ( void *  cc,
const void *  data,
size_t  len 
)

Process some data bytes.

It is acceptable that len is zero (in which case this function does nothing).

Parameters
ccthe SIMD-256 context
datathe input data
lenthe input data length (in bytes)

Definition at line 1730 of file simd.c.

References update_small().

◆ sph_simd256_addbits_and_close()

void sph_simd256_addbits_and_close ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst 
)

Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (32 bytes).

If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.

Parameters
ccthe SIMD-256 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 1742 of file simd.c.

References finalize_small(), and sph_simd256_init().

Referenced by sph_simd256_close().

◆ sph_simd256_close()

void sph_simd256_close ( void *  cc,
void *  dst 
)

Terminate the current SIMD-256 computation and output the result into the provided buffer.

The destination buffer must be wide enough to accomodate the result (32 bytes). The context is automatically reinitialized.

Parameters
ccthe SIMD-256 context
dstthe destination buffer

Definition at line 1736 of file simd.c.

References sph_simd256_addbits_and_close().

◆ sph_simd256_init()

void sph_simd256_init ( void *  cc)

Initialize an SIMD-256 context.

This process performs no memory allocation.

Parameters
ccthe SIMD-256 context (pointer to a sph_simd256_context)

Definition at line 1724 of file simd.c.

References init_small(), and IV256.

Referenced by sph_simd256_addbits_and_close().

◆ sph_simd384()

void sph_simd384 ( void *  cc,
const void *  data,
size_t  len 
)

Process some data bytes.

It is acceptable that len is zero (in which case this function does nothing).

Parameters
ccthe SIMD-384 context
datathe input data
lenthe input data length (in bytes)

Definition at line 1755 of file simd.c.

References update_big().

◆ sph_simd384_addbits_and_close()

void sph_simd384_addbits_and_close ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst 
)

Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (48 bytes).

If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.

Parameters
ccthe SIMD-384 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 1767 of file simd.c.

References finalize_big(), and sph_simd384_init().

Referenced by sph_simd384_close().

◆ sph_simd384_close()

void sph_simd384_close ( void *  cc,
void *  dst 
)

Terminate the current SIMD-384 computation and output the result into the provided buffer.

The destination buffer must be wide enough to accomodate the result (48 bytes). The context is automatically reinitialized.

Parameters
ccthe SIMD-384 context
dstthe destination buffer

Definition at line 1761 of file simd.c.

References sph_simd384_addbits_and_close().

◆ sph_simd384_init()

void sph_simd384_init ( void *  cc)

Initialize an SIMD-384 context.

This process performs no memory allocation.

Parameters
ccthe SIMD-384 context (pointer to a sph_simd384_context)

Definition at line 1749 of file simd.c.

References init_big(), and IV384.

Referenced by sph_simd384_addbits_and_close().

◆ sph_simd512()

void sph_simd512 ( void *  cc,
const void *  data,
size_t  len 
)

Process some data bytes.

It is acceptable that len is zero (in which case this function does nothing).

Parameters
ccthe SIMD-512 context
datathe input data
lenthe input data length (in bytes)

Definition at line 1780 of file simd.c.

References update_big().

Referenced by HashX11().

◆ sph_simd512_addbits_and_close()

void sph_simd512_addbits_and_close ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst 
)

Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (64 bytes).

If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.

Parameters
ccthe SIMD-512 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 1792 of file simd.c.

References finalize_big(), and sph_simd512_init().

Referenced by sph_simd512_close().

◆ sph_simd512_close()

void sph_simd512_close ( void *  cc,
void *  dst 
)

Terminate the current SIMD-512 computation and output the result into the provided buffer.

The destination buffer must be wide enough to accomodate the result (64 bytes). The context is automatically reinitialized.

Parameters
ccthe SIMD-512 context
dstthe destination buffer

Definition at line 1786 of file simd.c.

References sph_simd512_addbits_and_close().

Referenced by HashX11().

◆ sph_simd512_init()

void sph_simd512_init ( void *  cc)

Initialize an SIMD-512 context.

This process performs no memory allocation.

Parameters
ccthe SIMD-512 context (pointer to a sph_simd512_context)

Definition at line 1774 of file simd.c.

References init_big(), and IV512.

Referenced by HashX11(), and sph_simd512_addbits_and_close().

◆ update_big()

static void update_big ( void *  cc,
const void *  data,
size_t  len 
)
static

◆ update_small()

static void update_small ( void *  cc,
const void *  data,
size_t  len 
)
static

Variable Documentation

◆ alpha_tab

const s32 alpha_tab[]
static
Initial value:
= {
1, 41, 139, 45, 46, 87, 226, 14, 60, 147, 116, 130,
190, 80, 196, 69, 2, 82, 21, 90, 92, 174, 195, 28,
120, 37, 232, 3, 123, 160, 135, 138, 4, 164, 42, 180,
184, 91, 133, 56, 240, 74, 207, 6, 246, 63, 13, 19,
8, 71, 84, 103, 111, 182, 9, 112, 223, 148, 157, 12,
235, 126, 26, 38, 16, 142, 168, 206, 222, 107, 18, 224,
189, 39, 57, 24, 213, 252, 52, 76, 32, 27, 79, 155,
187, 214, 36, 191, 121, 78, 114, 48, 169, 247, 104, 152,
64, 54, 158, 53, 117, 171, 72, 125, 242, 156, 228, 96,
81, 237, 208, 47, 128, 108, 59, 106, 234, 85, 144, 250,
227, 55, 199, 192, 162, 217, 159, 94, 256, 216, 118, 212,
211, 170, 31, 243, 197, 110, 141, 127, 67, 177, 61, 188,
255, 175, 236, 167, 165, 83, 62, 229, 137, 220, 25, 254,
134, 97, 122, 119, 253, 93, 215, 77, 73, 166, 124, 201,
17, 183, 50, 251, 11, 194, 244, 238, 249, 186, 173, 154,
146, 75, 248, 145, 34, 109, 100, 245, 22, 131, 231, 219,
241, 115, 89, 51, 35, 150, 239, 33, 68, 218, 200, 233,
44, 5, 205, 181, 225, 230, 178, 102, 70, 43, 221, 66,
136, 179, 143, 209, 88, 10, 153, 105, 193, 203, 99, 204,
140, 86, 185, 132, 15, 101, 29, 161, 176, 20, 49, 210,
129, 149, 198, 151, 23, 172, 113, 7, 30, 202, 58, 65,
95, 40, 98, 163
}

Definition at line 63 of file simd.c.

◆ IV224

const u32 IV224[]
static
Initial value:
= {
C32(0x33586E9F), C32(0x12FFF033), C32(0xB2D9F64D), C32(0x6F8FEA53),
C32(0xDE943106), C32(0x2742E439), C32(0x4FBAB5AC), C32(0x62B9FF96),
C32(0x22E7B0AF), C32(0xC862B3A8), C32(0x33E00CDC), C32(0x236B86A6),
C32(0xF64AE77C), C32(0xFA373B76), C32(0x7DC1EE5B), C32(0x7FB29CE8)
}
#define C32
Definition: simd.c:53

Definition at line 1524 of file simd.c.

Referenced by sph_simd224_init().

◆ IV256

const u32 IV256[]
static
Initial value:
= {
C32(0x4D567983), C32(0x07190BA9), C32(0x8474577B), C32(0x39D726E9),
C32(0xAAF3D925), C32(0x3EE20B03), C32(0xAFD5E751), C32(0xC96006D3),
C32(0xC2C2BA14), C32(0x49B3BCB4), C32(0xF67CAF46), C32(0x668626C9),
C32(0xE2EAA8D2), C32(0x1FF47833), C32(0xD0C661A5), C32(0x55693DE1)
}
#define C32
Definition: simd.c:53

Definition at line 1531 of file simd.c.

Referenced by sph_simd256_init().

◆ IV384

const u32 IV384[]
static
Initial value:
= {
C32(0x8A36EEBC), C32(0x94A3BD90), C32(0xD1537B83), C32(0xB25B070B),
C32(0xF463F1B5), C32(0xB6F81E20), C32(0x0055C339), C32(0xB4D144D1),
C32(0x7360CA61), C32(0x18361A03), C32(0x17DCB4B9), C32(0x3414C45A),
C32(0xA699A9D2), C32(0xE39E9664), C32(0x468BFE77), C32(0x51D062F8),
C32(0xB9E3BFE8), C32(0x63BECE2A), C32(0x8FE506B9), C32(0xF8CC4AC2),
C32(0x7AE11542), C32(0xB1AADDA1), C32(0x64B06794), C32(0x28D2F462),
C32(0xE64071EC), C32(0x1DEB91A8), C32(0x8AC8DB23), C32(0x3F782AB5),
C32(0x039B5CB8), C32(0x71DDD962), C32(0xFADE2CEA), C32(0x1416DF71)
}
#define C32
Definition: simd.c:53

Definition at line 1538 of file simd.c.

Referenced by sph_simd384_init().

◆ IV512

const u32 IV512[]
static
Initial value:
= {
C32(0x0BA16B95), C32(0x72F999AD), C32(0x9FECC2AE), C32(0xBA3264FC),
C32(0x5E894929), C32(0x8E9F30E5), C32(0x2F1DAA37), C32(0xF0F2C558),
C32(0xAC506643), C32(0xA90635A5), C32(0xE25B878B), C32(0xAAB7878F),
C32(0x88817F7A), C32(0x0A02892B), C32(0x559A7550), C32(0x598F657E),
C32(0x7EEF60A1), C32(0x6B70E3E8), C32(0x9C1714D1), C32(0xB958E2A8),
C32(0xAB02675E), C32(0xED1C014F), C32(0xCD8D65BB), C32(0xFDB7A257),
C32(0x09254899), C32(0xD699C7BC), C32(0x9019B6DC), C32(0x2B9022E4),
C32(0x8FA14956), C32(0x21BF9BD3), C32(0xB94D0943), C32(0x6FFDDC22)
}
#define C32
Definition: simd.c:53

Definition at line 1549 of file simd.c.

Referenced by sph_simd512_init().

◆ yoff_b_f

const unsigned short yoff_b_f[]
static
Initial value:
= {
2, 203, 156, 47, 118, 214, 107, 106, 45, 93, 212, 20,
111, 73, 162, 251, 97, 215, 249, 53, 211, 19, 3, 89,
49, 207, 101, 67, 151, 130, 223, 23, 189, 202, 178, 239,
253, 127, 204, 49, 76, 236, 82, 137, 232, 157, 65, 79,
96, 161, 176, 130, 161, 30, 47, 9, 189, 247, 61, 226,
248, 90, 107, 64, 0, 88, 131, 243, 133, 59, 113, 115,
17, 236, 33, 213, 12, 191, 111, 19, 251, 61, 103, 208,
57, 35, 148, 248, 47, 116, 65, 119, 249, 178, 143, 40,
189, 129, 8, 163, 204, 227, 230, 196, 205, 122, 151, 45,
187, 19, 227, 72, 247, 125, 111, 121, 140, 220, 6, 107,
77, 69, 10, 101, 21, 65, 149, 171, 255, 54, 101, 210,
139, 43, 150, 151, 212, 164, 45, 237, 146, 184, 95, 6,
160, 42, 8, 204, 46, 238, 254, 168, 208, 50, 156, 190,
106, 127, 34, 234, 68, 55, 79, 18, 4, 130, 53, 208,
181, 21, 175, 120, 25, 100, 192, 178, 161, 96, 81, 127,
96, 227, 210, 248, 68, 10, 196, 31, 9, 167, 150, 193,
0, 169, 126, 14, 124, 198, 144, 142, 240, 21, 224, 44,
245, 66, 146, 238, 6, 196, 154, 49, 200, 222, 109, 9,
210, 141, 192, 138, 8, 79, 114, 217, 68, 128, 249, 94,
53, 30, 27, 61, 52, 135, 106, 212, 70, 238, 30, 185,
10, 132, 146, 136, 117, 37, 251, 150, 180, 188, 247, 156,
236, 192, 108, 86
}

Definition at line 348 of file simd.c.

Referenced by compress_big().

◆ yoff_b_n

const unsigned short yoff_b_n[]
static
Initial value:
= {
1, 163, 98, 40, 95, 65, 58, 202, 30, 7, 113, 172,
23, 151, 198, 149, 129, 210, 49, 20, 176, 161, 29, 101,
15, 132, 185, 86, 140, 204, 99, 203, 193, 105, 153, 10,
88, 209, 143, 179, 136, 66, 221, 43, 70, 102, 178, 230,
225, 181, 205, 5, 44, 233, 200, 218, 68, 33, 239, 150,
35, 51, 89, 115, 241, 219, 231, 131, 22, 245, 100, 109,
34, 145, 248, 75, 146, 154, 173, 186, 249, 238, 244, 194,
11, 251, 50, 183, 17, 201, 124, 166, 73, 77, 215, 93,
253, 119, 122, 97, 134, 254, 25, 220, 137, 229, 62, 83,
165, 167, 236, 175, 255, 188, 61, 177, 67, 127, 141, 110,
197, 243, 31, 170, 211, 212, 118, 216, 256, 94, 159, 217,
162, 192, 199, 55, 227, 250, 144, 85, 234, 106, 59, 108,
128, 47, 208, 237, 81, 96, 228, 156, 242, 125, 72, 171,
117, 53, 158, 54, 64, 152, 104, 247, 169, 48, 114, 78,
121, 191, 36, 214, 187, 155, 79, 27, 32, 76, 52, 252,
213, 24, 57, 39, 189, 224, 18, 107, 222, 206, 168, 142,
16, 38, 26, 126, 235, 12, 157, 148, 223, 112, 9, 182,
111, 103, 84, 71, 8, 19, 13, 63, 246, 6, 207, 74,
240, 56, 133, 91, 184, 180, 42, 164, 4, 138, 135, 160,
123, 3, 232, 37, 120, 28, 195, 174, 92, 90, 21, 82,
2, 69, 196, 80, 190, 130, 116, 147, 60, 14, 226, 87,
46, 45, 139, 41
}

Definition at line 320 of file simd.c.

Referenced by compress_big().

◆ yoff_s_f

const unsigned short yoff_s_f[]
static
Initial value:
= {
2, 156, 118, 107, 45, 212, 111, 162, 97, 249, 211, 3,
49, 101, 151, 223, 189, 178, 253, 204, 76, 82, 232, 65,
96, 176, 161, 47, 189, 61, 248, 107, 0, 131, 133, 113,
17, 33, 12, 111, 251, 103, 57, 148, 47, 65, 249, 143,
189, 8, 204, 230, 205, 151, 187, 227, 247, 111, 140, 6,
77, 10, 21, 149, 255, 101, 139, 150, 212, 45, 146, 95,
160, 8, 46, 254, 208, 156, 106, 34, 68, 79, 4, 53,
181, 175, 25, 192, 161, 81, 96, 210, 68, 196, 9, 150,
0, 126, 124, 144, 240, 224, 245, 146, 6, 154, 200, 109,
210, 192, 8, 114, 68, 249, 53, 27, 52, 106, 70, 30,
10, 146, 117, 251, 180, 247, 236, 108
}

Definition at line 303 of file simd.c.

Referenced by compress_small().

◆ yoff_s_n

const unsigned short yoff_s_n[]
static
Initial value:
= {
1, 98, 95, 58, 30, 113, 23, 198, 129, 49, 176, 29,
15, 185, 140, 99, 193, 153, 88, 143, 136, 221, 70, 178,
225, 205, 44, 200, 68, 239, 35, 89, 241, 231, 22, 100,
34, 248, 146, 173, 249, 244, 11, 50, 17, 124, 73, 215,
253, 122, 134, 25, 137, 62, 165, 236, 255, 61, 67, 141,
197, 31, 211, 118, 256, 159, 162, 199, 227, 144, 234, 59,
128, 208, 81, 228, 242, 72, 117, 158, 64, 104, 169, 114,
121, 36, 187, 79, 32, 52, 213, 57, 189, 18, 222, 168,
16, 26, 235, 157, 223, 9, 111, 84, 8, 13, 246, 207,
240, 133, 184, 42, 4, 135, 123, 232, 120, 195, 92, 21,
2, 196, 190, 116, 60, 226, 46, 139
}

Definition at line 286 of file simd.c.

Referenced by compress_small().

Released under the MIT license