public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem when defining new mips insns
@ 2004-10-21 13:06 Pontus Lidman
  2004-10-22 15:43 ` Roger Sayle
  0 siblings, 1 reply; 5+ messages in thread
From: Pontus Lidman @ 2004-10-21 13:06 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-24 10:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-21 13:06 Problem when defining new mips insns Pontus Lidman
2004-10-22 15:43 ` Roger Sayle
2004-10-24 10:32   ` Pontus Lidman
2004-10-24 18:57     ` Roger Sayle
2004-10-24 19:33       ` Pontus Lidman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).