The following assembly works (in -O2
) if all of my outputs are "output-only" (=&
), but not if they are "output" (=
). What is the difference between these two modes, and how can the behavior of the program change when the assembly is not reading the register?
__asm (
"ldrb %[H], %[P0] \n" // P[0]
"ldrb %[L], %[P4] \n" // P[4]
"add %[H], %[Htbl], %[H], lsl #4 \n" // H = Htbl + P[0]
"add %[L], %[Htbl], %[L], lsl #4 \n" // L = Htbl + P[4]
"mov %[S], %[Z0], LSL #24 \n" // S = Z0 << 24
:
[H] "=&r" (H),
[L] "=&r" (L),
[S] "=&r" (S),
[tmp] "=&r" (tmp)
:
[Z0] "r" (Z0),
[Htbl] "r" (Htbl),
[P0] "m" (P[0]),
[P4] "m" (P[4])
);