This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 2/2] AMD bdver2 processors - TBM

> +  ;; For TBM support


> +(define_insn "*tbm_blci_<mode>"
> +  [(set (match_operand:SWI48 0 "register_operand" "=r")
> +        (ior:SWI48
> +		  (not:SWI48
> +            (plus:SWI48
> +              (match_operand:SWI48 1 "nonimmediate_operand" "rm")
> +              (const_int 1)))
> +          (match_dup 1)))


> +  [(set_attr "type" "bitmanip")
> +   (set_attr "mode" "<MODE>")])
> +
> +
> +

Watch the extra vertical whitespace.

> +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
> +__bextri_u32 (unsigned int __X, const unsigned int __I)
> +{
> +	unsigned char length    = ((__I >> 8) & 0xFF);
> +	unsigned char lsb_index = (__I & 0xFF);
> +	return __builtin_ia32_bextri_u32 (__X, length, lsb_index);

If you hadn't created the bextri builtin with three arguments,
you wouldn't have to play the tricks you're doing here to make
sure that the final arguments are constants.

Unless you want to expose both constants to the user intrinsic
(which isn't a horrible idea if you are not already constrained
by external documentation of these), there's no reason you can't
pull apart the two bytes of the immediate inside the builtin
expander instead.

> +@smallexample
> +unsigned int __builtin_ia32_bextri_u32 (unsigned int, const unsigned int);
> +unsigned long long __builtin_ia32_bextri_u64 (unsigned long long, const unsigned long long);
> +@end smallexample

... and you documentation wasn't updated to match.  Though if you
are going to change it back...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]