Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: float to int (kinda OT)



On Thu, 21 Oct 2004, Brendan Younger wrote:

[...]
> In general, float -> int or int -> float conversions are ridiculously
> inefficient on the PowerPC since the only way to do it is to move the
> data into memory and load it back into the appropriate register file.

I feel compelled to mention that if float <-> int conversions are
indeed unavoidable, then AltiVec has the fastest conversion primitives
known to me on any platform. Four conversions in parallel, with rounding
mode selectable on an instruction by instruction basis, with a 'free'
scaling to move the point of the fixed point representation. All that once
per clock cycle, fully pipelined.

Unfortunately these are not simple to use, because now you have the
problem of moving data to/from vector registers. You will likely have to
vectorize the whole routine even if only the type conversions are the
bottleneck.

  Holger
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden

References: 
 >Graphics card tricks (From: "Edward K. Chew" <email@hidden>)
 >Re: Graphics card tricks (From: Holger Bettag <email@hidden>)
 >Re: Graphics card tricks (From: Niall Dalton <email@hidden>)
 >float to int (kinda OT) (From: Ando Sonenblick <email@hidden>)
 >Re: float to int (kinda OT) (From: Brendan Younger <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.