Skip to contentSkip to conversation

[5830] target-ppc: convert load/store with reservation instructions to TCG

Qemu-devel Aurelien Jarno 1 participant 1 message Nov 30, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5830

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5830
Author:   aurel32
Date:     2008-11-30 16:24:39 +0000 (Sun, 30 Nov 2008)

Log Message:
-----------
target-ppc: convert load/store with reservation instructions to TCG

Modified Paths:
--------------
trunk/target-ppc/op_mem.h
trunk/target-ppc/translate.c

Modified: trunk/target-ppc/op_mem.h
===================================================================

target-ppc/op_mem.h +0 -226
@@ -20,232 +20,6 @@
 
 #include "op_mem_access.h"
 
-/* Load and set reservation */
-void OPPROTO glue(op_lwarx, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        T1 = glue(ldu32, MEMSUFFIX)((uint32_t)T0);
-        env->reserve = (uint32_t)T0;
-    }
-    RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO glue(op_lwarx_64, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        T1 = glue(ldu32, MEMSUFFIX)((uint64_t)T0);
-        env->reserve = (uint64_t)T0;
-    }
-    RETURN();
-}
-
-void OPPROTO glue(op_ldarx, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        T1 = glue(ldu64, MEMSUFFIX)((uint32_t)T0);
-        env->reserve = (uint32_t)T0;
-    }
-    RETURN();
-}
-
-void OPPROTO glue(op_ldarx_64, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        T1 = glue(ldu64, MEMSUFFIX)((uint64_t)T0);
-        env->reserve = (uint64_t)T0;
-    }
-    RETURN();
-}
-#endif
-
-void OPPROTO glue(op_lwarx_le, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        T1 = glue(ldu32r, MEMSUFFIX)((uint32_t)T0);
-        env->reserve = (uint32_t)T0;
-    }
-    RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO glue(op_lwarx_le_64, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        T1 = glue(ldu32r, MEMSUFFIX)((uint64_t)T0);
-        env->reserve = (uint64_t)T0;
-    }
-    RETURN();
-}
-
-void OPPROTO glue(op_ldarx_le, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        T1 = glue(ldu64r, MEMSUFFIX)((uint32_t)T0);
-        env->reserve = (uint32_t)T0;
-    }
-    RETURN();
-}
-
-void OPPROTO glue(op_ldarx_le_64, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        T1 = glue(ldu64r, MEMSUFFIX)((uint64_t)T0);
-        env->reserve = (uint64_t)T0;
-    }
-    RETURN();
-}
-#endif
-
-/* Store with reservation */
-void OPPROTO glue(op_stwcx, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        if (unlikely(env->reserve != (uint32_t)T0)) {
-            env->crf[0] = xer_so;
-        } else {
-            glue(st32, MEMSUFFIX)((uint32_t)T0, T1);
-            env->crf[0] = xer_so | 0x02;
-        }
-    }
-    env->reserve = (target_ulong)-1ULL;
-    RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO glue(op_stwcx_64, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        if (unlikely(env->reserve != (uint64_t)T0)) {
-            env->crf[0] = xer_so;
-        } else {
-            glue(st32, MEMSUFFIX)((uint64_t)T0, T1);
-            env->crf[0] = xer_so | 0x02;
-        }
-    }
-    env->reserve = (target_ulong)-1ULL;
-    RETURN();
-}
-
-void OPPROTO glue(op_stdcx, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        if (unlikely(env->reserve != (uint32_t)T0)) {
-            env->crf[0] = xer_so;
-        } else {
-            glue(st64, MEMSUFFIX)((uint32_t)T0, T1);
-            env->crf[0] = xer_so | 0x02;
-        }
-    }
-    env->reserve = (target_ulong)-1ULL;
-    RETURN();
-}
-
-void OPPROTO glue(op_stdcx_64, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        if (unlikely(env->reserve != (uint64_t)T0)) {
-            env->crf[0] = xer_so;
-        } else {
-            glue(st64, MEMSUFFIX)((uint64_t)T0, T1);
-            env->crf[0] = xer_so | 0x02;
-        }
-    }
-    env->reserve = (target_ulong)-1ULL;
-    RETURN();
-}
-#endif
-
-void OPPROTO glue(op_stwcx_le, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        if (unlikely(env->reserve != (uint32_t)T0)) {
-            env->crf[0] = xer_so;
-        } else {
-            glue(st32r, MEMSUFFIX)((uint32_t)T0, T1);
-            env->crf[0] = xer_so | 0x02;
-        }
-    }
-    env->reserve = (target_ulong)-1ULL;
-    RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO glue(op_stwcx_le_64, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        if (unlikely(env->reserve != (uint64_t)T0)) {
-            env->crf[0] = xer_so;
-        } else {
-            glue(st32r, MEMSUFFIX)((uint64_t)T0, T1);
-            env->crf[0] = xer_so | 0x02;
-        }
-    }
-    env->reserve = (target_ulong)-1ULL;
-    RETURN();
-}
-
-void OPPROTO glue(op_stdcx_le, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        if (unlikely(env->reserve != (uint32_t)T0)) {
-            env->crf[0] = xer_so;
-        } else {
-            glue(st64r, MEMSUFFIX)((uint32_t)T0, T1);
-            env->crf[0] = xer_so | 0x02;
-        }
-    }
-    env->reserve = (target_ulong)-1ULL;
-    RETURN();
-}
-
-void OPPROTO glue(op_stdcx_le_64, MEMSUFFIX) (void)
-{
-    if (unlikely(T0 & 0x03)) {
-        raise_exception(env, POWERPC_EXCP_ALIGN);
-    } else {
-        if (unlikely(env->reserve != (uint64_t)T0)) {
-            env->crf[0] = xer_so;
-        } else {
-            glue(st64r, MEMSUFFIX)((uint64_t)T0, T1);
-            env->crf[0] = xer_so | 0x02;
-        }
-    }
-    env->reserve = (target_ulong)-1ULL;
-    RETURN();
-}
-#endif
-
 /* External access */
 void OPPROTO glue(op_eciwx, MEMSUFFIX) (void)
 {

Modified: trunk/target-ppc/translate.c
===================================================================

target-ppc/translate.c +72 -38

157 lines not on this page · raw message