public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: will schmidt <will_schmidt@vnet.ibm.com>
Cc: gcc-patches@gcc.gnu.org, David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH v2] RS6000 Add testlsbb (Test LSB by Byte) operations
Date: Wed, 29 Jul 2020 13:38:59 -0500	[thread overview]
Message-ID: <20200729183859.GH17447@gate.crashing.org> (raw)
In-Reply-To: <1e8ba44cf3f2d5e5695389b1bfa8aafbbf500459.camel@vnet.ibm.com>

Hi Will,

On Wed, Jul 29, 2020 at 12:40:08PM -0500, will schmidt wrote:
> V2 has completed tests on powerpc64le-unknown-linux-gnu Power8LE, with
> other regression tests still in progress on some other powerpc platforms.

Thanks for that :-)

> +;; xvtlsbb BF,XB
> +;; Set the CR field BF to indicate if bit 7 of every byte element in VSR[XB]
> +;; is equal to 1 (ALL_TRUE) or equal to 0 (ALL_FALSE).

That now does not say which bit in the CR field means which.  And, do you
think "bit 7" is clearer than "lowest bit"?

> +(define_insn "*xvtlsbb_internal"
> +  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
> +	(unspec:CC [(match_operand:V16QI 1 "vsx_register_operand" "wa")]
> +	 UNSPEC_XVTLSBB))]
> +  "TARGET_POWER10"
> +  "xvtlsbb %0,%x1"
> +  [(set_attr "type" "logical")])

> +;; Vector Test Least Significant Bit by Byte
> +;; for the implementation of the builtin
> +;;     __builtin_vec_test_lsbb_all_ones
> +;;     int vec_test_lsbb_all_ones (vector unsigned char);
> +;; and
> +;;     __builtin_vec_test_lsbb_all_zeros
> +;;     int vec_test_lsbb_all_zeros (vector unsigned char);
> +(define_expand "xvtlsbbo"
> +  [(set (match_dup 2)
> +	(unspec:CC [(match_operand:V16QI 1 "vsx_register_operand" "v")]
> +	 UNSPEC_XVTLSBB))
> +	(set (match_operand:SI 0 "gpc_reg_operand" "=r")
> +		(lt:SI (match_dup 2) (const_int 0)))]
> +  "TARGET_POWER10"
> +  {
> +  operands[2] = gen_reg_rtx (CCmode);
> +  })

Indentation is wrong still:

(define_expand "xvtlsbbo"
  [(set (match_dup 2)
	(unspec:CC [(match_operand:V16QI 1 "vsx_register_operand" "v")]
	 UNSPEC_XVTLSBB))
   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
	(lt:SI (match_dup 2) (const_int 0)))]
  "TARGET_POWER10"
{
  operands[2] = gen_reg_rtx (CCmode);
})

(The C block should be indented like C, withe the outer braces flush
left; the arms of the (implicit) parallel should be indented the same;
if writing some RTX over multiple lines, things should be indented the
same as the previous thing at the same level, if it isn't the first
itself.  But none of these rules are hard rules ;-) )

Other than those nits, this looks fine.  Okay for trunk.  Thanks!


Segher

      reply	other threads:[~2020-07-29 18:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 16:12 [PATCH] " will schmidt
2020-06-17 15:57 ` will schmidt
2020-07-28 15:31 ` will schmidt
2020-07-28 21:44   ` Segher Boessenkool
2020-07-29 17:40     ` [PATCH v2] " will schmidt
2020-07-29 18:38       ` Segher Boessenkool [this message]

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=20200729183859.GH17447@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=will_schmidt@vnet.ibm.com \
    /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).