This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, MIPS] Add seq Octeon instruction
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Adam Nemet <anemet at caviumnetworks dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 04 Sep 2008 22:24:55 +0100
- Subject: Re: [PATCH, MIPS] Add seq Octeon instruction
- References: <48B8AD98.60507@caviumnetworks.com> <87ljye7rw2.fsf@firetop.home> <48C049C2.5020608@caviumnetworks.com>
Adam Nemet <anemet@caviumnetworks.com> writes:
> Richard Sandiford wrote:
>> So if we want to use sltiu for zero comparisons, I think
>> it would be technically better to have something like:
>>
>> (define_insn "*seq_<GPR:mode><GPR2:mode>_seq"
>> [(set (match_operand:GPR2 0 "register_operand" "=d,d,d")
>> (eq:GPR2 (match_operand:GPR 1 "register_operand" "%d,d,d")
>> (match_operand:GPR 2 "reg_imm10_operand" "d,J,YB")))]
>> "ISA_HAS_SEQ_SNE"
>> "@
>> seq\t%0,%1,%2
>> sltiu\t%0,%1,1
>> seqi\t%0,%1,%2"
>> [(set_attr "type" "slt")
>> (set_attr "mode" "<GPR:MODE>")])
>
> Here it is. Bootstrapped and tested on mips64octeon-unknown-linux-gnu.
>
> I had to slightly modify the tests (even existing ones) to accept both
> sltu and sltiu in the assembly.
>
> Looks good?
Yes, thanks. OK for trunk.
TBH, I'm curious why it's better to use sltiu over the new instructions
for the zero case. Is it just tradition? Or is there some performance
benefit? The patch is OK regardless, but if there's something you could
add as a comment, that'd be great.
Richard