Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARM Clang: couldn't allocate output register for constraint 'w'

uint8_t* dataPtr;
uint8x8x4_t dataVec;
__asm__ __volatile__( "vldmia %1, %h0" : "=w"( dataVec ) : "r"( dataPtr ) );

Above ARM inline assembly code works fine when compiled with Android NDK using GCC toolchain for armeabi-v7a ABI. However, I get following compiler error when I switch to Clang

error: couldn't allocate output register for constraint 'w'

According to LLVM docs, constraint 'w' can be used for SIMD register on ARM target.

Am I missing something? Has anyone encountered this issue? Is it a bug in LLVM?

Thanks

like image 747
VP. Avatar asked Nov 23 '25 15:11

VP.


1 Answers

As mentioned in the LLVM Docs:

The constraint codes are, in general, expected to behave the same way they do in GCC. LLVM’s support is often implemented on an ‘as-needed’ basis, to support C inline asm code which was supported by GCC. A mismatch in behavior between LLVM and GCC likely indicates a bug in LLVM.

Maybe it's a good idea for you to report this on https://bugs.llvm.org/

like image 140
Bruno Alexandre Rosa Avatar answered Nov 25 '25 09:11

Bruno Alexandre Rosa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!