From nobody Thu Nov 6 15:13:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489084836673286.7040546769733; Thu, 9 Mar 2017 10:40:36 -0800 (PST) Received: from localhost ([::1]:35765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm2zL-0002XP-3Y for importer@patchew.org; Thu, 09 Mar 2017 13:40:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm2yU-0002Ui-7x for qemu-devel@nongnu.org; Thu, 09 Mar 2017 13:39:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cm2yQ-0002hN-Bn for qemu-devel@nongnu.org; Thu, 09 Mar 2017 13:39:42 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40101 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cm2yQ-0002hD-5y for qemu-devel@nongnu.org; Thu, 09 Mar 2017 13:39:38 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v29IcddU040163 for ; Thu, 9 Mar 2017 13:39:36 -0500 Received: from e24smtp02.br.ibm.com (e24smtp02.br.ibm.com [32.104.18.86]) by mx0b-001b2d01.pphosted.com with ESMTP id 292mrm8eay-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 09 Mar 2017 13:39:36 -0500 Received: from localhost by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Mar 2017 15:39:34 -0300 Received: from d24relay03.br.ibm.com (9.18.232.225) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 9 Mar 2017 15:39:33 -0300 Received: from d24av05.br.ibm.com (d24av05.br.ibm.com [9.18.232.44]) by d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v29IdObY33882228 for ; Thu, 9 Mar 2017 15:39:32 -0300 Received: from d24av05.br.ibm.com (localhost [127.0.0.1]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v29Id1MF022511 for ; Thu, 9 Mar 2017 15:39:01 -0300 Received: from pacoca.ibm.com ([9.85.162.7]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v29IcuUk022203; Thu, 9 Mar 2017 15:38:59 -0300 From: Jose Ricardo Ziviani To: qemu-devel@nongnu.org Date: Thu, 9 Mar 2017 15:38:36 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489084718-15294-1-git-send-email-joserz@linux.vnet.ibm.com> References: <1489084718-15294-1-git-send-email-joserz@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17030918-0020-0000-0000-00000290657C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17030918-0021-0000-0000-000030AC78CA Message-Id: <1489084718-15294-2-git-send-email-joserz@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-09_15:, , 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-1702020001 definitions=main-1703090136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH Risu v2 1/3] risugen_ppc64: Load random 128-bit data to VSX registers 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jose Ricardo Ziviani --- risugen_ppc64.pm | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/risugen_ppc64.pm b/risugen_ppc64.pm index 341478c..45f7220 100644 --- a/risugen_ppc64.pm +++ b/risugen_ppc64.pm @@ -99,6 +99,29 @@ sub write_mov_ri64($$) insn32((0x3e << 26) | (20 << 21) | (1 << 16) | 0x10); } =20 +sub write_mov_ri128($$$$) +{ + my ($imhh, $imh, $iml, $imll) =3D @_; + + # store the lowest 32 bits + write_mov_ri32(20, $imll); + # stw r20, 16(r1) + insn32((0x24 << 26) | (20 << 21) | (1 << 16) | 0x10); + # store the lower 32 bits + write_mov_ri32(20, $iml); + # stw r20, 20(r1) + insn32((0x24 << 26) | (20 << 21) | (1 << 16) | 0x14); + # store the higher 32 bits + write_mov_ri32(20, $imh); + # stw r20, 24(r1) + insn32((0x24 << 26) | (20 << 21) | (1 << 16) | 0x18); + # store the highest 32 bits + write_mov_ri32(20, $imhh); + # stw r20, 28(r1) + insn32((0x24 << 26) | (20 << 21) | (1 << 16) | 0x1c); + +} + sub write_random_ppc64_fpdata() { for (my $i =3D 0; $i < 32; $i++) { @@ -106,22 +129,16 @@ sub write_random_ppc64_fpdata() write_mov_ri64(rand(0xfffff), rand(0xfffff)); # since the EA is r1+16, load such value in FP reg insn32((0x32 << 26) | ($i << 21) | (0x1 << 16) | 0x10); - insn32((0x39 << 26) | ($i << 21) | (0x1 << 16) | 0x12); - } } =20 -sub write_random_ppc64_fpdata_i() +sub write_random_ppc64_vsxdata() { - # get an space from the stack - insn32(0x3ac10020); # addi r22, r1, 32 - insn32(0x3ee03ff0); # lis r23, 0x3ff0 - insn32(0x3af70000); # addi r23, r23, 0 - insn32(0xfaf60000); # std r23, 0(r22) - for (my $i =3D 0; $i < 32; $i++) { - # lfd f$i, 0(r22) - insn32((0x32 << 26 | $i << 21 | 0x16 << 16)); + # load a random doubleword value at r0 + write_mov_ri128(rand(0xffff), rand(0xffff), rand(0xfffff), rand(0x= fffff)); + # load the 128-bit data in a vector register + insn32((0x3d << 26) | (($i >> 1) << 21) | (0x1 << 16) | (0x10 << 5= ) | (($i & 1) << 4) | 0x1); } } =20 @@ -172,6 +189,7 @@ sub write_random_register_data($) =20 clear_vr_registers(); =20 + write_random_ppc64_vsxdata(); if ($fp_enabled) { # load floating point / SIMD registers write_random_ppc64_fpdata(); --=20 2.7.4 From nobody Thu Nov 6 15:13:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489084840332147.63814298638965; Thu, 9 Mar 2017 10:40:40 -0800 (PST) Received: from localhost ([::1]:35767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm2zO-0002ZP-4k for importer@patchew.org; Thu, 09 Mar 2017 13:40:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm2yV-0002VN-5u for qemu-devel@nongnu.org; Thu, 09 Mar 2017 13:39:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cm2yU-0002hf-5B for qemu-devel@nongnu.org; Thu, 09 Mar 2017 13:39:43 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34509) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cm2yT-0002hX-RS for qemu-devel@nongnu.org; Thu, 09 Mar 2017 13:39:42 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v29IcbIi027559 for ; Thu, 9 Mar 2017 13:39:40 -0500 Received: from e24smtp02.br.ibm.com (e24smtp02.br.ibm.com [32.104.18.86]) by mx0a-001b2d01.pphosted.com with ESMTP id 2937t3y8fa-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 09 Mar 2017 13:39:40 -0500 Received: from localhost by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Mar 2017 15:39:36 -0300 Received: from d24relay03.br.ibm.com (9.18.232.225) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 9 Mar 2017 15:39:35 -0300 Received: from d24av05.br.ibm.com (d24av05.br.ibm.com [9.18.232.44]) by d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v29IdQQV34406624 for ; Thu, 9 Mar 2017 15:39:34 -0300 Received: from d24av05.br.ibm.com (localhost [127.0.0.1]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v29Id3Kd022537 for ; Thu, 9 Mar 2017 15:39:03 -0300 Received: from pacoca.ibm.com ([9.85.162.7]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v29IcuUl022203; Thu, 9 Mar 2017 15:39:01 -0300 From: Jose Ricardo Ziviani To: qemu-devel@nongnu.org Date: Thu, 9 Mar 2017 15:38:37 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489084718-15294-1-git-send-email-joserz@linux.vnet.ibm.com> References: <1489084718-15294-1-git-send-email-joserz@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17030918-0020-0000-0000-00000290657F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17030918-0021-0000-0000-000030AC78CD Message-Id: <1489084718-15294-3-git-send-email-joserz@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-09_15:, , 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-1702020001 definitions=main-1703090136 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 v2 2/3] configure: Add initial support to 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This commit set Makefile to point to ppc64le source for both archs (ppc64 and ppc64le) because they do the exact same thing. The difference is in risugen and how the binary is build. Signed-off-by: Jose Ricardo Ziviani --- configure | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 055e6d6..dd64d8b 100755 --- a/configure +++ b/configure @@ -51,11 +51,7 @@ guess_arch() { elif check_define __aarch64__ ; then ARCH=3D"aarch64" elif check_define __powerpc64__ ; then - if check_define __BIG_ENDIAN__; then - ARCH=3D"ppc64" - else - ARCH=3D"ppc64le" - fi + ARCH=3D"ppc64le" else echo "This cpu is not supported by risu. Try -h. " >&2 exit 1 @@ -127,6 +123,9 @@ OBJDUMP=3D"${OBJDUMP-${CROSS_PREFIX}objdump}" =20 if test "x${ARCH}" =3D "x"; then guess_arch +elif test "x${ARCH}" =3D "xppc64"; then + # ppc64 and ppc64le uses the same C source code + ARCH=3D"ppc64le" fi =20 generate_makefilein --=20 2.7.4 From nobody Thu Nov 6 15:13:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489084898997767.105224810685; Thu, 9 Mar 2017 10:41:38 -0800 (PST) Received: from localhost ([::1]:35774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm30L-0003NC-Er for importer@patchew.org; Thu, 09 Mar 2017 13:41:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm2yY-0002YG-UV for qemu-devel@nongnu.org; Thu, 09 Mar 2017 13:39:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cm2yV-0002i3-1N for qemu-devel@nongnu.org; Thu, 09 Mar 2017 13:39:47 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46144 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cm2yU-0002hw-RY for qemu-devel@nongnu.org; Thu, 09 Mar 2017 13:39:42 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v29IcaVL100183 for ; Thu, 9 Mar 2017 13:39:41 -0500 Received: from e24smtp03.br.ibm.com (e24smtp03.br.ibm.com [32.104.18.24]) by mx0b-001b2d01.pphosted.com with ESMTP id 2937yaxmbc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 09 Mar 2017 13:39:41 -0500 Received: from localhost by e24smtp03.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Mar 2017 15:39:39 -0300 Received: from d24relay04.br.ibm.com (9.18.232.146) by e24smtp03.br.ibm.com (10.172.0.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 9 Mar 2017 15:39:37 -0300 Received: from d24av05.br.ibm.com (d24av05.br.ibm.com [9.18.232.44]) by d24relay04.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v29IdTOq35520666 for ; Thu, 9 Mar 2017 15:39:37 -0300 Received: from d24av05.br.ibm.com (localhost [127.0.0.1]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v29Id58V022567 for ; Thu, 9 Mar 2017 15:39:06 -0300 Received: from pacoca.ibm.com ([9.85.162.7]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v29IcuUm022203; Thu, 9 Mar 2017 15:39:04 -0300 From: Jose Ricardo Ziviani To: qemu-devel@nongnu.org Date: Thu, 9 Mar 2017 15:38:38 -0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489084718-15294-1-git-send-email-joserz@linux.vnet.ibm.com> References: <1489084718-15294-1-git-send-email-joserz@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17030918-0024-0000-0000-0000015C6EE0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17030918-0025-0000-0000-000016227C96 Message-Id: <1489084718-15294-4-git-send-email-joserz@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-09_15:, , 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-1702020001 definitions=main-1703090136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH Risu v2 3/3] 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 =3D 0; my $fpscr =3D 0; my $fp_enabled =3D 1; + my $big_endian =3D 0; my ($infile, $outfile); =20 GetOptions( "help" =3D> sub { usage(); exit(0); }, @@ -287,6 +289,7 @@ sub main() die "Value \"$condprob\" invalid for option condpr= ob (must be between 0 and 1)\n"; } }, + "be" =3D> sub { $big_endian =3D 1; }, "no-fp" =3D> sub { $fp_enabled =3D 0; }, ) or return 1; # allow "--pattern re,re" and "--pattern re --pattern re" @@ -317,7 +320,8 @@ sub main() 'not_pattern_re' =3D> \@not_pattern_re, 'details' =3D> \%insn_details, 'arch' =3D> $full_arch[0], - 'subarch' =3D> $full_arch[1] || '' + 'subarch' =3D> $full_arch[1] || '', + 'bigendian' =3D> $big_endian ); =20 write_test_code(\%params); diff --git a/risugen_ppc64.pm b/risugen_ppc64.pm index 45f7220..0c030aa 100644 --- a/risugen_ppc64.pm +++ b/risugen_ppc64.pm @@ -373,6 +373,10 @@ sub write_test_code($) my @not_pattern_re =3D @{ $params->{ 'not_pattern_re' } }; my %insn_details =3D %{ $params->{ 'details' } }; =20 + if ($params->{ 'bigendian' } eq 1) { + set_endian(1); + } + open_bin($outfile); =20 # convert from probability that insn will be conditional to --=20 2.7.4