
TM1300 Data Book
Philips Semiconductors
A-176
PRODUCT SPECIFICATION
Convert oating-point to unsigned integer with
round toward zero
SYNTAX
[ IF r
guard ] ufixrz rsrc1
→ rdest
FUNCTION
if r
guard then {
r
dest
← (unsigned long) ((oat)rsrc1)
}
ATTRIBUTES
Function unit
falu
Operation code
125
Number of operands
1
Modier
No
Modier range
—
Latency
3
Issue slots
1, 4
DESCRIPTION
The ufixrz operation converts the single-precision IEEE oating-point value in r
src1 to an unsigned integer and
writes the result into r
dest. Rounding toward zero is performed; the IEEE rounding mode bits in PCSW are ignored.
This is the preferred rounding mode for ANSI C. If r
src1 is denormalized, zero is substituted before conversion, and
the IFZ ag in the PCSW is set. If ufixrz causes an IEEE exception, such as overow or underow, the
corresponding exception ags in the PCSW are set. The PCSW exception ags are sticky: the ags can be set as a
side-effect of any oating-point operation but can only be reset by an explicit writepcsw operation. The update of the
PCSW exception ags occurs at the same time as r
dest is written. If any other oating-point compute operations
update the PCSW at the same time, the net result in each exception ag is the logical OR of all simultaneous updates
ORed with the existing PCSW value for that exception ag.
The ufixrzflags operation computes the exception ags that would result from an individual ufixrz.
The ufixrz operation optionally takes a guard, specied in r
guard. If a guard is present, its LSB controls the
modication of the destination register. If the LSB of r
guard is 1, rdest and the exception ags in PCSW are written;
otherwise, r
dest is not changed and the operation does not affect the exception ags in PCSW.
EXAMPLES
Initial Values
Operation
Result
r30 = 0x40400000 (3.0)
ufixrz r30
→ r100
r100
← 3
r35 = 0x40247ae1 (2.57)
ufixrz r35
→ r102
r102
← 2, INX ag set
r10 = 0,
r40 = 0xff4fffff (–3.402823466e+38)
IF r10 ufixrz r40
→ r105
no change, since guard is false
r20 = 1,
r40 = 0xff4fffff (–3.402823466e+38)
IF r20 ufixrz r40
→ r110
r110
← 0x0, INV ag set
r45 = 0x7f800000 (+INF))
ufixrz r45
→ r112
r112
← 0xffffffff (232-1), INV ag set
r50 = 0xbfc147ae (-1.51)
ufixrz r50
→ r115
r115
← 0, INV ag set
r60 = 0x00400000 (5.877471754e-39)
ufixrz r60
→ r117
r117
← 0, IFZ set
r70 = 0xffffffff (QNaN)
ufixrz r70
→ r120
r120
← 0, INV ag set
r80 = 0xffbfffff (SNaN)
ufixrz r80
→ r122
r122
← 0, INV ag set
SEE ALSO
ifixieee ufixieee ifixrz
ufixrz