This is the mail archive of the gcc-patches@gcc.gnu.org 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


Hi Richard,

On Thu, Nov 4, 2010 at 11:19 AM, Richard Henderson <rth@redhat.com> wrote:
>> + ?[(set_attr "type" "bitmanip")
>> + ? (set_attr "mode" "<MODE>")])
>> +
>> +
>> +
> Watch the extra vertical whitespace.

So should I have two lines (to separate list of ';TBM instructions')
or just one?


>> +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.

I was a little uneasy with this little wart as well.  I was following
your feedback "the builtin function would need a bit of tweaking".

The builtin signature follows the signature of the BEXTR insn (and an
internal standard set for other compilers).

So pulling the two bytes out in the builtin expander - should that be
done with a *new* define_expand?  Or is there a set of RTX operations
(shift, mask) I should use in the define_insn as written?

Any hints appreciated :)

And good catch on all the others, thanks.
-- 
Quentin


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