dcbst (Data Cache 块存储器) 指令

用途

允许程序将修改后的块的内容复制到主存储器。

注: 仅在 PowerPC® 体系结构中支持 dcbst 指令。

语法

位数 VALUE
0-5 31
6-10 ///
11-15 亚美尼亚共和国
16-20 经常预算
21-30 54
31 /
PowerPC® 
DCBST RA RB

描述

dcbst 指令导致将块的任何修改副本复制到主内存。 如果 RA 不是 0 ,那么 dcbst 指令通过将通用寄存器 (GPR) RA 的内容添加到 GPR RB的内容来计算有效地址 (EA)。 否则, EA 是 RB的内容。 如果包含寻址字节的高速缓存块位于数据高速缓存中并已修改,那么会将该块复制到主内存。

可以使用 dcbst 指令来确保主内存中某个位置的副本包含最新的更新。 当与不参与一致性协议的 I/O 设备共享内存时,这可能很重要。 此外, dcbst 指令可以确保将更新立即复制到图形帧缓冲区。

在地址转换和保护方面,将 dcbst 指令视为来自寻址字节的负载。

dcbst 指令有一种语法形式,不会影响定点异常寄存器。

参数

描述
RA 指定用于 EA 计算的源通用寄存器。
经常预算 指定用于 EA 计算的源通用寄存器。

示例

  1. 以下代码与未参与一致性协议的 I/O 设备共享内存:
    
    # Assume that location A is memory that is shared with the
    # I/O device.
    # Assume that GPR 2 contains a control value indicating that
    # and I/O operation should start.
    # Assume that GPR 3 contains the new value to be placed in
    # location A.
    # Assume that GPR 4 contains the address of location A.
    # Assume that GPR 5 contains the address of a control register
    # in the I/O device.
    st      3,0,4           # Update location A.
    dcbst   0,4             # Copy new content of location A and
                            # other bytes in cache block to main
                            # memory.
    sync                    # Ensure the dcbst instruction has 
                            # completed.
    st      2,0,5           # Signal I/O device that location A has
                            # been update.
    
  2. 以下代码将复制到图形帧缓冲区,确保不延迟地显示新值:
    
    # Assume that target memory is a graphics frame buffer.
    # Assume that GPR 2, 3, and 4 contain new values to be displayed.
    # Assume that GPR 5 contains the address minus 4 of where the
    # first value is to be stored.
    # Assume that the 3 target locations are known to be in a single
    # cache block.
    addi    6,5,4           # Compute address of first memory
                            # location.
    stwu    2,4(5)          # Store value and update address ptr.
    stwu    3,4(5)          # Store value and update address ptr.
    stwu    4,4(5)          # Store value and update address ptr.
    dcbst   0,6             # Copy new content of cache block to
                            # frame buffer. New values are displayed.