[PATCH v2] RS6000 Add testlsbb (Test LSB by Byte) operations
Segher Boessenkool
segher@kernel.crashing.org
Wed Jul 29 18:38:59 GMT 2020
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
More information about the Gcc-patches
mailing list