From: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, nikunj@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH Risu v3 1/4] risugen_ppc64: Load random 128-bit data to vector registers
Date: Thu, 25 May 2017 16:10:20 -0300 [thread overview]
Message-ID: <1495739423-32326-2-git-send-email-joserz@linux.vnet.ibm.com> (raw)
In-Reply-To: <1495739423-32326-1-git-send-email-joserz@linux.vnet.ibm.com>
Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
---
risugen_ppc64.pm | 42 +++++++++++++++++++++++++++++++-----------
1 file changed, 31 insertions(+), 11 deletions(-)
diff --git a/risugen_ppc64.pm b/risugen_ppc64.pm
index 341478c..1a3cd59 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);
}
+sub write_mov_ri128($$$$)
+{
+ my ($imhh, $imh, $iml, $imll) = @_;
+
+ # 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 = 0; $i < 32; $i++) {
@@ -106,22 +129,18 @@ 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);
-
}
}
-sub write_random_ppc64_fpdata_i()
+sub write_random_ppc64_vrdata()
{
- # 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 = 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(0xfffff));
+ # li r0, 16
+ write_mov_ri16(0, 0x10);
+ # lvx vr$i, r1, r0
+ insn32((0x1f << 26) | ($i << 21) | (0x1 << 16) | 0x2ce);
}
}
@@ -172,6 +191,7 @@ sub write_random_register_data($)
clear_vr_registers();
+ write_random_ppc64_vrdata();
if ($fp_enabled) {
# load floating point / SIMD registers
write_random_ppc64_fpdata();
--
2.7.4
next prev parent reply other threads:[~2017-05-25 19:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-25 19:10 [Qemu-devel] [PATCH Risu v3 0/4] PPC64 Improvements Jose Ricardo Ziviani
2017-05-25 19:10 ` Jose Ricardo Ziviani [this message]
2017-05-25 19:10 ` [Qemu-devel] [PATCH Risu v3 2/4] configure: Add initial support to PPC64 (big endian) Jose Ricardo Ziviani
2017-05-25 19:10 ` [Qemu-devel] [PATCH Risu v3 3/4] risugen, risugen_ppc64.pm: Add support ppc64 (big-endian) Jose Ricardo Ziviani
2017-05-25 19:10 ` [Qemu-devel] [PATCH Risu v3 4/4] build: Add support to PowerPC BE and remove ARCH Jose Ricardo Ziviani
2017-05-30 14:27 ` Peter Maydell
2017-05-30 18:55 ` joserz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1495739423-32326-2-git-send-email-joserz@linux.vnet.ibm.com \
--to=joserz@linux.vnet.ibm.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).