incompatible types in initialization Error

Discussion in 'C' started by jjthmpsn, Jan 4, 2008.

  1. jjthmpsn

    jjthmpsn New Member

    Jan 4, 2008
    Likes Received:
    Trophy Points:
    Hi. I'm trying to debug an old recursive square root function. My first problem I have already solved, which is redefinitions of some of the intrinsic functions in the most recent updates of <xmintrin.h>.

    This problem gives an error when the __mm_load_ss function tries to retrieve the data from the input and stores it as x. The compiler remarks the line as
    error: incompatible types in initialization.

    Here is the code:
    typedef float  v4sf __attribute__((vector_size(16)));
    typedef double v2df __attribute__((vector_size(32)));
    static v4sf f3  = { 3.0f, 3.0f, 3.0f, 3.0f };
    static v4sf f05 = { 0.5f, 0.5f, 0.5f, 0.5f };
    #if defined __SSE2__
    static v2df d3  = { 3.0, 3.0 };
    static v2df d05 = { 0.5, 0.5 };
    inline float cuRecSqrtSEE(float x)
    #if defined __SSE__
      v4sf  xx = __mm_load_ss( & x ); <----- ERROR HERE
      v4sf  xr = __builtin_ia32_rsqrtss( xx );
      v4sf  xt;
      xt = __builtin_ia32_mulss( xr, xr );
      xt = __builtin_ia32_mulss( xt, xx );
      xt = __builtin_ia32_subss( f3, xt );
      xt = __builtin_ia32_mulss( xt, f05 );
      xr = __builtin_ia32_mulss( xr, xt );
          __builtin_ia32_storess( &x, xr );
        return x;
        float  r;
        __builtin_ia32_storess( & r, __builtin_ia32_rsqrtss(__mm_load_ss( & x ) ) );
        r *= ((3.0f - r * r * x) * 0.5f);
        return r;

    Any help anyone??

    Last edited by a moderator: Jan 5, 2008

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice