Chapter 7. The AltiVec Technology Implementation
7-3
AltiVec Technology and the Programming Model
ister (
mtvscr
) instructions are provided to move the VSCR from and to the least-signiT-
cant bits of a vector register. The VSCR is shown in Figure 7-2.
Figure 7-2. Vector Status and Control Register (VSCR)
The VSCR has two deTned bits, the AltiVec non-Java mode bit (VSCR[NJ]) and the
AltiVec saturation bit (VSCR[SAT]). The remaining bits are reserved.
VSCR bits are described in Table 7-1.
Table 7-1. VSCR Field Descriptions
Bits
Name
Description
0D14
Reserved. The handling of reserved bits is the same as the normal PowerPC implementation,
(that is, system registers such as XER and FPSCR are implementation-dependent). Software
is permitted to write any value to such a bit. A subsequent reading of the bit returns 0 if the
value last written to the bit was 0 and returns an undeTned value (0 or 1) otherwise.
15
NJ
Non-Java. A mode control bit that determines whether AltiVec oating-point operations will be
performed in a Java-IEEE-C9XDcompliant mode or a possibly faster non-Java/non-IEEE mode.
0 The Java-IEEE-C9XDcompliant mode is selected. Denormalized values are handled as
speciTed by Java, IEEE, and C9X standard.
1 The non-Java/non-IEEEDcompliant mode is selected. If an element in a source vector
register contains a denormalized value, the value 0 is used instead. If an instruction causes
an underow exception, the corresponding element in the target VR is cleared to 0. In both
cases the 0 has the same sign as the denormalized or underowing value.
16D30
Reserved. The handling of reserved bits is the same as the normal PowerPC implementation,
that is, system registers such as XER and FPSCR are implementation-dependent. Software is
permitted to write any value to such a bit. A subsequent reading of the bit returns 0 if the value
last written to the bit was 0 and returns an undeTned value (0 or 1) otherwise.
31
SAT
Saturation. A sticky status bit indicating that some Teld in a saturating instruction saturated
since the last time SAT was cleared. In other words when SAT = 1 it remains set to 1 until it is
cleared to 0 by an
mtvscr
instruction.
1 The AltiVec saturate instruction implicitly sets when saturation has occurred on the results
of one of the AltiVec instructions having saturate in its name:
Move To VSCR (
mtvscr
)
Vector Add Integer with Saturation (
vaddubs
,
vadduhs
,
vadduws
,
vaddsbs
,
vaddshs
,
vaddsws
)
Vector Subtract Integer with Saturation (
vsububs
,
vsubuh
s,
vsubuws
,
vsubsbs
,
vsubshs
,
vsubsws
)
Vector Multiply-Add Integer with Saturation (
vmhaddshs
,
vmhraddshs
)
Vector Multiply-Sum with Saturation (
vmsumuhs
,
vmsumshs
,
vsumsws
)
Vector Sum-Across with Saturation (
vsumsws
,
vsum2sws
,
vsum4sbs
,
vsum4shs
,
vsum4ubs
)
Vector Pack with Saturation (
vpkuhus
,
vpkuwus
,
vpkshus
,
vpkswus
,
vpkshss
,
vpkswss
)
Vector Convert to Fixed-Point with Saturation (
vctuxs
,
vctsxs
)
0 Indicates no saturation occurred,
mtvscr
can explicitly clear this bit.
0
0
SAT
0
0
0
0
0
0
0
0
0
0
0
0
0
0
NJ
0
0
0
0
0
0
0
0
0
0
0
0
0
0
31
30
16
15
14
0
Reserved