ldmia.w sp!,{r3,lr}
In the case of using Branch instructions in assembly programming, if the branch target is in a different object file (i.e. extern), then you might need to specify 32-bit version of branch instructions as the branch offset might be larger than the range of a 16-bit branch instruction. If you do not add the .W suffix, the assembler might use a 16-bit branch instruction and then at linking stage the linker flag up an error saying that the branch operation cannot be handled by that 16-bit instruction.
If the branch is forward and the branch target is marginally near the limit of a 16-bit branch instruction, you might need to specify a 32-bit branch instruction as well, as the first pass of the assembling process might not have accurate address offset (some instructions between the branch and the branch target might changed from 16-bit to 32-bit in the second pass).
regards,
Joseph