Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: GPU vs SSE registers (floating point math)

  1. #1
    Intern Contributor
    Join Date
    Jul 2006
    Location
    UK
    Posts
    86

    GPU vs SSE registers (floating point math)

    Is it right to assume that floating point math done on a modern GPU (via GLSL) will produce identical results to the SSE registers?

    I want to move some colour management functionality off the CPU onto the GPU if possible, but need to guarantee the results are the same.

    Many thanks

  2. #2
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,979

    Re: GPU vs SSE registers (floating point math)

    I don't think this is the case... IMHO the precision of GPUs may be a bit lower. Why don't you just try it out? I remember testing precision on my old GFFX some years ago and it wasn't so great...

  3. #3
    Intern Contributor
    Join Date
    Jul 2006
    Location
    UK
    Posts
    86

    Re: GPU vs SSE registers (floating point math)

    Thanks Zengar... I was hoping to be lazy and avoid testing it!

    Obviously normal float math on a CPU is at higher precision, but I was hoping the 32bit SSE would be the same on a GPU.

  4. #4
    Intern Contributor
    Join Date
    Jul 2006
    Location
    UK
    Posts
    86

    Re: GPU vs SSE registers (floating point math)

    FWIW - I'm looking to use floating point textures (ARB_TEXTURE_FLOAT / ATI_TEXTURE_FLOAT) which implies GF6 or better i believe.

    Maybe GFFX is too limited for this.

    Regards

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    999

    Re: GPU vs SSE registers (floating point math)

    I'm not sure about older GPUs, but on my geforce8 addition and multiplication are IEEE-compliant, so they have a maximum error of
    0.5 ulp. I already checked it on a number of my gpgpu programs with a cpu fallback path and the results are the same, bit for bit. There are some differences with cpu math however, especially with the trigonometric and non-linear functions.


    N.

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    999

    Re: GPU vs SSE registers (floating point math)

    Quote Originally Posted by Mark Shaxted
    FWIW - I'm looking to use floating point textures (ARB_TEXTURE_FLOAT / ATI_TEXTURE_FLOAT) which implies GF6 or better i believe.

    Maybe GFFX is too limited for this.

    Regards
    Actually, the GFFX support the NV_float_buffer extension but its use is limited compared to the (ARB_TEXTURE_FLOAT / ATI_TEXTURE_FLOAT) extensions.

    N.

  7. #7
    Intern Contributor
    Join Date
    Jul 2006
    Location
    UK
    Posts
    86

    Re: GPU vs SSE registers (floating point math)

    Thanks NiCo

  8. #8
    Junior Member Newbie
    Join Date
    Sep 2005
    Location
    germany
    Posts
    22

    Re: GPU vs SSE registers (floating point math)

    I remember some issues with SSE and SQRT or 1.0/x computations.
    On 32bit float SSE you may have only about 4 signs precision instead of about 6 in FPU!

    I decided some years ago not to implement SSE in my project (there wasn't SSE2 this time) because of this big differences on FPU and SSE.

    So, keep an eye of this. Maye its better with newer processors today... .

  9. #9
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: GPU vs SSE registers (floating point math)

    Quote Originally Posted by Heady
    I remember some issues with SSE and SQRT or 1.0/x computations.
    On 32bit float SSE you may have only about 4 signs precision instead of about 6 in FPU!

    I decided some years ago not to implement SSE in my project (there wasn't SSE2 this time) because of this big differences on FPU and SSE.

    So, keep an eye of this. Maye its better with newer processors today... .
    Good point. sqrt and reciprocal (1/x) are the ones to watch out for. Most likely the GPU doesn't actually calculate the value but instead looks in a table and then does some interpolation between 2 neighboring values.
    We could say the same for SSE but I'm sure don't SSE and whatever GPU you have may produce diff values.

    Also, GPU floating point calc is not fully IEEE compliant. It doesn't deal with NAN properly. This might not be a problem for you.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •