Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Aarch64 llvm unrecognized instruction mnemonic

I am trying to use ARM inline assembly in a C code. I am compiling using aarch64-linux-android-clang version 3.8.243773, the 64 bit llvm toolchain from Android NDK R11.

The inline assembly code is as follows:

__asm__("ssat %w0, #24, %w1\n\t" : "=r" (val) : "r" (val) : );

The syntax of inline assembly code is correct and it compiles the syntax code as such but the assembler spits out a error saying

error: unrecognized instruction mnemonic ssat

What is the problem here? Doesn't llvm from the ndk toolchain support this assembly instruction?

How can I fix or workaround this issue?

thanks.

Parents
  • NEON is not like AVX or MMX, you do not need to "move" to NEON. Just use NEON instructions.
    Anyway AFAICS NEON does not provide saturation either.
    I think the ASM code does not look to bad:
    mov w1, 8388607
    mov w2, -8388608
    cmp w0, w1
    csel w0, w0, w1, le
    cmp w0, w2
    csel w0, w0, w2, ge

    Of course, nothing compared to a single instruction. :-)
Reply
  • NEON is not like AVX or MMX, you do not need to "move" to NEON. Just use NEON instructions.
    Anyway AFAICS NEON does not provide saturation either.
    I think the ASM code does not look to bad:
    mov w1, 8388607
    mov w2, -8388608
    cmp w0, w1
    csel w0, w0, w1, le
    cmp w0, w2
    csel w0, w0, w2, ge

    Of course, nothing compared to a single instruction. :-)
Children
No data