aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-01 00:54:12 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-01 00:54:12 +0000
commit74637406444c9276ecc26de970ff9018fbfc8735 (patch)
tree94eb01e5fed7c0e8b2a2ec8f0cabc56476169f99 /target-ppc/op.c
parent8d71247eaad960d062d34c882e7af7391f74de81 (diff)
target-ppc: convert arithmetic functions to TCG
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5590 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op.c')
-rw-r--r--target-ppc/op.c398
1 files changed, 0 insertions, 398 deletions
diff --git a/target-ppc/op.c b/target-ppc/op.c
index bcdb11d003..2453300e3a 100644
--- a/target-ppc/op.c
+++ b/target-ppc/op.c
@@ -354,404 +354,6 @@ void OPPROTO op_check_addo_64 (void)
}
#endif
-/* add carrying */
-void OPPROTO op_check_addc (void)
-{
- if (likely((uint32_t)T0 >= (uint32_t)T2)) {
- env->xer &= ~(1 << XER_CA);
- } else {
- env->xer |= (1 << XER_CA);
- }
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_check_addc_64 (void)
-{
- if (likely((uint64_t)T0 >= (uint64_t)T2)) {
- env->xer &= ~(1 << XER_CA);
- } else {
- env->xer |= (1 << XER_CA);
- }
- RETURN();
-}
-#endif
-
-/* add extended */
-void OPPROTO op_adde (void)
-{
- do_adde();
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_adde_64 (void)
-{
- do_adde_64();
- RETURN();
-}
-#endif
-
-/* add to minus one extended */
-void OPPROTO op_add_me (void)
-{
- T0 += xer_ca + (-1);
- if (likely((uint32_t)T1 != 0))
- env->xer |= (1 << XER_CA);
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_add_me_64 (void)
-{
- T0 += xer_ca + (-1);
- if (likely((uint64_t)T1 != 0))
- env->xer |= (1 << XER_CA);
- RETURN();
-}
-#endif
-
-void OPPROTO op_addmeo (void)
-{
- do_addmeo();
- RETURN();
-}
-
-void OPPROTO op_addmeo_64 (void)
-{
- do_addmeo();
- RETURN();
-}
-
-/* add to zero extended */
-void OPPROTO op_add_ze (void)
-{
- T0 += xer_ca;
- RETURN();
-}
-
-/* divide word */
-void OPPROTO op_divw (void)
-{
- if (unlikely(((int32_t)T0 == INT32_MIN && (int32_t)T1 == (int32_t)-1) ||
- (int32_t)T1 == 0)) {
- T0 = (int32_t)(UINT32_MAX * ((uint32_t)T0 >> 31));
- } else {
- T0 = (int32_t)T0 / (int32_t)T1;
- }
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_divd (void)
-{
- if (unlikely(((int64_t)T0 == INT64_MIN && (int64_t)T1 == (int64_t)-1LL) ||
- (int64_t)T1 == 0)) {
- T0 = (int64_t)(UINT64_MAX * ((uint64_t)T0 >> 63));
- } else {
- T0 = (int64_t)T0 / (int64_t)T1;
- }
- RETURN();
-}
-#endif
-
-void OPPROTO op_divwo (void)
-{
- do_divwo();
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_divdo (void)
-{
- do_divdo();
- RETURN();
-}
-#endif
-
-/* divide word unsigned */
-void OPPROTO op_divwu (void)
-{
- if (unlikely(T1 == 0)) {
- T0 = 0;
- } else {
- T0 = (uint32_t)T0 / (uint32_t)T1;
- }
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_divdu (void)
-{
- if (unlikely(T1 == 0)) {
- T0 = 0;
- } else {
- T0 /= T1;
- }
- RETURN();
-}
-#endif
-
-void OPPROTO op_divwuo (void)
-{
- do_divwuo();
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_divduo (void)
-{
- do_divduo();
- RETURN();
-}
-#endif
-
-/* multiply high word */
-void OPPROTO op_mulhw (void)
-{
- T0 = ((int64_t)((int32_t)T0) * (int64_t)((int32_t)T1)) >> 32;
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_mulhd (void)
-{
- uint64_t tl, th;
-
- muls64(&tl, &th, T0, T1);
- T0 = th;
- RETURN();
-}
-#endif
-
-/* multiply high word unsigned */
-void OPPROTO op_mulhwu (void)
-{
- T0 = ((uint64_t)(uint32_t)T0 * (uint64_t)(uint32_t)T1) >> 32;
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_mulhdu (void)
-{
- uint64_t tl, th;
-
- mulu64(&tl, &th, T0, T1);
- T0 = th;
- RETURN();
-}
-#endif
-
-/* multiply low immediate */
-void OPPROTO op_mulli (void)
-{
- T0 = ((int32_t)T0 * (int32_t)PARAM1);
- RETURN();
-}
-
-/* multiply low word */
-void OPPROTO op_mullw (void)
-{
-#if defined(TARGET_PPC64)
- T0 = (int64_t)(int32_t)T0 * (int64_t)(int32_t)T1;
-#else
- T0 = (int32_t)(T0 * T1);
-#endif
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_mulld (void)
-{
- T0 *= T1;
- RETURN();
-}
-#endif
-
-void OPPROTO op_mullwo (void)
-{
- do_mullwo();
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_mulldo (void)
-{
- do_mulldo();
- RETURN();
-}
-#endif
-
-/* negate */
-void OPPROTO op_neg (void)
-{
- if (likely(T0 != INT32_MIN)) {
- T0 = -(int32_t)T0;
- }
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_neg_64 (void)
-{
- if (likely(T0 != INT64_MIN)) {
- T0 = -(int64_t)T0;
- }
- RETURN();
-}
-#endif
-
-void OPPROTO op_nego (void)
-{
- do_nego();
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_nego_64 (void)
-{
- do_nego_64();
- RETURN();
-}
-#endif
-
-/* subtract from carrying */
-void OPPROTO op_check_subfc (void)
-{
- if (likely((uint32_t)T0 > (uint32_t)T1)) {
- env->xer &= ~(1 << XER_CA);
- } else {
- env->xer |= (1 << XER_CA);
- }
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_check_subfc_64 (void)
-{
- if (likely((uint64_t)T0 > (uint64_t)T1)) {
- env->xer &= ~(1 << XER_CA);
- } else {
- env->xer |= (1 << XER_CA);
- }
- RETURN();
-}
-#endif
-
-/* subtract from extended */
-void OPPROTO op_subfe (void)
-{
- do_subfe();
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_subfe_64 (void)
-{
- do_subfe_64();
- RETURN();
-}
-#endif
-
-/* subtract from immediate carrying */
-void OPPROTO op_subfic (void)
-{
- T0 = (int32_t)PARAM1 + ~T0 + 1;
- if ((uint32_t)T0 <= (uint32_t)PARAM1) {
- env->xer |= (1 << XER_CA);
- } else {
- env->xer &= ~(1 << XER_CA);
- }
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_subfic_64 (void)
-{
- T0 = (int64_t)PARAM1 + ~T0 + 1;
- if ((uint64_t)T0 <= (uint64_t)PARAM1) {
- env->xer |= (1 << XER_CA);
- } else {
- env->xer &= ~(1 << XER_CA);
- }
- RETURN();
-}
-#endif
-
-/* subtract from minus one extended */
-void OPPROTO op_subfme (void)
-{
- T0 = ~T0 + xer_ca - 1;
- if (likely((uint32_t)T0 != UINT32_MAX))
- env->xer |= (1 << XER_CA);
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_subfme_64 (void)
-{
- T0 = ~T0 + xer_ca - 1;
- if (likely((uint64_t)T0 != UINT64_MAX))
- env->xer |= (1 << XER_CA);
- RETURN();
-}
-#endif
-
-void OPPROTO op_subfmeo (void)
-{
- do_subfmeo();
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_subfmeo_64 (void)
-{
- do_subfmeo_64();
- RETURN();
-}
-#endif
-
-/* subtract from zero extended */
-void OPPROTO op_subfze (void)
-{
- T1 = ~T0;
- T0 = T1 + xer_ca;
- if ((uint32_t)T0 < (uint32_t)T1) {
- env->xer |= (1 << XER_CA);
- } else {
- env->xer &= ~(1 << XER_CA);
- }
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_subfze_64 (void)
-{
- T1 = ~T0;
- T0 = T1 + xer_ca;
- if ((uint64_t)T0 < (uint64_t)T1) {
- env->xer |= (1 << XER_CA);
- } else {
- env->xer &= ~(1 << XER_CA);
- }
- RETURN();
-}
-#endif
-
-void OPPROTO op_subfzeo (void)
-{
- do_subfzeo();
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO op_subfzeo_64 (void)
-{
- do_subfzeo_64();
- RETURN();
-}
-#endif
-
/*** Integer shift ***/
void OPPROTO op_srli_T1 (void)
{