2012/6/29 Andreas Färber <afaer...@suse.de>:
> Am 29.06.2012 08:41, schrieb Dunrong Huang:
>> Commit c4baa0503d9623f1ce891f525ccd140c598bc29a improved SSE table type
>> safety but raises compile error of incompatible pointer type.
>
> What's the difference between the signatures?
>
The SSEFunc_0_pi is declared as:
typedef void (*SSEFunc_0_pi)(TCGv_ptr reg, TCGv_i32 val);

gen_helper_cvtsi2ss is defined as(By preprocessed source code(GCC -E):
static inline void gen_helper_cvtsi2ss( TCGv_ptr arg1, TCGv_i32 arg2)

And gen_helper_cvtsq2ss is defined as(By preprocessed source code(GCC -E):
static inline void gen_helper_cvtsq2ss( TCGv_ptr arg1, TCGv_i64 arg2)

So the type of gen_helper_cvtsq2ss is not SSEFunc_0_pi.

But from tcg/tcg.h,
typedef struct
{
    int i32;
} TCGv_i32;

typedef struct
{
    int i64;
} TCGv_i64;

We know that TCGv_i32 and TCGv_i64 have same members, their contents is same.
So casting gen_helper_cvtsq2ss as SSEFunc_0_pi will work.

And similarly for the others.

-- 
Best Regards,

Dunrong Huang

Reply via email to