🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52733

Need help with movqi and movhi insns

#52733
From: Robert McVay
Date: Thu, 28 May 1992 16:52
28 lines
2327 bytes
OK, here's the scoop.  I've been trying to create a compiler for a custom
processor which is based on the MIPS architecture but does not include byte (QI)
or half-word (HI) instructions.  My plan was to replace the movqi and movhi
insns with define_expands which would do the actual loads, shifting, and masking
required to implement the byte and half-word operations.  Unfortunately, these
insns are somewhat special - as noted on page 191 of the 2.1 docs - and I'll
be darned if I can get this to work.  I've tried several different approaches
but none have worked so far.

The main problem seems to be that since these insns are used after code 
generation (during reload) they cannot allocate temporary registers.  The
docs suggest looking at the spur.md file as an example.  I did this only to
find that this example (apparently) allocates several temporary registers.
I was confused by this apparent contradiction with the documentation but tried
applying the same approach.  Well, it seemed to work OK for the byte 
operations but failed for the HI insns.  Tracing back the problem revealed that
there is a check in the gen_reg_rtx() routine which aborts if called during
reload (reload_in_progress).  I tried removing this check (no, I didn't really
expect this to work) but this just caused problems further down the line.

So if anyone has followed this at all (or thinks they could offer assistance
given more information) please send email with any suggestions about what
I should do next.  In the meantime I'll keep plugging away at it.

					Thanks,
						Bob McVay
						mcvay@engin.umich.edu
Technical Details
Message-ID: <1992May28.165228.26403@zip.eecs.umich.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!spool.mu.edu!mips!think.com!yale.edu!nigel.msen.com!caen!destroyer!ais.org!umeecs!dip.eecs.umich.edu!mcvay

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,5f65cf798d951ae7,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-05-28 10:41:22 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!spool.mu.edu!mips!think.com!yale.edu!nigel.msen.com!caen!destroyer!ais.org!umeecs!dip.eecs.umich.edu!mcvay
From: mcvay@dip.eecs.umich.edu (Robert McVay)
Newsgroups: gnu.gcc.help
Subject: Need help with movqi and movhi insns
Message-ID: <1992May28.165228.26403@zip.eecs.umich.edu>
Date: 28 May 92 16:52:28 GMT
Article-I.D.: zip.1992May28.165228.26403
Sender: news@zip.eecs.umich.edu (Mr. News)
Organization: University of Michigan EECS Dept., Ann Arbor, MI
Lines: 28