Need help with DImode hard regs in MD file

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Thu Sep 30 23:58:00 GMT 1999


    >   emit_move_insn (operands[0], gen_lowpart (SImode, r));

    Several times you've written email with things like this, 
    whereas the i370 code uses what I beleive to be the equivalent:

    emit_insn (gen_rtx_SET (VOIDmode, operands[0],
                           gen_rtx_SUBREG (SImode, r, 1))); 

    Are these in fact equivalent? Is one somehow better than the other?

They generate the same RTL if and only if R is a REG, and there's no
define_expand in the MD file, but the former is always better than the
latter since it is clearer what is going on and it's also
machine-independent.

I understand that this is in a machine-dependent file, but it's still best
to write things in as machine-independent a way as possible since that will
make it less dependent on other config file changes and also allow easier
reuse of the code for another port.



More information about the Gcc-patches mailing list