From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4510 invoked by alias); 1 Oct 2009 14:41:36 -0000 Received: (qmail 4498 invoked by uid 22791); 1 Oct 2009 14:41:35 -0000 X-SWARE-Spam-Status: No, hits=1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp5.mail.completel.net (HELO smtp5.mail.completel.net) (213.245.2.36) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Oct 2009 14:41:30 +0000 Received: from [192.168.1.100] (unknown [213.244.2.35]) by smtp5.mail.completel.net (Postfix) with ESMTP id 4AC97130403; Thu, 1 Oct 2009 16:41:27 +0200 (CEST) Message-ID: <4AC4BF97.8040302@joguin.com> Date: Thu, 01 Oct 2009 14:41:00 -0000 From: Jean-Marc Saffroy User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: cgen@sourceware.org Subject: problem with 64-bit arch Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2009-q4/txt/msg00001.txt.bz2 Hi, I am trying to use CGEN for an experimental 64-bit architecture (ie. word-bitsize is 64), and in my case the generated arch-ibld.c file is incorrect. I defined the following insn field: (df f-disp24 "disp24" (PCREL-ADDR) 8 24 INT ((value pc) (sra WI (sub WI value pc) (const 2))) ((value pc) (add WI (sll WI value (const 2)) pc)) ) (define-operand (name disp24) (comment "24 bit signed displacement") (type h-iaddr) (mode WI) (index f-disp24) ) And arch-ibld.c contains the following code (in _cgen_insert_operand): switch (opindex) { case _OPERAND_DISP24 : { long value = fields->f_disp24; value = (() (((value) - (pc))) >> (2)); errmsg = insert_normal (cd, value, 0|(1<