This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
Re: 64-bit port using CGEN
- To: matthew green <mrg at cygnus dot com>
- Subject: Re: 64-bit port using CGEN
- From: Johan Rydberg <johan dot rydberg at netinsight dot se>
- Date: Wed, 16 May 2001 05:24:54 +0200
- CC: cgen at sources dot redhat dot com, Eric Christopher <echristo at redhat dot com>
- Organization: Net Insight AB
- References: <12258.989982603@cygnus.com>
matthew green wrote:
>
>
> CGEN_INSN_INT is typedef:ed as an "unsigned int" and CGEN generates alot
> of code that thinks that an insn or operand can fit into a long or int.
>
> what does your opcodes/foo-desc.h have defined for CGEN_INT_INSN_P? this
> should be zero when you have any instructions larger than what fit into
> an int. if not, i suspect problems in your insn formats.
It is defined to zero.
First of all, opcode values are truncated to zero:
static const CGEN_IFMT ifmt_j = {
64, 64, 0xe000000000000000, { { F (F_OPC) }, { F (F_ABS61) }, { 0 } }
};
pxs-opc.c:55: warning: large integer implicitly truncated to unsigned type
Looking in /include/opcodes/cgen.h:
typedef struct
{
...
CGEN_INSN_INT mask;
} CGEN_IFMT;
Since CGEN_INSN_INT is typedef:ed as an unsigned int, 0xe000000000000000 gets
truncated to 32-bits.
Second,
The genereated insert and extract code aborts when word length is larger than
32 bit. From /opcodes/cgen-ibld.in:
static const char *
insert_normal (cd, value, attrs, word_offset, start, length, word_length,
total_length, buffer)
...
{
...
if (word_length > 32)
abort ();
...
}