![Xilinx Virtex-II Pro PPC405 Скачать руководство пользователя страница 429](http://html1.mh-extra.com/html/xilinx/virtex-ii-pro-ppc405/virtex-ii-pro-ppc405_user-manual_3410279429.webp)
March 2002 Release
737
Virtex-II Pro™ Platform FPGA Documentation
1-800-255-7778
Alphabetical Instruction Listing
R
stwcx.
Store Word Conditional Indexed
Description
An effective address (EA) is calculated by adding an index to a base address, which are
formed as follows:
•
The contents of register
r
B are used as the index.
•
If the
r
A field is 0, the base address is 0.
•
If the
r
A field is not 0, the contents of register
r
A are used as the base address.
If the reservation bit internal to the processor is set to 1 when the instruction is executed,
the contents of register
r
S are stored into the word referenced by EA. If the reservation bit
is cleared to 0 when the instruction is executed, no store operation is performed. Execution
of this instruction always clears the reservation bit.
CR[CR0] is updated as follows:
•
CR[CR0]
LT, GT
are cleared to 0.
•
CR[CR0]
EQ
is set to the state of the reservation bit before the instruction is executed.
•
CR[CR0]
SO
is set to the contents of the XER[SO] bit.
The
lwarx
and the
stwcx.
instructions should paired in a loop to create the effect of an
atomic memory operation when accessing a semaphore. See
for more information.
Pseudocode
EA
←
(
r
A|0) + (
r
B)
if RESERVE
=
1
then
MS(EA, 4)
←
(
r
S)
RESERVE
←
0
(CR[CR0])
←
0b00
||
1
||
XER
so
else
(CR[CR0])
←
0b00
||
0
||
XER
so
Registers Altered
•
CR[CR0]
LT, GT, EQ, SO
.
Exceptions
•
Alignment—if the EA is not aligned on a word boundary.
stwcx.
r
S
,
r
A,
r
B
X Instruction Form
31
r
S
r
A
r
B
150
1
0
6
1
1
1
6
2
1
3
1
Содержание Virtex-II Pro PPC405
Страница 1: ...R Volume 2 a PPC405 User Manual Virtex II Pro Platform FPGA Developer s Kit March 2002 Release...
Страница 14: ...322 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation Preface R...
Страница 252: ...560 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation R...
Страница 260: ...568 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation R...
Страница 562: ...870 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation R...