Skip to content

Commit

Permalink
Armory format: Switch from scatter to gather on MIC
Browse files Browse the repository at this point in the history
  • Loading branch information
solardiz committed Jan 13, 2024
1 parent c460f82 commit e0b1de3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/armory_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,13 @@ static int derive_keys(region_t *memory, int index, derived_key *dk)
do {
#if (__AVX512F__ || __MIC__) && SIMD_PARA_SHA512 == 1
vtype idxs = vset_epi64(7<<3, 6<<3, 5<<3, 4<<3, 3<<3, 2<<3, 1<<3, 0<<3);
#if __AVX512F__
#define DO(k) \
vscatter_epi64(&(*p)[0].u64[k], idxs, *(vtype *)&x[k], 8);
#else /* Sequential writes and smaller code size, but slower on Tiger Lake */
#define DO(k) \
*(vtype *)(*p)[k].u64 = vgather_epi64((vtype *)&x[0][k], idxs, 8);
#endif
DO8
#undef DO
#else
Expand Down

0 comments on commit e0b1de3

Please sign in to comment.