Skip to content

Right shift operation not working #62

@NK-Nikunj

Description

@NK-Nikunj

Issue type: Error

While utilizing the Right shift and Left shift bitwise operators, I'm getting an error:

/home/nk/opt/nsimd/include/nsimd/cxx_adv_api_functions.hpp:998:16: error: no matching function for call to ‘shr(const simd_vector&, int&, float, nsimd::cpu)’
  998 |   ret.car = shr(a0.car, a1, T(), SimdExt());

Reproducing the error

Here is the minimal program to reproduce the issue:

#include <iostream>
#include <nsimd/nsimd-all.hpp>

int main()
{
    nsimd::pack<float> f(42.0f);
    nsimd::pack<float> f2 = nsimd::shr(f2, 1);

    std::cout << f2 << std::endl;

    return 0;
}

Is there something I'm doing wrong?

Expected behavior

Essentially I wish to change a simd vector, say [1, 2, 3, 4] to look like [0,1,2,3] using the right shift operation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions