summaryrefslogtreecommitdiffstats
path: root/target-ppc/int_helper.c
diff options
context:
space:
mode:
authorAurelien Jarno2013-04-20 10:56:16 +0200
committerAlexander Graf2013-04-26 23:02:42 +0200
commitfcfda20f2f5df30d88d087d443c1c08649df8827 (patch)
tree6e26b28a40150f21c7fb3ed62e967b7a5fbaea5d /target-ppc/int_helper.c
parenttarget-ppc: add instruction flags for Book I 2.05 (diff)
downloadqemu-fcfda20f2f5df30d88d087d443c1c08649df8827.tar.gz
qemu-fcfda20f2f5df30d88d087d443c1c08649df8827.tar.xz
qemu-fcfda20f2f5df30d88d087d443c1c08649df8827.zip
target-ppc: emulate cmpb instruction
Needed for Power ISA version 2.05 compliance. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-ppc/int_helper.c')
-rw-r--r--target-ppc/int_helper.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c
index 54eca9bbee..e50bdd20ec 100644
--- a/target-ppc/int_helper.c
+++ b/target-ppc/int_helper.c
@@ -53,6 +53,21 @@ target_ulong helper_cntlzd(target_ulong t)
}
#endif
+target_ulong helper_cmpb(target_ulong rs, target_ulong rb)
+{
+ target_ulong mask = 0xff;
+ target_ulong ra = 0;
+ int i;
+
+ for (i = 0; i < sizeof(target_ulong); i++) {
+ if ((rs & mask) == (rb & mask)) {
+ ra |= mask;
+ }
+ mask <<= 8;
+ }
+ return ra;
+}
+
/* shift right arithmetic helper */
target_ulong helper_sraw(CPUPPCState *env, target_ulong value,
target_ulong shift)