On Mon, Jun 24, 2013 at 12:55:11PM +0400, Kirill Yukhin wrote:
> Here is snippet from i386.c:
>     case
> 3:                                                                            
>                                                            
> 
>       pat = GEN_FCN (icode) (real_target, args[0].op,
> args[1].op,                                                                   
>               
> 
>                             
> args[2].op);                                                                  
>                                        

This is calling genfun, which is
typedef rtx (*insn_gen_fn) (rtx, ...);
therefore there is no compile time number of arguments verification here,
the caller and callee simply has to agree on the number of arguments or at
least caller needs to supply as many arguments as the callee relies on.

> Could you pls take a look?

This looks ok to me, but as I'm not an i386 maintainer, I'll defer it to
Uros or Richard.

> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index 53a6cde..6d6aeac 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,8 @@
> +2013-06-20  Kirill Yukhin  <kirill.yuk...@intel.com>
> +
> +     * config/i386/bmiintrin.h (_bextr_u32): New.
> +     (_bextr_u64): Ditto.
> +
>  2013-06-19  Paolo Carlini  <paolo.carl...@oracle.com>
>  
>       PR c++/56544
> diff --git a/gcc/config/i386/bmiintrin.h b/gcc/config/i386/bmiintrin.h
> index 0087f5c..7a30cf0 100644
> --- a/gcc/config/i386/bmiintrin.h
> +++ b/gcc/config/i386/bmiintrin.h
> @@ -52,6 +52,12 @@ __bextr_u32 (unsigned int __X, unsigned int __Y)
>  }
>  
>  extern __inline unsigned int __attribute__((__gnu_inline__, 
> __always_inline__, __artificial__))
> +_bextr_u32 (unsigned int __X, unsigned int __Y, unsigned __Z)
> +{
> +  return __builtin_ia32_bextr_u32 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 
> 8)));
> +}
> +
> +extern __inline unsigned int __attribute__((__gnu_inline__, 
> __always_inline__, __artificial__))
>  __blsi_u32 (unsigned int __X)
>  {
>    return __X & -__X;
> @@ -91,6 +97,12 @@ __bextr_u64 (unsigned long long __X, unsigned long long 
> __Y)
>  }
>  
>  extern __inline unsigned long long __attribute__((__gnu_inline__, 
> __always_inline__, __artificial__))
> +_bextr_u64 (unsigned long long __X, unsigned long long __Y, unsigned long 
> long __Z)
> +{
> +  return __builtin_ia32_bextr_u64 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 
> 8)));
> +}
> +
> +extern __inline unsigned long long __attribute__((__gnu_inline__, 
> __always_inline__, __artificial__))
>  __blsi_u64 (unsigned long long __X)
>  {
>    return __X & -__X;

        Jakub

Reply via email to