From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24149 invoked by alias); 28 Jan 2004 18:32:07 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 24132 invoked from network); 28 Jan 2004 18:32:06 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 28 Jan 2004 18:32:06 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id i0SIW5b32032 for ; Wed, 28 Jan 2004 13:32:05 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i0SIW3M13630 for ; Wed, 28 Jan 2004 13:32:04 -0500 Received: from redhat.com (IDENT:rv/E4BYBD4rsjO7S/U1pDe3tHCxftTiy@vpn50-49.rdu.redhat.com [172.16.50.49]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i0SIW1b02102 for ; Wed, 28 Jan 2004 10:32:02 -0800 Message-ID: <40180031.9040108@redhat.com> Date: Wed, 28 Jan 2004 18:32:00 -0000 From: Dave Brolley User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021216 MIME-Version: 1.0 To: cgen@sources.redhat.com Subject: [patch][rfa] -opcode-slots: Handling of short insns Content-Type: multipart/mixed; boundary="------------010000010501020007040005" X-SW-Source: 2004-q1/txt/msg00006.txt.bz2 This is a multi-part message in MIME format. --------------010000010501020007040005 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1359 Hi, This patch fixes a problem I ran across while working on an internal port. Incorrect opcodes and masks were sometimes being generated for the short insns of variable length ISAs because of two problems in -opcode-slots: 1) The test of bit positions against the insn-length was off by one. Thjs could lead to incorrect opcode bits being generated. 2) While the 'compute' function correctly generated zeroes for the extra bits when computing 'opcode', it was also generating zeroes for these bits when computing 'opcode-mask', thus rendering these bits irrelevent. This could lead to the generation of numerous unreachable cases in the generated decoder switch. The patch corrects the comparison of bit position against the insn-length and also allows the caller of 'compute' to specify the default bit value which should be generated bits beyond the length of a short insn. This allows 0 to be specified when computing 'opcode' and 1 to be specified when computing opcode-mask. The patch also changes some of the logit calls to print values in hex which is more appropriate when examining bitmasks This patch corrects the problem encountered with my internal port. I know of no other port which is affected by this bug. I have tested it against frv and xstormy16 and verified no changes to the generated decoders. OK to commit? Dave --------------010000010501020007040005 Content-Type: text/plain; name="decode.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="decode.ChangeLog" Content-length: 221 2004-01-28 Dave Brolley * decode.scm (-opcode-slots): For short insns, generate 'opcode' with zeroes in the extra bit positions and generate 'opcode-mask' with ones in the extra bit positions. --------------010000010501020007040005 Content-Type: text/plain; name="src040128.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="src040128.ChangeLog" Content-length: 1711 cgen/ChangeLog: 2004-01-26 Dave Brolley * decode.scm (-opcode-slots): For short insns, generate 'opcode' with zeroes in the extra bit positions and generate 'opcode-mask' with ones in the extra bit positions. cgen/cpu/ChangeLog.RedHat: 2004-01-26 Dave Brolley * mep.opc (OPTION_MASK): Remove dangerous whitspace following a backslash intended as a line continuation. sid/main/dynamic/ChangeLog.RedHat: 2004-01-26 Dave Brolley * mepCfg.h (allocate_timer, configure_timer): New methods of MepBoardCfg. (set_opt_timer_channel_bitw): New method of MepBoardCfg. (timer_channel_bitw): New member of MepBoardCfg. * mepCfg.cxx (MepBoardCfg): Initialize timer_channel_bitw. (set_dmem_bank_num): Allow dmem_bank_num to be set to zero. (map_imem_dmem): Correct fmem_base_address for case of no dmem. Initialize dmem_base[0]. (MepBoardCfg::write_config): Call configure_timer. Move setup of timer interrupt pins to configure_timer. Handle case where dmem_bank_num is zero. (add_timer): Move allocation, scheduling and connection of timer to allocate_timer and configure_timer. (allocate_timer, configure_timer): New methods of MepBoardCfg. (configure_dmac): Use timer_channel_bitw. (set_opt_timer_channel_bitw): New method of MepBoardCfg. * mainDynamic.cxx (usage): Document --timer-channel-bitw. (option_num): Add opt_timer_channel_bitw. (long_options): Add timer-channel-bitw. (main): Handle opt_timer_channel_bitw. * commonCfg.h (set_opt_timer_channel_bitw): New prototype. utils/mep/ChangeLog: 2004-01-26 Dave Brolley * mepcfgtool.c (generate_simulator_script): Generate --timer-channel-bitw --------------010000010501020007040005--