From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1005 invoked by alias); 18 Dec 2007 21:46:08 -0000 Received: (qmail 997 invoked by uid 22791); 18 Dec 2007 21:46:07 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 18 Dec 2007 21:46:02 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.1) with ESMTP id lBILk1lp002498 for ; Tue, 18 Dec 2007 16:46:01 -0500 Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [10.11.254.111]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id lBILk0Wi003699; Tue, 18 Dec 2007 16:46:00 -0500 Received: from greed.delorie.com (vpn-14-33.rdu.redhat.com [10.11.14.33]) by post-office.corp.redhat.com (8.13.8/8.13.8) with ESMTP id lBILjwnS011585; Tue, 18 Dec 2007 16:46:00 -0500 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.13.8/8.13.8) with ESMTP id lBILjvD3028117; Tue, 18 Dec 2007 16:45:57 -0500 Received: (from dj@localhost) by greed.delorie.com (8.13.8/8.13.8/Submit) id lBILjvWJ028114; Tue, 18 Dec 2007 16:45:57 -0500 Date: Tue, 18 Dec 2007 21:59:00 -0000 Message-Id: <200712182145.lBILjvWJ028114@greed.delorie.com> From: DJ Delorie To: gdb-patches@sourceware.org CC: brolley@redhat.com Subject: [frv sim] clip cut point for MWCUT X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00293.txt.bz2 The MWCUT opcode only looks at the six LSBs of the cut point register. The frv.c code was looking at the whole register, resulting in incorrect cut results. This patch clips the cut_point argument to six bits (0..63). Ok to apply? * frv/frv.c (frvbf_cut): Only look at the six LSBs of cut_point. Index: frv.c =================================================================== RCS file: /cvs/src/src/sim/frv/frv.c,v retrieving revision 1.9 diff -p -U3 -r1.9 frv.c --- frv.c 24 Aug 2007 14:28:36 -0000 1.9 +++ frv.c 18 Dec 2007 21:42:50 -0000 @@ -1055,6 +1055,7 @@ SI frvbf_cut (SIM_CPU *current_cpu, SI reg1, SI reg2, SI cut_point) { SI result; + cut_point &= 0x3f; if (cut_point < 32) { result = reg1 << cut_point;