diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-03-19 00:00:28 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-03-19 00:00:28 +0000 |
commit | dc99065b5f97cc0410f88e3f90c7440531a55f9f (patch) | |
tree | a0566030175ea990f8aeeec662b3fa2e6b704bcf /ops_template.h | |
parent | ca735206e0f223d75894260fb98c0c605f590817 (diff) |
added flags computation optimization
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@34 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'ops_template.h')
-rw-r--r-- | ops_template.h | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/ops_template.h b/ops_template.h index 8905d90846..f8cd5e54ca 100644 --- a/ops_template.h +++ b/ops_template.h @@ -385,7 +385,6 @@ void OPPROTO glue(op_setle_T0_sub, SUFFIX)(void) void OPPROTO glue(glue(op_rol, SUFFIX), _T0_T1_cc)(void) { int count, src; - /* XXX: testing */ count = T1 & SHIFT_MASK; if (count) { CC_SRC = cc_table[CC_OP].compute_all() & ~(CC_O | CC_C); @@ -399,6 +398,17 @@ void OPPROTO glue(glue(op_rol, SUFFIX), _T0_T1_cc)(void) FORCE_RET(); } +void OPPROTO glue(glue(op_rol, SUFFIX), _T0_T1)(void) +{ + int count; + count = T1 & SHIFT_MASK; + if (count) { + T0 &= DATA_MASK; + T0 = (T0 << count) | (T0 >> (DATA_BITS - count)); + } + FORCE_RET(); +} + void OPPROTO glue(glue(op_ror, SUFFIX), _T0_T1_cc)(void) { int count, src; @@ -415,6 +425,17 @@ void OPPROTO glue(glue(op_ror, SUFFIX), _T0_T1_cc)(void) FORCE_RET(); } +void OPPROTO glue(glue(op_ror, SUFFIX), _T0_T1)(void) +{ + int count; + count = T1 & SHIFT_MASK; + if (count) { + T0 &= DATA_MASK; + T0 = (T0 >> count) | (T0 << (DATA_BITS - count)); + } + FORCE_RET(); +} + void OPPROTO glue(glue(op_rcl, SUFFIX), _T0_T1_cc)(void) { int count, res, eflags; @@ -482,6 +503,14 @@ void OPPROTO glue(glue(op_shl, SUFFIX), _T0_T1_cc)(void) FORCE_RET(); } +void OPPROTO glue(glue(op_shl, SUFFIX), _T0_T1)(void) +{ + int count; + count = T1 & 0x1f; + T0 = T0 << count; + FORCE_RET(); +} + void OPPROTO glue(glue(op_shr, SUFFIX), _T0_T1_cc)(void) { int count; @@ -496,6 +525,15 @@ void OPPROTO glue(glue(op_shr, SUFFIX), _T0_T1_cc)(void) FORCE_RET(); } +void OPPROTO glue(glue(op_shr, SUFFIX), _T0_T1)(void) +{ + int count; + count = T1 & 0x1f; + T0 &= DATA_MASK; + T0 = T0 >> count; + FORCE_RET(); +} + void OPPROTO glue(glue(op_sar, SUFFIX), _T0_T1_cc)(void) { int count, src; @@ -510,6 +548,15 @@ void OPPROTO glue(glue(op_sar, SUFFIX), _T0_T1_cc)(void) FORCE_RET(); } +void OPPROTO glue(glue(op_sar, SUFFIX), _T0_T1)(void) +{ + int count, src; + count = T1 & 0x1f; + src = (DATA_STYPE)T0; + T0 = src >> count; + FORCE_RET(); +} + #if DATA_BITS == 16 /* XXX: overflow flag might be incorrect in some cases in shldw */ void OPPROTO glue(glue(op_shld, SUFFIX), _T0_T1_im_cc)(void) |