public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: MegaIng <trampchamp@hotmail.de>, gcc@gcc.gnu.org
Subject: Re: Porting to a custom ISA
Date: Tue, 15 Aug 2023 07:26:19 -0600	[thread overview]
Message-ID: <149433dc-de3c-9279-5585-e787ca8af853@gmail.com> (raw)
In-Reply-To: <DU0PR03MB9729C65EB89A044555AE9E4DA214A@DU0PR03MB9729.eurprd03.prod.outlook.com>



On 8/15/23 05:37, MegaIng via Gcc wrote:
> 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?
We've certainly got targets which change POINTER_SIZE based on flags. 
It just needs to be a C expession.  So you might see something like

#define POINTER_SIZE (TARGET_SOMEFLAG ? 16 : 32)


> 
> 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?
GCC has supported 16 bit targets for eons, there are still some in the 
tree.  libgcc and newlib also support 16 bit targets.

It can be difficult to support something like double precision floating 
point on a 16 bit target.  So some 16 bit ports only support single 
precision floating point.

> 
> 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 ports define trivial returns.  But it's much more common to need a 
prologue and epilogue.  Those are typically define_expands which 
generate all the code to set up a stack frame and tear a stack frame 
down+return.


Jeff

      parent reply	other threads:[~2023-08-15 13:26 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
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 message]

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=149433dc-de3c-9279-5585-e787ca8af853@gmail.com \
    --to=jeffreyalaw@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).