英雄虎胆潘定彪:eieio,sync,isync区别

来源:百度文库 编辑:中财网 时间:2024/04/29 06:21:02

eieio,sync,isync区别

2011-09-25 16:41 97人阅读 评论(0) 收藏 举报

官方英文解释:

The eieio, sync and isync are context-synchronizing instructions. Term “context-synchronizing” means the following: the processor core consists of several independent execution units, so it is able to execute several instructions in parallel and out-of-order. The context-synchronizing instructions are used to force strict order of instructions, where required. eieio means "Enforce In-Order execution of I/O". During execution, Load/Store Unit waits for previous accesses to terminate before beginning accesses associated with load/store instructions after eieio. The purpose of eieio is to prevent loads and stores from executing speculatively when appropriate. This might be desirable for FIFO, where performing a read or write changes the FIFO's data. isync means "Instruction sync". This instruction waits for all instructions to complete and discards any prefetched instructions, causing subsequent instructions to be refetched from memory. The isync instruction is context synchronizing, which guarantees that all of effects of previous instructions are in place and any instructions in the instruction queue are flushed (which means all instructions that were in the instruction queue need to be refetched). sync is a memory synchronization instruction. It delays execution of subsequent instructions until previous instructions have completed to the point that they can no longer cause an exception and until all previous memory accesses are performed globally; the sync operation is not broadcast onto the bus interface. Additionally, all load and store cache/bus activities initiated by prior instructions are completed.

翻译:

eieio, sync 和isync 是上下文同步指令。“上下文同步”指的是:处理器内核包含着多个独立的执行单元,所以它能够并行的执行多个指令并且是乱序的。上下文同步指令用于需要严格秩序的地方,进行强制严格的指令顺序。eieio代表“强制按顺序执行IO”。在执行过程中,加载/存储单元等待前一个访问结束之后再开始运行加载/存储指令。eieio的目的就是为了防止执行过程中的随意加载和存储。在执行FIFO数据的读写变化时这可能是可取的。isync代表“指令同步”。这个指令等待所有的指令完成并放弃预读取指令,导致后续的指令需要从内存中重新读取。isync是上下文同步,它保证所有先前指令都到位并且刷新指令序列(这意味着指令序列中的所有指令需要被重新读取)。sync代表着内存同步指令。它延迟所有后续指令的执行直到先前指令完成,并且不会再产生异常以及直到先前的内存访问完全执行完毕;sync操作不会广播到总线接口。此外,先前指令发起的所有加载和存储高速缓存/总线活动完成。