public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* help about new porting (.h file)
@ 2003-04-03 12:58 Gabriele Caracausi
  2003-04-03 12:59 ` Dave Hudson
  2003-04-04  0:05 ` tm_gccmail
  0 siblings, 2 replies; 5+ messages in thread
From: Gabriele Caracausi @ 2003-04-03 12:58 UTC (permalink / raw)
  To: GCC ML

Hi all, 

I'm working on GCC porting of PIC18C and I've a couple of questions. 

I'm studing ip2k porting because this is the most similar to PIC18C. 

I report from official "Using and Porting GCC" (p. 445), "Pmode is defined 
as an alias for the machine mode for pointers. On most machines, define this 
to be the integer mode corresponding to the width of a hardware pointer; 
SImode on 32 bit machine or DImode on 64-bit machines. [...] The width of 
Pmode must be at least as large as the value of POINTER_SIZE. If it is not 
equal you must define the macro POINTERS_EXTEND_UNSIGNED to specify how 
pointers are extended to Pmode." 

In the IP2k porting (ip2k.h):
* POINTER_SIZE is setted to 16 bit
* Pmode is setted to HImode
* INT_TYPE_SIZE is setted to 16 bit so HImode should be 8 bit.
* SHORT_TYPE_SIZE is setted to 16 bit (for information only) 

POINTERS_EXTEND_UNSIGNED isn't defined and so POINTER_SIZE must be equal to 
Pmode (as written in the manual...) 

# QUESTION 1
Why Pmode isn't at least as large as the value of POINTER_SIZE? 

In addition there's another thing:
In MODES_TIEBLE_P is written that QImode and HImode are readable as the same 
type and this should mean that they have both the same size, but if HImode 
is 16 bit wide QImode should be 8 bit wide and so they should not be 
"tieble" ... 

# QUESTION 2
Why this setting? 

This situation confuses me in writing my porting... 

Maybe for you are simple questions but I need your help for continuing my 
work ... 

Can you help me? 

Many thanks.
Gabriele Caracausi
Palermo (Italy) 

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

* Re: help about new porting (.h file)
  2003-04-03 12:58 help about new porting (.h file) Gabriele Caracausi
@ 2003-04-03 12:59 ` Dave Hudson
  2003-04-04  0:05 ` tm_gccmail
  1 sibling, 0 replies; 5+ messages in thread
From: Dave Hudson @ 2003-04-03 12:59 UTC (permalink / raw)
  To: Gabriele Caracausi; +Cc: GCC ML

Hi Gabriele,

Gabriele Caracausi wrote:
> Hi all,
> * POINTER_SIZE is setted to 16 bit
> * Pmode is setted to HImode
> * INT_TYPE_SIZE is setted to 16 bit so HImode should be 8 bit.

No, HImode is 16 bits for the IP2k.

> In MODES_TIEBLE_P is written that QImode and HImode are readable as the 
> same type and this should mean that they have both the same size, but if 
> HImode is 16 bit wide QImode should be 8 bit wide and so they should not 

When the modes are tieable it means that we can avoid copying things 
around.  I just reviewed this code though and the current definition for 
the IP2k is just plain wrong (as was the predecessor to it).  The code 
suffers some minor size regressions if I just define it to be "1" but 
also wins in a number of other places.

In this particular port the key thing is to avoid gcc thinking that it 
can tie certain HImode or QImode regs to SImode or DImode because the 
16-bit IP and DP pointer regs are not contiguous with the 32 8-bit GPRs.


Regards,
Dave


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

* Re: help about new porting (.h file)
  2003-04-03 12:58 help about new porting (.h file) Gabriele Caracausi
  2003-04-03 12:59 ` Dave Hudson
@ 2003-04-04  0:05 ` tm_gccmail
  2003-04-04  1:26   ` Jonah Graham
  1 sibling, 1 reply; 5+ messages in thread
From: tm_gccmail @ 2003-04-04  0:05 UTC (permalink / raw)
  To: Gabriele Caracausi; +Cc: GCC ML

On Thu, 3 Apr 2003, Gabriele Caracausi wrote:

> Hi all, 
> 
> I'm working on GCC porting of PIC18C and I've a couple of questions. 
> 
> I'm studing ip2k porting because this is the most similar to PIC18C. 
> 
> I report from official "Using and Porting GCC" (p. 445), "Pmode is defined 
> as an alias for the machine mode for pointers. On most machines, define this 
> to be the integer mode corresponding to the width of a hardware pointer; 
> SImode on 32 bit machine or DImode on 64-bit machines. [...] The width of 
> Pmode must be at least as large as the value of POINTER_SIZE. If it is not 
> equal you must define the macro POINTERS_EXTEND_UNSIGNED to specify how 
> pointers are extended to Pmode." 
> 
> In the IP2k porting (ip2k.h):
> * POINTER_SIZE is setted to 16 bit
> * Pmode is setted to HImode
> * INT_TYPE_SIZE is setted to 16 bit so HImode should be 8 bit.

from "rtl.texi" line 890 of 3502:

@findex HImode
@item HImode
``Half-Integer'' mode represents a two-byte integer.

HImode is always 16 bits.

Toshi


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

* Re: help about new porting (.h file)
  2003-04-04  0:05 ` tm_gccmail
@ 2003-04-04  1:26   ` Jonah Graham
  2003-04-04  3:50     ` tm_gccmail
  0 siblings, 1 reply; 5+ messages in thread
From: Jonah Graham @ 2003-04-04  1:26 UTC (permalink / raw)
  To: tm_gccmail, Gabriele Caracausi; +Cc: GCC ML


tm_gccmail@mail.kloo.net wrote:

> from "rtl.texi" line 890 of 3502:
>
> @findex HImode
> @item HImode
> ``Half-Integer'' mode represents a two-byte integer.
>
> HImode is always 16 bits.

Actually what that means is that it is two bytes where a byte is defined by
BITS_PER_UNIT. While in most targets that makes it 16-bits, HImode is not
always 16-bits. See the c4x and dsp16xx ports which have 64-bit and 32-bit
HImodes respectively.

(But don't let that confuse the issue for a new port if you have a "normal"
byte.)

Jonah

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

* Re: help about new porting (.h file)
  2003-04-04  1:26   ` Jonah Graham
@ 2003-04-04  3:50     ` tm_gccmail
  0 siblings, 0 replies; 5+ messages in thread
From: tm_gccmail @ 2003-04-04  3:50 UTC (permalink / raw)
  To: Jonah Graham; +Cc: Gabriele Caracausi, GCC ML

On Fri, 4 Apr 2003, Jonah Graham wrote:

> 
> tm_gccmail@mail.kloo.net wrote:
> 
> > from "rtl.texi" line 890 of 3502:
> >
> > @findex HImode
> > @item HImode
> > ``Half-Integer'' mode represents a two-byte integer.
> >
> > HImode is always 16 bits.
> 
> Actually what that means is that it is two bytes where a byte is defined by
> BITS_PER_UNIT. While in most targets that makes it 16-bits, HImode is not
> always 16-bits. See the c4x and dsp16xx ports which have 64-bit and 32-bit
> HImodes respectively.
> 
> (But don't let that confuse the issue for a new port if you have a "normal"
> byte.)
> 
> Jonah

Thanks for the correction.

Toshi


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

end of thread, other threads:[~2003-04-04  0:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-03 12:58 help about new porting (.h file) Gabriele Caracausi
2003-04-03 12:59 ` Dave Hudson
2003-04-04  0:05 ` tm_gccmail
2003-04-04  1:26   ` Jonah Graham
2003-04-04  3:50     ` tm_gccmail

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