This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RTL AND Instruction


On Sun, 22 Jan 2012, Matt Davis wrote:
> Once I emit my rtx into the list of insns, GCC gives me an "unrecognized insn"
> error.  I can trace the code through the first part of the condition, specified
> in i386.md, "ix86_binary_operator_ok," and that passes fine from the
> "anddi_1" define_insn.  What I have in my source is the following:
>
>     rtx eax = gen_rtx_REG(DImode, 0);
>     rtx and = gen_rtx_AND(DImode, eax, gen_rtx_CONST_INT(VOIDmode, 7));
>     and = gen_rtx_SET(DImode, eax, and);
>     emit_insn_before(and, insn);

Looking at the i386 port (when the 64-bit part of it is active)
it looks like you need to emit a parallel with a clobber of the
flags register for this to be recognized.

It seems an odd way to do anything (emitting raw rtl in the
middle of anything, unless it's in the prologue or epilogue),
which makes me think there's a better alternative for whatever
you're trying to accomplish.

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]