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

'__asm__': undeclared identifier with VS 2022 / ARM64 #798

Closed
abria opened this issue Sep 17, 2024 · 2 comments
Closed

'__asm__': undeclared identifier with VS 2022 / ARM64 #798

abria opened this issue Sep 17, 2024 · 2 comments

Comments

@abria
Copy link

abria commented Sep 17, 2024

In solver.c, the following code

#if defined( B2_CPU_ARM )
static inline void b2Pause( void )
{
	__asm__ __volatile__( "isb\n" );
}
#elif defined( B2_CPU_X86_X64 )
#include <immintrin.h>
static inline void b2Pause( void )
{
	_mm_pause();
}
#else
static inline void b2Pause( void )
{
	// no threading will likely be used in web assembly
}
#endif

yields error C2065: '__asm__': undeclared identifier when compiling on Visual Studio 2022 targeting ARM64 platform.

I tried to solve replacing the __asm__ __volatile__( "isb\n" ); call with __dmb(_ARM64_BARRIER_SY); and it compiled, however the CrossPlatformTest failed, which might be due to my change:

Starting Box2D unit tests
======================================
test passed: MathTest
  subtest passed: AABBTest
test passed: CollisionTest
  subtest passed: MultithreadingTest
step = 300, hash = 0x769fe476
condition false: sleepStep == 310
  subtest failed: CrossPlatformTest
test failed: DeterminismTest
@erincatto
Copy link
Owner

erincatto commented Sep 17, 2024

I don't have a Windows ARM computer. I could try adding a github action. It is hard to support a platform without this.

erincatto added a commit that referenced this issue Sep 26, 2024
@erincatto
Copy link
Owner

Should be fixed in #804

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