0

I am trying to understand below code:

ldrvsb  r3, [r1], #1    // V set

ldrcsh  r4, [r1], #2    // C set

ldreq   r5, [r1], #4    // Z set


strvsb  r3, [r0], #1
strcsh  r4, [r0], #2
streq   r5, [r0], #4

ldmmiia r1!, {r3-r4} // N set
stmmiia r0!, {r3-r4}

While compiling using GCC toolchain above code works fine.

But when compiling using clang I see invalid instruction for ldrvsb, ldrcsh, strcsh, strvcb, ldmmiia, stmmiia.

Refer below link: https://github.com/littlekernel/lk/blob/33b94d9b97ef835d68aca2e5edb54f7267c70625/lib/libc/string/arch/arm/arm/memcpy.S

As clang don't support it, I need to replace above instructions with equivalent one. Need to understand which are they respectively.

Thanks in advance.

Sandeep Kumar
  • 336
  • 1
  • 3
  • 9
  • Can't you fix it by just moving the condition last? I.e. `ldrvsb` -> `ldrbvs`, `ldmmiia` -> `ldmiami`, etc. – Michael Dec 12 '20 at 19:19
  • Unfortunately https://stackoverflow.com/questions/65182875/can-someone-explain-the-following-ldrvsb-ldrcsh-strvsb-strcsh-stmmiia-and-st was deleted- it had an answer that explained that these are just predicated `ldrb` and so on, with the predicate in the middle of the mnemonic. And a comment that mentioned unified vs. split ARM syntax. – Peter Cordes Dec 12 '20 at 21:13

0 Answers0