From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16017 invoked by alias); 20 Jan 2003 23:22:16 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 15990 invoked from network); 20 Jan 2003 23:22:15 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 20 Jan 2003 23:22:15 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h0KMrXB30756; Mon, 20 Jan 2003 17:53:33 -0500 Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h0KNM8a28013; Mon, 20 Jan 2003 18:22:08 -0500 Received: from greed.delorie.com (dj.cipe.redhat.com [10.0.0.222]) by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h0KNM7K01378; Mon, 20 Jan 2003 18:22:08 -0500 Received: (from dj@localhost) by greed.delorie.com (8.11.6/8.11.6) id h0KNMED10018; Mon, 20 Jan 2003 18:22:14 -0500 Date: Mon, 20 Jan 2003 23:22:00 -0000 Message-Id: <200301202322.h0KNMED10018@greed.delorie.com> From: DJ Delorie To: cgen@sources.redhat.com, sid@sources.redhat.com Subject: [patch] xstormy16 semantics X-SW-Source: 2003-q1/txt/msg00012.txt.bz2 This fixes numerous bugs found by Sanyo. Ok? 2003-01-20 DJ Delorie * xstormy16.cpu (set-psw-rrotate17): New. Choose the correct set of 16 patterns from the set-psw-rotate17 function. (movgrigr, movgripostincgr, movgripredecgr, movgriigr, movgriipostincgr, movgriipredecgr): Set psw correctly. (movfgrigr, movfgripostincgr, movfgripredecgr, movfgriigr, movfgriipostincgr, movfgriipredecgr): Fix semantics. (rrcgrgr, rrcgrimm4): Use new set-psw-rrotate17 function. Index: xstormy16.cpu =================================================================== RCS file: /cvs/src/src/cgen/cpu/xstormy16.cpu,v retrieving revision 1.5 diff -p -3 -r1.5 xstormy16.cpu *** xstormy16.cpu 17 Dec 2002 03:54:41 -0000 1.5 --- xstormy16.cpu 20 Jan 2003 23:20:39 -0000 *************** *** 1,5 **** ; xstormy16 CPU core description. -*- Scheme -*- ! ; Copyright (C) 2001, 2002 Red Hat, Inc. ; This file is part of CGEN. ; See file COPYING.CGEN for details. --- 1,5 ---- ; xstormy16 CPU core description. -*- Scheme -*- ! ; Copyright (C) 2001, 2002, 2003 Red Hat, Inc. ; This file is part of CGEN. ; See file COPYING.CGEN for details. *************** *** 488,493 **** --- 488,498 ---- (set tmpfoo (rol tmpfoo (and rot #x1F))) (set-psw-carry (reg HI h-gr index) index (trunc HI tmpfoo) (and (srl tmpfoo 16) 1)))) + ; We have to be careful to get the right group of 16 shifts from the above. + (define-pmacro (set-psw-rrotate17 Rd index src c rot) + (set-psw-rotate17 Rd index src c (sub 47 (mod (add (and rot #xf) 15) 17))) + ) + ; Move Operations *************** *** 619,625 **** (if ws2 (set-alignfix-mem Rs Rdm) (set (mem QI Rs) Rdm)) ! (set-psw-nowrite (index-of Rs) Rs)) () ) --- 624,630 ---- (if ws2 (set-alignfix-mem Rs Rdm) (set (mem QI Rs) Rdm)) ! (set-psw-nowrite (index-of Rdm) Rdm)) () ) *************** *** 632,638 **** (if ws2 (set-alignfix-mem Rs Rdm) (set (mem QI Rs) Rdm)) ! (set-psw Rs (index-of Rs) (add Rs (add ws2 1)))) () ) --- 637,644 ---- (if ws2 (set-alignfix-mem Rs Rdm) (set (mem QI Rs) Rdm)) ! (set-psw-nowrite (index-of Rdm) Rdm) ! (set Rs (add Rs (add ws2 1)))) () ) *************** *** 642,648 **** ("mov$ws2 (--$Rs),$Rdm") (+ OP1_6 OP2A_A ws2 Rs OP4M_0 Rdm) (sequence () ! (set-psw Rs (index-of Rs) (sub Rs (add ws2 1))) (if ws2 (set-alignfix-mem Rs Rdm) (set (mem QI Rs) Rdm))) --- 648,655 ---- ("mov$ws2 (--$Rs),$Rdm") (+ OP1_6 OP2A_A ws2 Rs OP4M_0 Rdm) (sequence () ! (set Rs (sub Rs (add ws2 1))) ! (set-psw-nowrite (index-of Rdm) Rdm) (if ws2 (set-alignfix-mem Rs Rdm) (set (mem QI Rs) Rdm))) *************** *** 695,701 **** (if ws2 (set-alignfix-mem (add Rs imm12) Rdm) (set (mem QI (add Rs imm12)) Rdm)) ! (set-psw Rs (index-of Rs) Rs)) () ) --- 702,708 ---- (if ws2 (set-alignfix-mem (add Rs imm12) Rdm) (set (mem QI (add Rs imm12)) Rdm)) ! (set-psw-nowrite (index-of Rdm) Rdm)) () ) *************** *** 708,714 **** (if ws2 (set-alignfix-mem (add Rs imm12) Rdm) (set (mem QI (add Rs imm12)) Rdm)) ! (set-psw Rs (index-of Rs) (add Rs 1))) () ) --- 715,722 ---- (if ws2 (set-alignfix-mem (add Rs imm12) Rdm) (set (mem QI (add Rs imm12)) Rdm)) ! (set-psw-nowrite (index-of Rdm) Rdm) ! (set Rs (add Rs 1))) () ) *************** *** 718,724 **** ("mov$ws2 (--$Rs,$imm12),$Rdm") (+ OP1_6 OP2A_A ws2 Rs OP4M_1 Rdm OP5_0 imm12) (sequence () ! (set-psw Rs (index-of Rs) (sub Rs 1)) (if ws2 (set-alignfix-mem (add Rs imm12) Rdm) (set (mem QI (add Rs imm12)) Rdm))) --- 726,733 ---- ("mov$ws2 (--$Rs,$imm12),$Rdm") (+ OP1_6 OP2A_A ws2 Rs OP4M_1 Rdm OP5_0 imm12) (sequence () ! (set Rs (sub Rs 1)) ! (set-psw-nowrite (index-of Rdm) Rdm) (if ws2 (set-alignfix-mem (add Rs imm12) Rdm) (set (mem QI (add Rs imm12)) Rdm))) *************** *** 844,852 **** (+ OP1_7 OP2A_6 ws2 Rs OP4M_0 Rdm) (sequence () (if ws2 ! (set-psw Rs (index-of Rs) (alignfix-mem (join SI HI R8 Rdm))) ! (set-psw Rs (index-of Rs) (and #xFF (mem QI (join SI HI R8 Rdm))))) ! (set-psw Rs (index-of Rs) Rs)) () ) --- 853,861 ---- (+ OP1_7 OP2A_6 ws2 Rs OP4M_0 Rdm) (sequence () (if ws2 ! (set-alignfix-mem (join SI HI R8 Rs) Rdm) ! (set (mem QI (join SI HI R8 Rs)) Rdm)) ! (set-psw-nowrite (index-of Rdm) Rdm)) () ) *************** *** 857,865 **** (+ OP1_6 OP2A_6 ws2 Rs OP4M_0 Rdm) (sequence () (if ws2 ! (set-psw Rs (index-of Rs) (alignfix-mem (join SI HI R8 Rdm))) ! (set-psw Rs (index-of Rs) (and #xFF (mem QI (join SI HI R8 Rdm))))) ! (set-psw Rs (index-of Rs) (add Rs (add ws2 1)))) () ) --- 866,875 ---- (+ OP1_6 OP2A_6 ws2 Rs OP4M_0 Rdm) (sequence () (if ws2 ! (set-alignfix-mem (join SI HI R8 Rs) Rdm) ! (set (mem QI (join SI HI R8 Rs)) Rdm)) ! (set-psw-nowrite (index-of Rdm) Rdm) ! (set Rs (add Rs (add ws2 1)))) () ) *************** *** 869,878 **** ("movf$ws2 (--$Rs),$Rdm") (+ OP1_6 OP2A_E ws2 Rs OP4M_0 Rdm) (sequence () ! (set-psw Rs (index-of Rs) (sub Rs (add ws2 1))) (if ws2 ! (set-psw Rs (index-of Rs) (alignfix-mem (join SI HI R8 Rdm))) ! (set-psw Rs (index-of Rs) (and #xFF (mem QI (join SI HI R8 Rdm)))))) () ) --- 879,889 ---- ("movf$ws2 (--$Rs),$Rdm") (+ OP1_6 OP2A_E ws2 Rs OP4M_0 Rdm) (sequence () ! (set-psw-nowrite (index-of Rdm) Rdm) ! (set Rs (sub Rs (add ws2 1))) (if ws2 ! (set-alignfix-mem (join SI HI R8 Rs) Rdm) ! (set (mem QI (join SI HI R8 Rs)) Rdm))) () ) *************** *** 923,929 **** (set (mem HI (and (add (join SI HI Rb Rs) imm12) #xFFFFFFFE)) Rdm) (set (mem QI (add (join SI HI Rb Rs) imm12)) Rdm)) ! (set-psw Rs (index-of Rs) Rs)) () ) --- 934,940 ---- (set (mem HI (and (add (join SI HI Rb Rs) imm12) #xFFFFFFFE)) Rdm) (set (mem QI (add (join SI HI Rb Rs) imm12)) Rdm)) ! (set-psw-nowrite (index-of Rdm) Rdm)) () ) *************** *** 937,943 **** (if ws2 (set (mem HI (and (add (join SI HI Rb Rs) imm12) #xFFFFFFFE)) Rdm) (set (mem QI (add (join SI HI Rb Rs) imm12)) Rdm)) ! (set-psw Rs (index-of Rs) (add Rs (add ws2 1)))) () ) --- 948,955 ---- (if ws2 (set (mem HI (and (add (join SI HI Rb Rs) imm12) #xFFFFFFFE)) Rdm) (set (mem QI (add (join SI HI Rb Rs) imm12)) Rdm)) ! (set-psw-nowrite (index-of Rdm) Rdm) ! (set Rs (add Rs (add ws2 1)))) () ) *************** *** 947,953 **** ("movf$ws2 ($Rb,--$Rs,$imm12),$Rdm") (+ OP1_6 OP2A_E ws2 Rs OP4M_1 Rdm OP5A_0 Rb imm12) (sequence () ! (set-psw Rs (index-of Rs) (sub Rs 1)) (if ws2 (set (mem HI (and (add (join SI HI Rb Rs) imm12) #xFFFFFFFE)) Rdm) (set (mem QI (add (join SI HI Rb Rs) imm12)) Rdm))) --- 959,966 ---- ("movf$ws2 ($Rb,--$Rs,$imm12),$Rdm") (+ OP1_6 OP2A_E ws2 Rs OP4M_1 Rdm OP5A_0 Rb imm12) (sequence () ! (set Rs (sub Rs 1)) ! (set-psw-nowrite (index-of Rdm) Rdm) (if ws2 (set (mem HI (and (add (join SI HI Rb Rs) imm12) #xFFFFFFFE)) Rdm) (set (mem QI (add (join SI HI Rb Rs) imm12)) Rdm))) *************** *** 1302,1308 **** () ("rrc $Rd,$Rs") (+ OP1_3 OP2_8 Rs Rd) ! (set-psw-rotate17 Rd (index-of Rd) Rd psw-cy (neg (and Rs #xF))) () ) --- 1315,1321 ---- () ("rrc $Rd,$Rs") (+ OP1_3 OP2_8 Rs Rd) ! (set-psw-rrotate17 Rd (index-of Rd) Rd psw-cy Rs) () ) *************** *** 1311,1317 **** () ("rrc $Rd,#$imm4") (+ OP1_3 OP2_9 imm4 Rd) ! (set-psw-rotate17 Rd (index-of Rd) Rd psw-cy (neg imm4)) () ) --- 1324,1330 ---- () ("rrc $Rd,#$imm4") (+ OP1_3 OP2_9 imm4 Rd) ! (set-psw-rrotate17 Rd (index-of Rd) Rd psw-cy imm4) () )