Browse Source

internal VECTOR_ALIGNED instead of __attribute((aligned(32))), thanks Olivier

master
Michael Hamburg 7 years ago
parent
commit
6e2ce5201f
4 changed files with 5 additions and 8 deletions
  1. +1
    -2
      src/GENERATED/c/curve25519/decaf.c
  2. +1
    -2
      src/GENERATED/c/ed448goldilocks/decaf.c
  3. +2
    -2
      src/p448/arch_x86_64/f_impl.c
  4. +1
    -2
      src/per_curve/decaf.tmpl.c

+ 1
- 2
src/GENERATED/c/curve25519/decaf.c View File

@@ -80,8 +80,7 @@ extern const point_t API_NS(point_base);

/* Projective Niels coordinates */
typedef struct { gf a, b, c; } niels_s, niels_t[1];
typedef struct { niels_t n; gf z; } __attribute__((aligned(sizeof(big_register_t))))
pniels_s, pniels_t[1];
typedef struct { niels_t n; gf z; } VECTOR_ALIGNED pniels_s, pniels_t[1];

/* Precomputed base */
struct precomputed_s { niels_t table [COMBS_N<<(COMBS_T-1)]; };


+ 1
- 2
src/GENERATED/c/ed448goldilocks/decaf.c View File

@@ -80,8 +80,7 @@ extern const point_t API_NS(point_base);

/* Projective Niels coordinates */
typedef struct { gf a, b, c; } niels_s, niels_t[1];
typedef struct { niels_t n; gf z; } __attribute__((aligned(sizeof(big_register_t))))
pniels_s, pniels_t[1];
typedef struct { niels_t n; gf z; } VECTOR_ALIGNED pniels_s, pniels_t[1];

/* Precomputed base */
struct precomputed_s { niels_t table [COMBS_N<<(COMBS_T-1)]; };


+ 2
- 2
src/p448/arch_x86_64/f_impl.c View File

@@ -11,7 +11,7 @@ void gf_mul (gf_s *__restrict__ cs, const gf as, const gf bs) {
__uint128_t accum0 = 0, accum1 = 0, accum2;
uint64_t mask = (1ull<<56) - 1;

uint64_t aa[4] __attribute__((aligned(32))), bb[4] __attribute__((aligned(32))), bbb[4] __attribute__((aligned(32)));
uint64_t aa[4] VECTOR_ALIGNED, bb[4] VECTOR_ALIGNED, bbb[4] VECTOR_ALIGNED;

/* For some reason clang doesn't vectorize this without prompting? */
unsigned int i;
@@ -186,7 +186,7 @@ void gf_sqr (gf_s *__restrict__ cs, const gf as) {
__uint128_t accum0 = 0, accum1 = 0, accum2;
uint64_t mask = (1ull<<56) - 1;

uint64_t aa[4] __attribute__((aligned(32)));
uint64_t aa[4] VECTOR_ALIGNED;

/* For some reason clang doesn't vectorize this without prompting? */
unsigned int i;


+ 1
- 2
src/per_curve/decaf.tmpl.c View File

@@ -69,8 +69,7 @@ extern const point_t API_NS(point_base);

/* Projective Niels coordinates */
typedef struct { gf a, b, c; } niels_s, niels_t[1];
typedef struct { niels_t n; gf z; } __attribute__((aligned(sizeof(big_register_t))))
pniels_s, pniels_t[1];
typedef struct { niels_t n; gf z; } VECTOR_ALIGNED pniels_s, pniels_t[1];

/* Precomputed base */
struct precomputed_s { niels_t table [COMBS_N<<(COMBS_T-1)]; };


Loading…
Cancel
Save