public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Disjoint address register problem during GCC port
@ 2008-04-15 17:22 Manish Verma
  2008-04-16 15:37 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: Manish Verma @ 2008-04-15 17:22 UTC (permalink / raw)
  To: gcc-help

Hi all,

 I am trying to port GCC to a new DSP architecture (hopefully will be
made public soon) and I am having a little bit of difficulty in making
GCC to generate code. The reason is that our DSP architecture has
non-orthogonal and segmented (disjoint) address register files (e.g.
A, B and D). Also, all arithmetic operations access memory through
indirect addressing and have restrictions on which register files can
be used as which operand or destination. In addition, they support
offset addressing and post-increment and post-decrement modes.

  For example, MULT <dst> <src1> <src2> operation have the restriction
that <dst> must be a register from REG_D. The operand <src1> must be a
register from REG_A and operand <src2> from REG_B and vice-versa.

  I have defined three register classes (REG_D={d0, ..., d3}, REG_A,
REG_B), set up BASE_REGISTER_CLASS appropriately to make GCC generate
the code of the following form:

   MULT [d0], [a0], [b0]  // d[i] = a[i] * b[i]

  However, I am having problems for GCC to generate the code of the
following form:

   MULT [d0], [a0+1], [b0+2] // d[i] = a[i+1] * b[i+2]

  I am using EXTRA_CONSTRAINT to segregate address registers according
to the address classes.
#define EXTRA_CONSTRAINT(OP, C) \
( (C) == 'Q' ? pica_A_constraint(op,c) \
: (C) == 'R' ? pica_B_constraint(op,c) \
: (C) == 'S' ? pica_D_constraint(op,c) \
: 0)

I have also defined EXTRA_MEMORY_CONSTRAINT appropriately. However, I
keep on getting "error: impossible constraint in 'asm'" error. Any
help on this aspect of GCC would be very much appreciated.

On this issue, I also would like to ask:
(a) Is it possible to have segmented (disjoint) address classes in GCC?
(b) I am using GCC 4.0.2 and I noticed that in the gcc version 4.3.0
has EXTRA_CONSTRAINT is marked as obsolete. Should I use
EXTRA_CONSTRAINT or should I use some other way of specifying an
address register class?

Regards,
Manish

---------------------------------------------------------
Manish Verma
Altera European Technology Centre,
High Wycombe, UK

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

* Re: Disjoint address register problem during GCC port
  2008-04-15 17:22 Disjoint address register problem during GCC port Manish Verma
@ 2008-04-16 15:37 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2008-04-16 15:37 UTC (permalink / raw)
  To: Manish Verma; +Cc: gcc-help

Manish Verma wrote:
> Hi all,
> 
>  I am trying to port GCC to a new DSP architecture (hopefully will be
> made public soon) and I am having a little bit of difficulty in making
> GCC to generate code. 

I think you'd better post this to gcc@gcc.gnu.org.

Andrew.

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

end of thread, other threads:[~2008-04-16 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-15 17:22 Disjoint address register problem during GCC port Manish Verma
2008-04-16 15:37 ` Andrew Haley

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