![](http://datasheet.mmic.net.cn/260000/PTM1300FBEA_datasheet_15959396/PTM1300FBEA_466.png)
TM1300 Data Book
Philips Semiconductors
A-180
PRODUCT SPECIFICATION
Convert unsigned integer to floating-point with
rounding toward zero
SYNTAX
[ IF rguard ] ufloatrz rsrc1
→
rdest
FUNCTION
if
rguard
then {
rdest
←
(float) ((unsigned long)rsrc1)
}
ATTRIBUTES
Function unit
Operation code
Number of operands
Modifier
Modifier range
Latency
Issue slots
falu
119
1
No
—
3
1, 4
DESCRIPTION
The
ufloatrz
operation converts the unsigned integer value in rsrc1to single-precision IEEE floating-point format
and writes the result into rdest Rounding is performed toward zero; the IEEE rounding mode bits in PCSW are
ignored. This is the preferred rounding mode for ANSI C. If
ufloatrz
causes an IEEE exception, such as inexact,
the corresponding exception flags in the PCSW are set. The PCSW exception flags are sticky: the flags can be set as
a side-effect of any floating-point operation but can only be reset by an explicit
writepcsw
operation. The update of
the PCSW exception flags occurs at the same time as rdest is written. If any other floating-point compute operations
update the PCSW at the same time, the net result in each exception flag is the logical OR of all simultaneous updates
ORed with the existing PCSW value for that exception flag.
The
ufloatrzflags
operation computes the exception flags that would result from an individual
ufloatrz
.
The
ufloatrz
operation optionally takes a guard, specified in rguard If a guard is present, its LSB controls the
modification of the destination register. If the LSB of rguard is 1, rdest and the exception flags in PCSW are written;
otherwise, rdestis not changed and the operation does not affect the exception flags in PCSW.
EXAMPLES
Initial Values
Operation
Result
r30 = 3
r40 = 0xffffffff (4294967295)
r10 = 0, r50 = 0xfffffffd
r20 = 1, r50 = 0xfffffffd
r60 = 0x7fffffff (2147483647)
r70 = 0x80000000 (2147483648)
r80 = 0x7ffffff1 (2147483633)
ufloatrz r30
→
r100
ufloatrz r40
→
r105
IF r10 ufloatrz r50
→
r110
IF r20 ufloatrz r50
→
r115
ufloatrz r60
→
r117
ufloatrz r70
→
r120
ufloatrz r80
→
r122
r100
←
0x40400000 (3.0)
r105
←
0x4f7fffff (4.294967040e+9), INX flag set
no change, since guard is false
r115
←
0x4f7fffff (4.294967040e+9), INX flag set
r117
←
0x4effffff (2.147483520e+9), INX flag set
r120
←
0x4f000000 (2.147483648e+9)
r122
←
0x4effffff (2.147483520e+9), INX flag set
SEE ALSO
ifloatrz ifloat ufloat
ifixieee ufloatflags
ufloatrz