aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op_mem.h
diff options
context:
space:
mode:
Diffstat (limited to 'target-ppc/op_mem.h')
-rw-r--r--target-ppc/op_mem.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/target-ppc/op_mem.h b/target-ppc/op_mem.h
index f080abc413..a78aa62c48 100644
--- a/target-ppc/op_mem.h
+++ b/target-ppc/op_mem.h
@@ -534,6 +534,17 @@ void OPPROTO glue(op_lwarx_64, MEMSUFFIX) (void)
RETURN();
}
+void OPPROTO glue(op_ldarx, MEMSUFFIX) (void)
+{
+ if (unlikely(T0 & 0x03)) {
+ do_raise_exception(EXCP_ALIGN);
+ } else {
+ T1 = glue(ldq, MEMSUFFIX)((uint32_t)T0);
+ regs->reserve = (uint32_t)T0;
+ }
+ RETURN();
+}
+
void OPPROTO glue(op_ldarx_64, MEMSUFFIX) (void)
{
if (unlikely(T0 & 0x03)) {
@@ -569,6 +580,17 @@ void OPPROTO glue(op_lwarx_le_64, MEMSUFFIX) (void)
RETURN();
}
+void OPPROTO glue(op_ldarx_le, MEMSUFFIX) (void)
+{
+ if (unlikely(T0 & 0x03)) {
+ do_raise_exception(EXCP_ALIGN);
+ } else {
+ T1 = glue(ld64r, MEMSUFFIX)((uint32_t)T0);
+ regs->reserve = (uint32_t)T0;
+ }
+ RETURN();
+}
+
void OPPROTO glue(op_ldarx_le_64, MEMSUFFIX) (void)
{
if (unlikely(T0 & 0x03)) {
@@ -615,6 +637,22 @@ void OPPROTO glue(op_stwcx_64, MEMSUFFIX) (void)
RETURN();
}
+void OPPROTO glue(op_stdcx, MEMSUFFIX) (void)
+{
+ if (unlikely(T0 & 0x03)) {
+ do_raise_exception(EXCP_ALIGN);
+ } else {
+ if (unlikely(regs->reserve != (uint32_t)T0)) {
+ env->crf[0] = xer_ov;
+ } else {
+ glue(stq, MEMSUFFIX)((uint32_t)T0, T1);
+ env->crf[0] = xer_ov | 0x02;
+ }
+ }
+ regs->reserve = -1;
+ RETURN();
+}
+
void OPPROTO glue(op_stdcx_64, MEMSUFFIX) (void)
{
if (unlikely(T0 & 0x03)) {
@@ -665,6 +703,22 @@ void OPPROTO glue(op_stwcx_le_64, MEMSUFFIX) (void)
RETURN();
}
+void OPPROTO glue(op_stdcx_le, MEMSUFFIX) (void)
+{
+ if (unlikely(T0 & 0x03)) {
+ do_raise_exception(EXCP_ALIGN);
+ } else {
+ if (unlikely(regs->reserve != (uint32_t)T0)) {
+ env->crf[0] = xer_ov;
+ } else {
+ glue(st64r, MEMSUFFIX)((uint32_t)T0, T1);
+ env->crf[0] = xer_ov | 0x02;
+ }
+ }
+ regs->reserve = -1;
+ RETURN();
+}
+
void OPPROTO glue(op_stdcx_le_64, MEMSUFFIX) (void)
{
if (unlikely(T0 & 0x03)) {