aboutsummaryrefslogtreecommitdiff
path: root/target-arm/op.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-05-13 22:45:23 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-05-13 22:45:23 +0000
commitff8263a951c5ce22bef919c792d20e5cbf5066b3 (patch)
tree1a1eef28450d113a8d054660fd5bbdeda62e00a3 /target-arm/op.c
parent04d81be884925127e2ebee994e4a89ce44eab06e (diff)
ARM saturating arithmetic fixes (Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1431 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-arm/op.c')
-rw-r--r--target-arm/op.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/target-arm/op.c b/target-arm/op.c
index 0a3811ed2f..8a82def79a 100644
--- a/target-arm/op.c
+++ b/target-arm/op.c
@@ -805,6 +805,23 @@ void OPPROTO op_subl_T0_T1_saturate(void)
FORCE_RET();
}
+void OPPROTO op_double_T1_saturate(void)
+{
+ int32_t val;
+
+ val = T1;
+ if (val >= 0x40000000) {
+ T1 = 0x7fffffff;
+ env->QF = 1;
+ } else if (val <= (int32_t)0xc0000000) {
+ T1 = 0x80000000;
+ env->QF = 1;
+ } else {
+ T1 = val << 1;
+ }
+ FORCE_RET();
+}
+
/* thumb shift by immediate */
void OPPROTO op_shll_T0_im_thumb(void)
{