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

Unable to compile NEON support for libjpeg-turbo with latest Clang in Xcode 5 #26

Open
swisspol opened this issue Jan 21, 2014 · 2 comments

Comments

@swisspol
Copy link

Self-contained build script to reproduce:
https://gist.github.com/swisspol/8498104

Build script output:
https://gist.github.com/swisspol/8498120

And where it fails:

jsimd_arm_neon.S:270:16: error: invalid operand for instruction
      ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 1 * 8))]
               ^
jsimd_arm_neon.S:276:16: error: invalid operand for instruction
      ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 2 * 8))]
               ^
jsimd_arm_neon.S:283:16: error: invalid operand for instruction
      ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 3 * 8))]
               ^
jsimd_arm_neon.S:291:16: error: invalid operand for instruction
      ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 4 * 8))]
               ^
jsimd_arm_neon.S:299:16: error: invalid operand for instruction
      ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 5 * 8))]
               ^
jsimd_arm_neon.S:306:16: error: invalid operand for instruction
      ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 6 * 8))]
               ^
jsimd_arm_neon.S:313:16: error: invalid operand for instruction
      ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 7 * 8))]
               ^
jsimd_arm_neon.S:321:16: error: invalid operand for instruction
      ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 0 * 8))]

I asked about the issue on the libjpeg-turbo mailing list and someone suggested to ask here:
http://sourceforge.net/p/libjpeg-turbo/mailman/message/31870599/

@swisspol
Copy link
Author

Some feedback from DRC on the libjpeg-turbo mailing list:

I would like to support Xcode 5.0. In order to make that happen, then
gas-preprocessor.pl needs to be modified to work around a couple of
issues with LLVM/clang. The "invalid operand" issue is one of them.
The other is that, when you pass "-x assembler" to clang, which is
necessary when feeding it an assembly file via stdin like
gas-preprocessor does, it seems to ignore some of the other arguments.
The latter can be worked around in gas-preprocessor pretty easily, but
the former seems to be a basic incompatibility between the assembly file
and the new assembler. The lines of code in question are unmodified
relative to the original assembly file, so the presence of
gas-preprocessor doesn't seem to be what's causing the failure. The
assembly code just won't assemble in clang. That is not something I am
capable of resolving, and note that I did spend about 4 hours trying
various things in gas-preprocessor.

@dcommander
Copy link

I ended up fixing this issue locally in the libjpeg-turbo repository:

https://sourceforge.net/p/libjpeg-turbo/code/HEAD/tree/gas-preprocessor/

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