ARM Cortex-R: ldrbne and ldrbeq give "Error: bad instruction" despite being valid
When I attempt to use gcc to compile a *.S file containing the instructions ldrbne or ldrbeq it will not compile.
As an example:
tst.S:
-------
.text
.arm
.global _start
_start:
ldrbne r12, [lr, #-4]
ldrbeq r12, [lr, #-8]
-------
$ arm-none-eabi-gcc -march=armv7-r -mfpu=vfpv3-d16 -mfloat-abi=hard -Wall -Werror -Wextra -g -c -o tst.o tst.S
tst.S: Assembler messages:
tst.S:6: Error: bad instruction `ldrbne r12,[lr,#-4]'
tst.S:7: Error: bad instruction `ldrbeq r12,[lr,#-8]'
-------
$ arm-none-eabi-gcc -mcpu=cortex-r5 -Wall -Werror -Wextra -g -o tst.o -c tst.S
tst.S: Assembler messages:
tst.S:6: Error: bad instruction `ldrbne r12,[lr,#-4]'
tst.S:7: Error: bad instruction `ldrbeq r12,[lr,#-8]'
-------
The unconditional version: ldrb r12,[lr,#-4] compiles as expected.
As far as I can tell (looking at the arm documentation) this appears to be a valid use of the instruction. Is there some reason this shouldn't work?
Thank you in advanced!
--Kit
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Tejas Belagod
- Solved:
- Last query:
- Last reply: