public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Porting to a custom ISA
@ 2023-08-15 11:37 MegaIng
  2023-08-15 12:06 ` Richard Biener
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: MegaIng @ 2023-08-15 11:37 UTC (permalink / raw)
  To: gcc

Hello everyone,

I am currently in the process of porting gcc to an ISA I designed with a 
few others (spec [1]). Using the old ggx/moxie tutorial as a guideline 
and looking at the source of other backends, as well as the quite decent 
gccint document, I managed to get basic programs running (binutils, 
especially gas, was also not too hard to get running). I am now 
partially writing here because the gccint documents tells me to do this 
(I am unsure if our project will ever be mature enough to be added to 
gcc, but I don't think it hurts to strive for that), and partially 
because I do need a bit of help with some stuff that I can't find 
documentation for.

One of the big challenges I am facing is that for our backend we 
sometimes support 16bit as the max size a CPU supports, including for 
pointers, and sometimes 32bit or 64bit. Am I seeing it correctly that 
POINTER_SIZE has to be a compile time constant and can therefore not 
easily be changed by the backend during compilation based on command 
line arguments?

Also, on another backend I saw comments relating to libgcc (or newlib?) 
not working that well on systems where int is 16bit. Is that still true, 
and what is the best workaround?

And a bit more concrete with something I am having a hard time 
debugging. I am getting errors `invalid_void`, seemingly triggered by an 
absent of `gen_return` when compiling with anything higher than -O0. How 
do I correctly provide an implementation for that? Or disable it's 
usage? Our epilogue is non-trivial, and it doesn't look like the other 
backends use something like `(define_insn "return" ...)`.

Many thanks in advance,

MegaIng


[1]: https://github.com/ETC-A/etca-spec


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

end of thread, other threads:[~2023-08-21 14:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-15 11:37 Porting to a custom ISA MegaIng
2023-08-15 12:06 ` Richard Biener
2023-08-15 12:48   ` Paul Koning
     [not found]     ` <DU0PR03MB972974FA63A93A6D67754428A214A@DU0PR03MB9729.eurprd03.prod.outlook.com>
     [not found]       ` <D0E7DFB2-A980-4376-8DE4-6936A2714FC9@comcast.net>
2023-08-15 14:38         ` MegaIng
2023-08-21 14:16   ` Georg-Johann Lay
2023-08-15 12:40 ` Paul Koning
2023-08-15 12:49   ` MegaIng
2023-08-15 13:01     ` Paul Koning
2023-08-15 13:26 ` Jeff Law

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