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, MIPS] Add support for cins Octeon instruction


Adam Nemet <anemet@caviumnetworks.com> writes:
> Richard Sandiford wrote:
>> and:SI is fine.
>> 
>>     (and:SI ... (const_int 0xff000000))
>> 
>> is really:
>> 
>>     (and:SI ... (const_int -0x1000000))
>> 
>> because const_ints are stored in sign-extended form, and because
>> we require 64bit HOST_WIDE_INTs on 64-bit MIPS targets.
>
> Ah, sorry, I got confused and didn't realize that I was claiming and:SI
> to be completely broken.

Not at all.  I was equally confused when I asked the question originally.
You were right that either your code was safe or the existing code was
wrong.  I'd just not cottoned on to why.

> 	* config/mips/mips.h (ISA_HAS_CINS): New macro.
> 	* config/mips/mips-protos.h (mask_low_and_shift_p,
> 	mask_low_and_shift_len): Declare.
> 	* config/mips/mips.c (mask_low_and_shift_p,
> 	mask_low_and_shift_len): New functions.
> 	(mips_print_operand): Handle new operand prefix "m".
> 	* config/mips/mips.md (*cins<mode>): New pattern.
>
> testsuite/
> 	* gcc.target/mips/octeon-cins-1.c: New test.
> 	* gcc.target/mips/octeon-cins-2.c: New test.

OK, thanks.

> +/* The tests also work with -mgp32.  For long long tests, only one the
> +   32-bit parts is used.  */

s/one the/one of the/ (missed this first time, sorry)

Richard


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