Skip to content

Degraded performance on Zen 4 CPUs #45

Description

@MattCatz

The handwritten kernel for the __AVX512F__ path uses the intrinsic _mm512_mask_compressstoreu_pd which maps to the instruction VPCOMPRESSPD. For Zen 4, that instruction is microcode and slower than the scaler path.

ALP/include/alp/encoder.hpp

Lines 351 to 361 in 31ca0ed

#ifdef __AVX512F__
if constexpr (std::is_same_v<PT, double>) {
for (size_t i {0}; i < config::VECTOR_SIZE; i = i + 8) {
__m512d l = _mm512_loadu_pd(ENCODED_VALUE_ARR + i);
__m512d r = _mm512_loadu_pd(VALUE_ARR_WITHOUT_SPECIALS + i);
__m512i index = _mm512_loadu_pd(DOUBLE_INDEX_ARR + i);
auto is_exception = _mm512_cmpneq_pd_mask(l, r);
_mm512_mask_compressstoreu_pd(TMP_INDEX_ARR + exceptions_idx, is_exception, index);
exceptions_idx += LOOKUP_TABLE[is_exception];
}
} else {

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions