Constraints and reload

Richard Henderson rth@redhat.com
Wed Sep 16 20:26:00 GMT 2009


On 09/16/2009 03:00 PM, Jean Christophe Beyler wrote:
> Sorry to bring this back to the conversation. Is there any reason why
> this would not work with floating-point constraints ?

Not that I can think of.  Did you provide all of the secondary reload
stuff that you need?  Probably not.

> (define_memory_constraint "R"
>    "R is for memory references which take 1 word for the instruction"
>    (and (match_code "mem")
>         (match_test "simple_memory_operand (op)")))
>
> I have :
> (define_insn "movdf_internal"
>    [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,r,R")
>          (match_operand:DF 1 "general_operand"      " r,F,R,r"))]
>    "check_move (operands[0], operands[1])"
>     "@
>      mov\\t%0,%1
>      lid\\t%0,%1
>      ldd\\t%0,%1
>      std\\t%1,%0"
>    [(set_attr "type"     "move,arith,load,store")
>     (set_attr "mode"     "DF,DF,DF,DF")
>     (set_attr "length"   "1,1,1,1")])
>
> However, on a relatively complex bit of code, I get :
> error: unrecognizable insn:
> (set (mem/s:DF (const:DI (plus:DI (symbol_ref:DI ("st")<var_decl
> 0x2a957d7aa0 st>)
>                      (const_int 48 [0x30]))) [14 st+48 S8 A64])
>          (reg:DF 10 r10)) -1 (nil))
>
> (My architecture cannot allow const as addresses to the store, it must
> go through a register).

You'll do much better by rejecting these addresses earlier.
Probably by some combination of custom predicates that allow
only simple_memory_operand + registers + constants, or by
simply defining this kind of memory address illegal for DFmode.



r~



More information about the Gcc mailing list