EasyManua.ls Logo

Mips Technologies R4000 - Page 629

Mips Technologies R4000
754 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MIPS R4000 Microprocessor User's Manual A-161
CPU Instruction Set Details
Format:
SYNC
Description:
The SYNC instruction ensures that any loads and stores fetched prior to the
present instruction are completed before any loads or stores after this
instruction are allowed to start. Use of the SYNC instruction to serialize
certain memory references may be required in a multiprocessor
environment for proper synchronization. For example:
The SYNC in processor A prevents DATA being written after FLAG,
which could cause processor B to read stale data. The SYNC in processor
B prevents DATA from being read before FLAG, which could likewise
result in reading stale data. For processors which only execute loads and
stores in order, with respect to shared memory, this instruction is a NOP.
LL and SC instructions implicitly perform a SYNC.
This instruction is allowed in User mode.
Operation:
Exceptions:
None
SYNC
Synchronize
31 2526
SPECIAL
620
0
SYNC
6
65 0
0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 1 1
SYNC
Processor A Processor B
SW R1, DATA 1: LW R2, FLAG
LI R2, 1 BEQ R2, R0, 1B
SYNC NOP
SW R2, FLAG SYNC
LW R1, DATA
32, 64 T: SyncOperation()

Table of Contents