This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: writing casesi (was: Re: arm/thumb bugs)
On Nov 15, 2001, Adrian von Bidder <avbidder@acter.ch> wrote:
> (set (match_dup 7)
> (label_ref (match_operand 3 "" "")))
As far as I can tell, this is not a valid instruction, at least not in
PIC mode. You should probably built it as the PIC register plus the
GOTOFF of the label. I don't know details about the implementation of
PIC in the ARM back-end, but it appears to me that pic_load_addr_thumb
may be the insn you're looking for.
> (define_insn "*thumbpic_movaddr"
> [(set (match_operand:SI 0 "s_register_operand" "=l")
> (match_operand:DI 1 "address_operand" "p"))]
At the very least, both operands should have the same mode. I don't
see why you're using DImode, though. Also, address_operand and the
"p" constraint are not what you're looking for. "immediate_operand"
and "s" would be closer, but a label_ref is not a legitimate constant,
so it wouldn't match.
> The other possibility would be not to define casesi, but to have the
> addr_diff_vec generate not the series of branch instructions that is
> generated now, but the series of offsets as Philip Blundell suggested.
> Only I couldn't find out where I would specify this (defining
> CASE_VECTOR_PC_RELATIVE in arm.h did not change anything.)
You may have to define ASM_OUTPUT_ADDR_{DIFF,VEC}_ELT for it to make a
difference. I don't see these macros defined in arm.h.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me