
MOTOROLA
Chapter 7. Instruction Timing
7-23
Instruction Scheduling Guidelines
7.5.2
Write-Through Mode
Store operations to memory in write-through mode always update memory as well as the
on-chip cache (on cache hits). Write-through mode is used when the data in the cache must
always agree with external memory (for example, video memory), when shared (global)
data may be used frequently, or when allocation of a cache line on a cache miss is
undesirable. Automatic copy back of cached data is not performed if that data is from a
memory page marked as write-through mode because valid cache data always agrees with
memory.
Stores to memory that are in write-through mode may cause a decrease in performance.
Each time a store is performed to memory in write-through mode, the bus is potentially
busy for the extra clock cycles required to update memory; therefore, load operations that
miss the on-chip cache must wait while the external store operation completes.
7.5.3
Cache-Inhibited Accesses
Data for a page marked cache-inhibited cannot be stored in the on-chip cache.
Areas of the memory map can be cache-inhibited by the operating system. If a
cache-inhibited access hits in the on-chip cache, the corresponding cache line is
invalidated. If the line is marked modified, it is copied back to memory before being
invalidated.
In summary, the copy-back mode allows both load and store operations to use the on-chip
cache. The write-through mode allows load operations to use the on-chip cache, but store
operations cause a memory access and a cache update if the data is already in the cache.
Lastly, the cache-inhibited mode causes memory access for both loads and stores.
7.6
Instruction Scheduling Guidelines
The performance of the G2 core can be improved by avoiding resource conflicts and
promoting parallel utilization of execution units through efficient instruction scheduling.
Instruction scheduling on the G2 core can be improved by observing the following
guidelines:
Implement good static branch prediction (setting of y bit in BO field).
When branch prediction is uncertain, or an even probability, predict fall through.
To reduce mispredictions, separate the instruction that sets CR bits from the branch
instruction that evaluates them; separation by more than nine instructions ensures
that the CR bits will be immediately available for evaluation.
When branching conditionally to a location specified by count registers (CTRs) or
link registers (LRs), or when branching conditionally based on the value in the count
register, separate the
mtspr
instruction that initializes the CTR or LR from the
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.