public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Pointer width in GCC?
@ 2021-01-08 19:55 Qing Zhao
  2021-01-08 20:15 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Qing Zhao @ 2021-01-08 19:55 UTC (permalink / raw)
  To: gcc-patches Richard Biener via

Hi,

Is there an utility routine in GCC to query the pointer width of the current target? Whether it’s 32bit pointer or 64 bit pointer for the target?

Thanks a lot for the help.

Qing

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

* Re: Pointer width in GCC?
  2021-01-08 19:55 Pointer width in GCC? Qing Zhao
@ 2021-01-08 20:15 ` Jeff Law
  2021-01-08 20:32   ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2021-01-08 20:15 UTC (permalink / raw)
  To: Qing Zhao, gcc-patches Richard Biener via



On 1/8/21 12:55 PM, Qing Zhao via Gcc-patches wrote:
> Hi,
>
> Is there an utility routine in GCC to query the pointer width of the current target? Whether it’s 32bit pointer or 64 bit pointer for the target?
>
> Thanks a lot for the help.
You can look at the GET_MODE_SIZE (Pmode)  or POINTER_SIZE.  They can
differ in some circumstances.


jeff


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

* Re: Pointer width in GCC?
  2021-01-08 20:15 ` Jeff Law
@ 2021-01-08 20:32   ` H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2021-01-08 20:32 UTC (permalink / raw)
  To: Jeff Law; +Cc: Qing Zhao, gcc-patches Richard Biener via

On Fri, Jan 8, 2021 at 12:15 PM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
>
> On 1/8/21 12:55 PM, Qing Zhao via Gcc-patches wrote:
> > Hi,
> >
> > Is there an utility routine in GCC to query the pointer width of the current target? Whether it’s 32bit pointer or 64 bit pointer for the target?
> >
> > Thanks a lot for the help.
> You can look at the GET_MODE_SIZE (Pmode)  or POINTER_SIZE.  They can
> differ in some circumstances.
>

It is ptr_mode vs Pmode.  ptr_mode is the software pointer mode.  Pmode
is the hardware pointer mode.  They can be different.


-- 
H.J.

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

end of thread, other threads:[~2021-01-08 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 19:55 Pointer width in GCC? Qing Zhao
2021-01-08 20:15 ` Jeff Law
2021-01-08 20:32   ` H.J. Lu

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