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

Add support for non aligned SIMD for vec4 #1162

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

laurentcau
Copy link

It is used as default configuration for Visual Studio 64 bits compilation (needs Language Extension).
code changes:

  • add new qualifiers: unaligned_simd_highp unaligned_simd_mediump unaligned_simd_lowp
  • add use_simd and replace is_aligned
    (code for ARM NEON is added but not tested)

It is used as default configuration for Visual Studio 64 bits compilation (needs Language Extension).
code changes:
- add new qualifiers:
  unaligned_simd_highp
  unaligned_simd_mediump
  unaligned_simd_lowp
- add use_simd and replace is_aligned
(code for ARM NEON is added but not tested)
Copy link

@christophe-lunarg christophe-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing

@christophe-lunarg christophe-lunarg merged commit b85861a into g-truc:master Nov 9, 2023
1 check passed
Copy link

@tycho tycho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some bugs in this contribution that I just ran into when trying to build targeting NEON.

};


return ;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line shouldn't be here.

Comment on lines +313 to +314
type(glm_i32vec4 v) { vst1q_u32(data, v); }
operator glm_i32vec4() const { return vld1q_u32(data); }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be vst1q_s32 and vld1q_s32, since the vector is signed.

Comment on lines +331 to +332
type(glm_i32vec4 v) { vst1q_u32(data, v); }
operator glm_i32vec4() const { return vld1q_u32(data); }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glm_i32vec4 should be replaced with glm_u32vec4 here.

@laurentcau
Copy link
Author

laurentcau commented Nov 22, 2023 via email

@tycho
Copy link

tycho commented Nov 22, 2023

Hi, Feal free to fix the mistake. I have no way to test ARM version and glm validation process only support Windows Visual Studio build. If you know an easy way to test this on PC, share it, please.

Well, I built with clang-cl targeting ARM64 on Visual Studio to find these issues. If you install clang-cl and the other ARM64 bits via the Visual Studio Installer, you should be able to test that. You can configure with CMake using either -G "Visual Studio 16 2019" -A ARM64 -T ClangCL or -G "Visual Studio 16 2019" -A ARM64 -T LLVM_v142, depending on which toolset is installed.

@laurentcau
Copy link
Author

laurentcau commented Nov 22, 2023 via email

@tycho
Copy link

tycho commented Nov 22, 2023

Oh yeah, my branch has patches to make it detect ARM Windows (_M_ARM and _M_ARM64). You can add -DGLM_FORCE_NEON=1 and it should configure properly.

@christophe-lunarg
Copy link

Hi Laurent,

I revert the commit because it cause too much issues. I am working on fixing the repository C.I. with #1167 which I hope will help avoiding such problem in the future...

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants