summary refs log tree commit diff stats
path: root/target/hppa/op_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2017-10-09 07:44:30 -0700
committerRichard Henderson <richard.henderson@linaro.org>2018-01-30 10:08:18 -0800
commite1b5a5ed6f817515e9328561ad0230f8a7af440a (patch)
tree59fcafd11c08dfa33e12c40ecb274b9cfeb67329 /target/hppa/op_helper.c
parent3d68ee7bbe34278d5792f5341ba0246069c6191c (diff)
downloadfocaccia-qemu-e1b5a5ed6f817515e9328561ad0230f8a7af440a.tar.gz
focaccia-qemu-e1b5a5ed6f817515e9328561ad0230f8a7af440a.zip
target/hppa: Implement the system mask instructions
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/hppa/op_helper.c')
-rw-r--r--target/hppa/op_helper.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c
index 4ab4ee8a77..1d56ba497b 100644
--- a/target/hppa/op_helper.c
+++ b/target/hppa/op_helper.c
@@ -601,3 +601,17 @@ float64 HELPER(fmpynfadd_d)(CPUHPPAState *env, float64 a, float64 b, float64 c)
     update_fr0_op(env, GETPC());
     return ret;
 }
+
+#ifndef CONFIG_USER_ONLY
+target_ureg HELPER(swap_system_mask)(CPUHPPAState *env, target_ureg nsm)
+{
+    target_ulong psw = env->psw;
+    /* ??? On second reading this condition simply seems
+       to be undefined rather than a diagnosed trap.  */
+    if (nsm & ~psw & PSW_Q) {
+        dynexcp(env, EXCP_ILL, GETPC());
+    }
+    env->psw = (psw & ~PSW_SM) | (nsm & PSW_SM);
+    return psw & PSW_SM;
+}
+#endif