public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: MegaIng <trampchamp@hotmail.de>
Cc: gcc@gcc.gnu.org
Subject: Re: Porting to a custom ISA
Date: Tue, 15 Aug 2023 14:06:11 +0200	[thread overview]
Message-ID: <CAFiYyc32p7MD+5Pn+0qxqbTEwrh4hNTg6-kXLUYNx_ZV48Kxdg@mail.gmail.com> (raw)
In-Reply-To: <DU0PR03MB9729C65EB89A044555AE9E4DA214A@DU0PR03MB9729.eurprd03.prod.outlook.com>

On Tue, Aug 15, 2023 at 1:38 PM MegaIng via Gcc <gcc@gcc.gnu.org> wrote:
>
> 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?

POINTER_SIZE needs to be only a C expression, not a constant

> 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?

You could look into the AVR port for example.  I think libgcc should
work reasonably well here.

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

Somebody else has to answer this.

Richard.

> Many thanks in advance,
>
> MegaIng
>
>
> [1]: https://github.com/ETC-A/etca-spec
>

  reply	other threads:[~2023-08-15 12:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 11:37 MegaIng
2023-08-15 12:06 ` Richard Biener [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc32p7MD+5Pn+0qxqbTEwrh4hNTg6-kXLUYNx_ZV48Kxdg@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=trampchamp@hotmail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).