VCVT

Note: This was originally posted on 7th July 2009 at http://forums.arm.com

Hello all,
               We are facing an issue with conversion from float to integer

the following parallel instruction seems to be working...
vcvt.f32.s32 q0,q0     @ converting rect[0] tr.x,y tr.width,height to float
vcvt.f32.s32 q1,q1     @ converting rect[1] tr.x,y tr.width,height to float

the same thing when tried the other way, ie float to integer seems to be going wrong. Doesnt seem to be rounding to the nearest integer, rather truncating the decimal part and returning the int.
vcvt.s32.f32 q0,q0     @ converting rect[0] tr.weight,a,b,cto int
vcvt.s32.f32 q1,q1     @ converting rect[1] tr.weight,a,b,cto int

but if we put each single precesion instruction it seems to be working
vcvt.s32.f32 s0,s0
vcvt.s32.f32 s1,s1
vcvt.s32.f32 s2,s2
vcvt.s32.f32 s3,s3

kindly suggest if we are doing anything wrong.

thanks and regards
pachu
  • Note: This was originally posted on 7th July 2009 at http://forums.arm.com

    Is this on a simulator or real hardware?

    s.
  • Note: This was originally posted on 9th July 2009 at http://forums.arm.com

    Your results look right to me -

    The NEON vector unit is defined to always round towards zero for float to integer conversions.

    The scalar single precision instruction executes on the VFP unit, which normally uses the round towards zero rounding mode, but can optionally use the rounding mode specified by the FPSCR.

    If you are seeing "different" behavior between the two, I'd strongly suspect someone has changed the VFP configuration in the FPSCR - but note that this configuration only affects the VFP unit, not the SIMD NEON unit.
  • Note: This was originally posted on 9th July 2009 at http://forums.arm.com

    Is this on a simulator or real hardware?

    s.

    Hello,

    this is real mode (On the board) (TI-OMAP3430 SDP)
    gcc version 4.2.3 (Sourcery G++ Lite 2008q1-126)

    We do not have a simulator.

    thanks and regards
    pachu
More questions in this forum