From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johan Rydberg To: matthew green Cc: cgen@sources.redhat.com, Eric Christopher Subject: Re: 64-bit port using CGEN Date: Tue, 15 May 2001 20:24:00 -0000 Message-id: <3B01F306.4152A19C@netinsight.se> References: <12258.989982603@cygnus.com> X-SW-Source: 2001-q2/msg00064.html 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 (); ... }