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 Fri, 22 Oct 2004, John Stiles wrote:

> If you're on a two's-complement CPU (i.e. any modern computer) and you
> use a reasonably modern compiler, you have nothing to fear...
> right-shift will sign-extend. The C standard doesn't require it because
> when the standard was written, there were still some one's-complement
> CPUs in existence.
>
I want people to be aware of the issue, rather than just be lucky with the
correctness of their code. When autovectorization in GCC arrives, some of
the C language vagaries might have to be revived to give the compiler more
freedom to actually vectorize code.

That being said, I also write most code with the assumption that I am on a
32 bit two's complement machine. It would be hard to tune code if nothing
could be taken for granted about the hardware.

  Holger

P.S.: You and your Blizzard buddies are more than welcome to ask for
      optimization hints! Anything I can do to help you will only improve
      the gaming experience on my aging 800MHz Powerbook. :-)
 _______________________________________________
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: 
 >Re: float to int (kinda OT) (From: Sanjay Patel <email@hidden>)
 >Re: float to int (kinda OT) (From: Holger Bettag <email@hidden>)
 >Re: float to int (kinda OT) (From: John Stiles <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.