Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hint] sse2neon #57

Open
ReneKeilwerth opened this issue Dec 14, 2021 · 1 comment
Open

[hint] sse2neon #57

ReneKeilwerth opened this issue Dec 14, 2021 · 1 comment

Comments

@ReneKeilwerth
Copy link

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>

@vectorclass vectorclass deleted a comment from konglhui Dec 14, 2021
@AgnerF
Copy link
Collaborator

AgnerF commented Dec 14, 2021

Thank you for your suggestion.
I don't want to include any support for ARM in the vector class library because I have no access to test it. All functions have to be tested thoroughly in all possible configurations. I have automated test scripts that make thousands of tests for all possible configurations and compilers on x86. Making similar tests for ARM would be a lot of work and would undoubtedly reveal a lot of problems. I think it would be better to make a separate version of VCL for ARM, but somebody else will have to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants