From patchwork Thu Jan 3 12:54:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Clifton X-Patchwork-Id: 209243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 124AE2C0085 for ; Thu, 3 Jan 2013 23:58:44 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1357822725; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=fY+fogbsjNyZv6s9TfFp PeDyy/w=; b=sCWkRSvQYzhYdP7poElNiKwyOBVGCr/GqWEpNGDVsxTLjfrcKjLm 3i0MP04VmpBHMuhJWVL7uPDyDi6D/xWiU+nqwAyMGALA1iD1+AjlLOLTIz9jZjNz /DTGY2srD+uZeBbamTQWpHnh9dVR+1zYrIppXkKi4U8DSeSft+uCFIw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=m6NNUx8zrvxJdVLKxq1WA8R59fqk+/Or5a+2p9yERcTMs3tF6fdGeshQxYQnio C1gcLQ/jL/nfwviQ9eTUQ9u7RM87L4SWNW0F5cTJygXeSXLi7tbxL1wrSQSHbZsL UhG/WQl/FVtJI0ypBA7DD2s8qyZw7nq6UUStXTwCeHLRM=; Received: (qmail 18181 invoked by alias); 3 Jan 2013 12:58:38 -0000 Received: (qmail 18171 invoked by uid 22791); 3 Jan 2013 12:58:37 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_OV, TW_XF, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Jan 2013 12:58:32 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r03CwWnE007236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 3 Jan 2013 07:58:32 -0500 Received: from Cadeux.redhat.com (vpn1-4-29.ams2.redhat.com [10.36.4.29]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r03CwH1G013219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 3 Jan 2013 07:58:26 -0500 From: Nick Clifton To: dj@redhat.com Cc: gcc-patches@gcc.gnu.org Subject: RFA: RL78: Correct values of the MDBL and MDBH registers Date: Thu, 03 Jan 2013 12:54:52 +0000 Message-ID: <87623e1l5v.fsf@redhat.com> MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi DJ, There is a error in the RL78 G13 hardware manual. Section 14, Figure 14-3 lists the values of the MDBL registers as FFFF4H, FFFF5H and the MDBH registers as FFFF6H, FFFF7H. This is incorrect. The correct values are shown in Section 3, Table 3-5: MDBL => FFFF6H, FFFF7H, MDBH => FFFF4H, FFFF5H. GCC and the RL78 simulator currently use the values from section 14. The patch below corrects GCC. A similar patch will be submitted to update the sim. Tested with no regressions (on an updated sim) using an rl78-elf toolchain. OK to apply ? Cheers Nick gcc/ChangeLog 2013-01-03 Nick Clifton * config/rl78/rl78.md (mulsi3_g13): Correct values for MDBL and MDBH registers. Index: gcc/config/rl78/rl78.md =================================================================== --- gcc/config/rl78/rl78.md (revision 194833) +++ gcc/config/rl78/rl78.md (working copy) @@ -273,10 +273,10 @@ ) ;; 0xFFFF0 is MDAL. 0xFFFF2 is MDAH. -;; 0xFFFF4 is MDBL. 0xFFFF6 is MDBH. +;; 0xFFFF6 is MDBL. 0xFFFF4 is MDBH. ;; 0xF00E0 is MDCL. 0xF00E2 is MDCH. ;; 0xF00E8 is MDUC. -;; Warning: this matches the documentation, not the silicon. +;; Warning: this matches the silicon not the documentation. (define_insn "mulsi3_g13" [(set (match_operand:SI 0 "register_operand" "=&v") (mult:SI (match_operand:SI 1 "nonmemory_operand" "vi") @@ -291,12 +291,12 @@ movw ax, %h2 movw 0xffff2, ax ; MDAH nop ; mdb = mdal * mdah - movw ax, 0xffff4 ; MDBL + movw ax, 0xffff6 ; MDBL movw %h0, ax mov a, #0x40 mov !0xf00e8, a ; MDUC - movw ax, 0xffff6 ; MDBH + movw ax, 0xffff4 ; MDBH movw !0xf00e0, ax ; MDCL movw ax, #0 movw !0xf00e2, ax ; MDCL