public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* unrecognizable insn for byte compare in private backend
@ 2023-12-27 12:50 Mark Burkley
  0 siblings, 0 replies; only message in thread
From: Mark Burkley @ 2023-12-27 12:50 UTC (permalink / raw)
  To: gcc-help

Hi all,

I am having with some issues in my private backend for the TMS9900 CPU 
that I hope somebody can give me some pointers to debug.

The original backend was developed for gcc-4.4.0.  I have managed to get 
this into reasonable shape now and it does create functional, though 
slightly suboptimal, machine code.  So I have recently migrated to 
gcc-13.2.0 to make sure I'm not chasing issues that have been solved by 
more recent versions of gcc.

One of the main changes was the cc0 migration.  The TMS9900 clobbers CC 
on almost every instruction so I've defined splits with condition of 
reload_completed to emit a compare before emitting jumps.  This is 
working up to a point but I'm struggling to find why I'm getting this error:

     zap.c: In function ‘test’:
     zap.c:18:1: error: unrecognizable insn:
        18 | }
           | ^
     (insn 31 30 32 (set (reg:CC 16 st)
             (compare:CC (reg:QI 1 r1 [orig:25 b.0_1 ] [25])
                 (const_int -1 [0xffffffffffffffff]))) "zap.c":7:8 -1
          (nil))
     during RTL pass: split5

given that I have a byte compare insn that does exactly that:

     (define_insn "cmpqi"
       [(set (reg:CC CC_REGNUM)
             (compare:CC (match_operand:QI 0 "nonimmediate_operand" 
"rR,rR,Q, Q,rR,Q,r,R,Q")
                         (match_operand:QI 1 "general_operand" "rR,Q, 
rR,Q,O, O,i,i,i")))
         (clobber (match_operand:QI 2 "register_operand" ""))]
       ""

albeit with a clobber, since I need to load the constant to a general 
reg to do a byte compare.  All immediate ops are 16-bit only.  But 
temporarily removing the clobber didn't match it either.

Many thanks in advance for any help

Mark



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-27 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-27 12:50 unrecognizable insn for byte compare in private backend Mark Burkley

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).