[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Another minor arm assembler bug
From: |
Frank Yellin |
Subject: |
Another minor arm assembler bug |
Date: |
Tue, 26 Jun 2001 10:10:32 -0700 (PDT) |
[I apologize if this is a duplicate. I'm not sure if my original message
went out or not.]
The c-arm.texi file claims:
@cindex @code{LDR reg,=<label>} pseudo op, ARM
....
If expression evaluates to a numeric constant then a MOV or MVN
instruction will be used in place of the LDR instruction, if the
constant can be generated by either of these instructions.
...
However, assembly language code such as
ldr r0, =-12
generates
ldr r0, [literal-pool entry]
rather than
mvn r0, #11
as documented.
In the function do_ldst(), you check:
if (inst.reloc.exp.X_op == O_constant
&& (value = validate_immediate(inst.reloc.exp.X_add_number)) != FAIL)
You should probably also include an additional case:
else if (........ &&
(value = validate_immediate(~inst.reloc.exp.X_add_number)) != FAIL){
<almost identical code using using mvn instead of mov>
}
There may be someway of doing this instead using negate_data_op, instead, but I
didn't investigate that too thoroughly.
Thanks.
== Frank Yellin