This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Problem when defining new mips insns
- From: Pontus Lidman <pontus at lysator dot liu dot se>
- To: gcc at gcc dot gnu dot org
- Date: 21 Oct 2004 10:48:57 +0200
- Subject: Problem when defining new mips insns
Hello,
I'm trying to define some new instructions for handling TImode scalars
on a mips r5900 cpu, and I encountered a problem I can't seem to
understand properly or solve.
The following program:
long fun (double a) { return -a; }
produces this result:
../../test/fix2.c: In function 'fun':
../../test/fix2.c:4: error: unrecognizable insn:
(insn 14 13 15 0 ../../test/fix2.c:2 (set (reg:TI 186)
(ashift:TI (reg:TI 187)
(const_int 63 [0x3f]))) -1 (insn_list:REG_DEP_TRUE 13
(nil))
(expr_list:REG_DEAD (reg:TI 187)
(expr_list:REG_EQUAL (const_int -9223372036854775808
[0x8000000000000000])
(nil))))
../../test/fix2.c:4: internal compiler error: in extract_insn, at
recog.c:2034
The cpu doesn't have shift instructions for TImode scalars, so I have
defined library functions __ashrti3, __ashlti3. I have verified that
these can be generated by the compiler in other test cases.
What I'm wondering is, why and where is the above unrecognizable insn
generated? I had expected a call to one of my library functions to be
generated.
I have been trying some approaches without success: I have been able
to create a define_insn which matches the above insn, and I guess I
could make it output a library call, but I haven't found out how yet,
and it doesn't seem to be the 'correct' solution. I also tried
defining a define_expand with similiar match parameters, but the
expansion doesn't seem to be used in the above case. Most of all I'd
like to have a library call generated immediately, rather than the
insn above.
Thanks in advance,
Pontus
--
Pontus Lidman, pontus@lysator.liu.se, Software Engineer
No matter how cynical you get, it's impossible to keep up.
Scene: www.dc-s.com | MUD: tyme.envy.com 6969 | irc: irc.quakenet.eu.org