05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Instruction Details<br />

A8.6.297 VCVT (between floating-point <strong>and</strong> fixed-point, VFP)<br />

This instruction converts a value in a register from floating-point to fixed-point, or from fixed-point to<br />

floating-point, <strong>and</strong> places the result in a second register. You can specify the fixed-point value as either<br />

signed or unsigned.<br />

The floating-point value can be single-precision or double-precision.<br />

The fixed-point value can be 16-bit or 32-bit. Conversions from fixed-point values take their oper<strong>and</strong> from<br />

the low-order bits of the source register <strong>and</strong> ignore any remaining bits. Signed conversions to fixed-point<br />

values sign-extend the result value to the destination register width. Unsigned conversions to fixed-point<br />

values zero-extend the result value to the destination register width.<br />

The floating-point to fixed-point operation uses the Round towards Zero rounding mode. The fixed-point to<br />

floating-point operation uses the Round to Nearest rounding mode.<br />

Encoding T1 / A1 VFPv3 (sf = 1 UNDEFINED in single-precision only variants)<br />

VCVT..F64 , , #<br />

VCVT..F32 , , #<br />

VCVT.F64. , , #<br />

VCVT.F32. , , #<br />

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

1 1 1 0 1 1 1 0 1 D 1 1 1 op 1 U Vd 1 0 1 sf sx 1 i 0 imm4<br />

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

cond 1 1 1 0 1 D 1 1 1 op 1 U Vd 1 0 1 sf sx 1 i 0 imm4<br />

to_fixed = (op == ‘1’); dp_operation = (sf == ‘1’); unsigned = (U == ‘1’);<br />

size = if sx == ‘0’ then 16 else 32;<br />

frac_bits = size - UInt(imm4:i);<br />

if to_fixed then<br />

round_zero = TRUE;<br />

else<br />

round_nearest = TRUE;<br />

d = if dp_operation then UInt(D:Vd) else UInt(Vd:D);<br />

if frac_bits < 0 then UNPREDICTABLE;<br />

A8-582 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!