Double vs float on the iPhone

前端 未结 3 1394
名媛妹妹
名媛妹妹 2020-11-29 18:25

I have just heard that the iphone cannot do double natively thereby making them much slower that regular float.

Is this true? Evidence?

I am very interested

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 19:05

    The iPhone can do both single and double precision arithmetic in hardware. On the 1176 (original iPhone and iPhone3G), they operate at approximately the same speed, though you can fit more single-precision data in the caches. On the Cortex-A8 (iPhone3GS, iPhone4 and iPad), single-precision arithmetic is done on the NEON unit instead of VFP, and is substantially faster.

    Make sure to turn off thumb mode in your compile settings for armv6 if you are doing intensive floating-point computation.

提交回复
热议问题