This is the mail archive of the
mailing list for the GCC project.
Re: RTL AND Instruction
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Matt Davis <mattdavis9 at gmail dot com>
- Cc: gcc at gnu dot org
- Date: Sun, 22 Jan 2012 01:12:25 -0500 (EST)
- Subject: Re: RTL AND Instruction
- References: <20120122052112.GA8463@excelsa.wimax>
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.