Skip to content

[hint] sse2neon #57

@ReneKeilwerth

Description

@ReneKeilwerth

even if there is no plan to implement arm-instructions, it is moslty possible to use the sse2neon lib to emulate sse instructions on ARM.
So you can use vectorclass on ARM

i found some things to be defined before including the vectroclass.h
and a small change that has to be made to the instrset.h file.

it is working as far as i could test on apple M1 chips

maybe those changes can be directly applied to vectorclass due to a preprocesse like "VCL_USE_SSE2NEON"

cheers


/*
ARM compatible include of the vectorclass

on ARM/MAC the sse2neon lib will be imported
and some parameters for the vectorclass are prepared.

#IMPORTANT in vectorclass.h->instrset.h the cpuid function must be
hidden, since it is not compatible with ARM-compilers.

if missing, add the header-include check #if !defined(SSE2NEON_H)
to the function to hide it when compiling on ARM

remember that a dispatcher is not possible in this case.

*/

#if __arm64
#include <sse2neon.h>

// limit to 128byte, since we want to use ARM-neon
#define MAX_VECTOR_SIZE 128

//limit to sse4.2, sse2neon does not have any AVX instructions ( so far )
#define INSTRSET 6

//define unknown function
#define _mm_getcsr() 1

//simulate header included
#define __X86INTRIN_H
#endif
// finally include vectorclass
#include <vectorclass.h>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions