From c9172abe6caa5037d1774e03c351474934acf98c Mon Sep 17 00:00:00 2001 From: Merry Date: Sun, 13 Mar 2022 01:52:06 +0000 Subject: [PATCH] 32 --- ARMeilleure/Instructions/InstEmitMemoryEx32.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ARMeilleure/Instructions/InstEmitMemoryEx32.cs b/ARMeilleure/Instructions/InstEmitMemoryEx32.cs index 9a9787cfb..c2326cde7 100644 --- a/ARMeilleure/Instructions/InstEmitMemoryEx32.cs +++ b/ARMeilleure/Instructions/InstEmitMemoryEx32.cs @@ -146,13 +146,13 @@ namespace ARMeilleure.Instructions var exclusive = (accType & AccessType.Exclusive) != 0; var ordered = (accType & AccessType.Ordered) != 0; - if (ordered) - { - EmitBarrier(context); - } - if ((accType & AccessType.Load) != 0) { + if (ordered) + { + EmitBarrier(context); + } + if (size == DWordSizeLog2) { // Keep loads atomic - make the call to get the whole region and then decompose it into parts @@ -219,6 +219,11 @@ namespace ARMeilleure.Instructions Operand value = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rt)); EmitStoreExclusive(context, address, value, exclusive, size, op.Rd, a32: true); } + + if (ordered) + { + EmitBarrier(context); + } } }