
8-10
PowerPC Microprocessor Family: The Bus Interface for 32-Bit microprocessors
small amount of unnecessary snoop operations is sent up the memory hierarchy to the
processor assumed to be holding the reservation and a small amount of system bus
bandwidth is lost to unnecessary retries.
8.8.2.3 lwarx/stwcx. Address-Only Operation
An
lwarx/stwcx.
address-only operation should meet several criteria. Most importantly, it
should not cause abnormal system behavior in systems designed around the 601 and only
sampling TT[0–4]. For this reason they have been mapped to operations such as clean block
and flush block that are innocuous from a system perspective. This yields the TT[0–4]
encodings shown in Table 8-2.
8.8.2.4 Software Implications
Bus traffic should be considered when system software deals with semaphores.
Noncacheable semaphores incur no additional overhead because all
lwarx/stwcx.
operations are broadcast anyway. However, if the semaphore was in the cache, cacheable
semaphores may cause additional address-only bus cycles for each
lwarx
instruction
executed. Likewise, write-back, cacheable semaphores may cause additional address-only
bus cycles for each
stwcx.
operation. This small overhead may dictate some software
considerations if
lwarx/stwcx.
are used frequently. For example, to reduce bus bandwidth
for heavily-used semaphores, something like the following test and test and set operation
may be needed:
loop:
ld
rn,S
cmpi
rn, VAL
bcc
loop
lwarx
rn,S
ops as required
stwcx.
rm,S
bne
loop.
The preceding operation may be more useful than the following test and set operation:
loop:
lwarx
rn,S
ops as required
stwcx.
rm,S
bne
loop.
Table 8-2. Transfer Type Settings for lwarx/stwcx. Address-Only Operation
TT[0–4]
Cycle
00001
Set
lwarx
address.
00010
Clear reservation address.