Announcement

Collapse
No announcement yet.

GCC Eyeing -O2 Vectorization For Boosting Intel Core / AMD Zen Performance

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by chithanh View Post
    Yes, that is a big problem for those who want consistency in FP calculations. Just ask Feral why their ported RTS games do not support Windows/Linux cross-platform multiplayer.
    What on earth are you on about? Windows uses x87 80bit doubles in 32bit mode as well. Only Apple don't use it because they don't care about backwards compatibility.

    Comment


    • #22
      Originally posted by carewolf View Post
      What on earth are you on about? Windows uses x87 80bit doubles in 32bit mode as well.
      The inconsistency is not really a problem of the OS, but rather of the compiler. It can be avoided using x87 FP CSR though.

      Comment


      • #23
        Originally posted by chithanh View Post
        The inconsistency is not really a problem of the OS, but rather of the compiler. It can be avoided using x87 FP CSR though.
        But the compilers do the same thing on Linux and Win32 in this case. They are more compatible with each other than they are with their own 64-bit versions.

        The cross-gaming wasn't allowed because the companies are petty and don't trust Feral. There is no technical reason for it, and certainly nothing to do with how FP is handled on Linux, since it is identical to how it is handled on Windows.

        Comment


        • #24
          Originally posted by chithanh View Post
          More importantly, you get a different result depending on whether contractions are in use or not. And contractions are inserted by gcc in places where the C standard does not allow them.
          Except 99% of the developers who use float in the code don't care nor are aware of floating point details nor the C standard about them. That's the point.

          Originally posted by chithanh View Post
          Some things that -Ofast will potentially do:
          • Wreak total havoc on bounds testing
          If you use floats to index arrays you need to rethink your design.

          Originally posted by chithanh View Post
          • Replace divisions with multiplicative inverse, e.g. x/y becomes x*(1/y)
          • Replace literal values with operands, e.g. p*(q+1) becomes p*q+p
          • Change the order of operations, e.g. (a+b)+c becomes a+(b+c), etc.
          All these can have serious consequences for accuracy in cases where you handle both very large and very small numbers in a single expression.
          I don't see the problem in these. Almost no developer will use a division for accuracy in the first place. They will arbitrarily use it (or because it's "cleaner code") so they couldn't care less if it's multiplicative inverse and don't even know it.

          Yes, Ofast can wreck havoc on code that is specifically designed to work with IEEE float rules in the C standard. But most people don't, and a lot are not even aware of those rules or how they impact accuracy.

          Comment


          • #25
            Originally posted by carewolf View Post
            But the compilers do the same thing on Linux and Win32 in this case. They are more compatible with each other than they are with their own 64-bit versions.
            People typically use different compilers on Linux and Win32.

            Originally posted by carewolf View Post
            The cross-gaming wasn't allowed because the companies are petty and don't trust Feral. There is no technical reason for it, and certainly nothing to do with how FP is handled on Linux, since it is identical to how it is handled on Windows.
            There is actually a technical reason for this. Networked RTS games run a deterministic simulation, and transfer only user input. That means that they need to ensure completely consistent calculations down to the least significant digit.

            In order to achieve this in a cross-platform game, this must be baked into the engine from the beginning. Either avoid using FP arithmetic entirely, or use cross-platform libraries which achieve this (e.g. streflop which is used by the Spring RTS engine).

            A collection of accounts from developers to read if you are interested: https://gafferongames.com/post/float...t_determinism/

            Originally posted by Weasel View Post
            If you use floats to index arrays you need to rethink your design.
            I wrote bounds, not array bounds.

            Originally posted by Weasel View Post
            Yes, Ofast can wreck havoc on code that is specifically designed to work with IEEE float rules in the C standard. But most people don't, and a lot are not even aware of those rules or how they impact accuracy.
            It can unfortunately cause trouble even where programmers are oblivious of the standard. And expect e.g. the sign of zero not to change from under them.

            Comment


            • #26
              If you have a Numerical Analyst License, you do know all this stuff. If you don't have a license, don't expect floating point to work for you.

              Comment

              Working...
              X