aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/translate.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2017-06-01 00:01:23 +0200
committerRichard Henderson <rth@twiddle.net>2017-06-06 15:20:43 -0700
commit4e256bef6552ee0b4c0c844077b44e4c7fcc05fc (patch)
tree51f585b2b27cdcf344c47fc091f9b8952705e5bf /target/s390x/translate.c
parent3bd3d6d302bd5a86a103a228b6d708025db4dcc2 (diff)
downloadqemu-4e256bef6552ee0b4c0c844077b44e4c7fcc05fc.zip
qemu-4e256bef6552ee0b4c0c844077b44e4c7fcc05fc.tar.gz
qemu-4e256bef6552ee0b4c0c844077b44e4c7fcc05fc.tar.bz2
target/s390x: implement PACK UNICODE
Use a common helper with PACK ASCII as the differences are limited to the stride of the source operand. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Message-Id: <20170531220129.27724-25-aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target/s390x/translate.c')
-rw-r--r--target/s390x/translate.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index 4939311..7e01c40 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -3315,6 +3315,22 @@ static ExitStatus op_pka(DisasContext *s, DisasOps *o)
return NO_EXIT;
}
+static ExitStatus op_pku(DisasContext *s, DisasOps *o)
+{
+ int l2 = get_field(s->fields, l2) + 1;
+ TCGv_i32 l;
+
+ /* The length must be even and should not exceed 64 bytes. */
+ if ((l2 & 1) || (l2 > 64)) {
+ gen_program_exception(s, PGM_SPECIFICATION);
+ return EXIT_NORETURN;
+ }
+ l = tcg_const_i32(l2);
+ gen_helper_pku(cpu_env, o->addr1, o->in2, l);
+ tcg_temp_free_i32(l);
+ return NO_EXIT;
+}
+
static ExitStatus op_popcnt(DisasContext *s, DisasOps *o)
{
gen_helper_popcnt(o->out, o->in2);