From: Richard Sandiford <rdsandiford@googlemail.com>
To: Adam Nemet <anemet@caviumnetworks.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH, MIPS] Add seq Octeon instruction
Date: Thu, 04 Sep 2008 21:27:00 -0000 [thread overview]
Message-ID: <87iqtba9js.fsf@firetop.home> (raw)
In-Reply-To: <48C049C2.5020608@caviumnetworks.com> (Adam Nemet's message of "Thu\, 04 Sep 2008 13\:49\:06 -0700")
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
next prev parent reply other threads:[~2008-09-04 21:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <48B8AD98.60507@caviumnetworks.com>
[not found] ` <87ljye7rw2.fsf@firetop.home>
2008-09-02 21:51 ` Adam Nemet
2008-09-02 22:00 ` Adam Nemet
2008-09-04 21:11 ` Adam Nemet
2008-09-04 21:27 ` Richard Sandiford [this message]
2008-09-04 21:47 ` Adam Nemet
2008-09-04 22:07 ` Richard Sandiford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iqtba9js.fsf@firetop.home \
--to=rdsandiford@googlemail.com \
--cc=anemet@caviumnetworks.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).