This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 64-bit port using CGEN


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 ();
    ...
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]