From patchwork Mon Feb 27 19:41:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Ricardo Ziviani X-Patchwork-Id: 733067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vXC0q6S5zz9s8S for ; Tue, 28 Feb 2017 06:47:39 +1100 (AEDT) Received: from localhost ([::1]:56355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciRGi-0000cO-Im for incoming@patchwork.ozlabs.org; Mon, 27 Feb 2017 14:47:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciRBH-0003uk-53 for qemu-devel@nongnu.org; Mon, 27 Feb 2017 14:42:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciRBC-0003ck-T8 for qemu-devel@nongnu.org; Mon, 27 Feb 2017 14:41:59 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:51422) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciRBC-0003cO-K7 for qemu-devel@nongnu.org; Mon, 27 Feb 2017 14:41:54 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1RJdMrF008063 for ; Mon, 27 Feb 2017 14:41:53 -0500 Received: from e24smtp03.br.ibm.com (e24smtp03.br.ibm.com [32.104.18.24]) by mx0a-001b2d01.pphosted.com with ESMTP id 28vjd4g6ea-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 27 Feb 2017 14:41:53 -0500 Received: from localhost by e24smtp03.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 27 Feb 2017 16:41:50 -0300 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp03.br.ibm.com (10.172.0.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 27 Feb 2017 16:41:49 -0300 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.18.232.225]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id C2D421DC006D for ; Mon, 27 Feb 2017 14:41:49 -0500 (EST) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1RJfmw920971724 for ; Mon, 27 Feb 2017 16:41:48 -0300 Received: from d24av01.br.ibm.com (localhost [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1RJflJx006483 for ; Mon, 27 Feb 2017 16:41:48 -0300 Received: from pacoca.ibm.com ([9.80.213.217]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1RJfXWP006315; Mon, 27 Feb 2017 16:41:45 -0300 From: Jose Ricardo Ziviani To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 16:41:31 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488224492-20316-1-git-send-email-joserz@linux.vnet.ibm.com> References: <1488224492-20316-1-git-send-email-joserz@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022719-0024-0000-0000-0000015799E6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022719-0025-0000-0000-0000161CB1B6 Message-Id: <1488224492-20316-5-git-send-email-joserz@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-27_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702270185 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH Risu 4/5] risugen, risugen_ppc64.pm: Add support ppc64 (big-endian) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, nikunj@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This commit adds an option to risugen in order to give the opportunity to generated big-endian instructions. By passing --be, users force risugen to generated big-endian instructions for ppc64. ./risugen --be --numinsns 1000 --pattern "ADD" ppc64.risu test.bin ./risugen --numinsns 1000 --pattern "ADD" ppc64.risu test.bin Signed-off-by: Jose Ricardo Ziviani --- risugen | 6 +++++- risugen_ppc64.pm | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/risugen b/risugen index 6aad626..086173c 100755 --- a/risugen +++ b/risugen @@ -264,6 +264,7 @@ Valid options: a general set you have excluded. --no-fp : disable floating point: no fp init, randomization etc. Useful to test before support for FP is available. + --be : generate instructions in Big-Endian order (ppc64 only). --help : print this message EOT } @@ -274,6 +275,7 @@ sub main() my $condprob = 0; my $fpscr = 0; my $fp_enabled = 1; + my $big_endian = 0; my ($infile, $outfile); GetOptions( "help" => sub { usage(); exit(0); }, @@ -287,6 +289,7 @@ sub main() die "Value \"$condprob\" invalid for option condprob (must be between 0 and 1)\n"; } }, + "be" => sub { $big_endian = 1; }, "no-fp" => sub { $fp_enabled = 0; }, ) or return 1; # allow "--pattern re,re" and "--pattern re --pattern re" @@ -317,7 +320,8 @@ sub main() 'not_pattern_re' => \@not_pattern_re, 'details' => \%insn_details, 'arch' => $full_arch[0], - 'subarch' => $full_arch[1] || '' + 'subarch' => $full_arch[1] || '', + 'bigendian' => $big_endian ); write_test_code(\%params); diff --git a/risugen_ppc64.pm b/risugen_ppc64.pm index 28b6792..46ab7b1 100644 --- a/risugen_ppc64.pm +++ b/risugen_ppc64.pm @@ -373,6 +373,10 @@ sub write_test_code($) my @not_pattern_re = @{ $params->{ 'not_pattern_re' } }; my %insn_details = %{ $params->{ 'details' } }; + if ($params->{ 'bigendian' } eq 1) { + set_endian(1); + } + open_bin($outfile); # convert from probability that insn will be conditional to