Hi! On Wed, Jul 01, 2020 at 06:20:23PM -0400, Michael Meissner wrote: > This patch adds support for the IEEE 128-bit floating point minimum, maximum, > and compare instructions generating a mask. These instructions were added in > ISA 3.1 (i.e. power10).
> (emit_fp_cmove_with_mask_xxsel): Update comment. Your patch does not touch this function? > + /* See if we can use the ISA 3.1 min/max/compare instructions for IEEE > + 128-bit floating point. At present, don't worry about doing conditional > + moves with different types for the comparison and movement (unlike > SF/DF, > + where you can do a conditional test between double and use float as the > + if/then parts. */ Two spaces after a full stop. > +;; IEEE 128-bit min/max > +(define_insn "s<minmax><mode>3" > + [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v") > + (fp_minmax:IEEE128 > + (match_operand:IEEE128 1 "altivec_register_operand" "v") > + (match_operand:IEEE128 2 "altivec_register_operand" "v")))] > + "TARGET_FLOAT128_HW && TARGET_POWER10 && FLOAT128_IEEE_P (<MODE>mode)" > + "xs<minmax>cqp %0,%1,%2" > + [(set_attr "type" "fp") > + (set_attr "size" "128")]) As with the SF/DF min/max, this is undefined if either operand is a NaN, or if both are zero (or underdefined). Because of that, the "c" version of the instructions can be used here. But it isn't obviously clear how this works with the builtins :-( > +(define_insn_and_split "*mov<mode>cc_hardware" > + [(set (match_operand:IEEE128 0 "altivec_register_operand" "=&v,v") > + (if_then_else:IEEE128 > + (match_operator:CCFP 1 "fpmask_comparison_operator" > + [(match_operand:IEEE128 2 "altivec_register_operand" "v,v") > + (match_operand:IEEE128 3 "altivec_register_operand" "v,v")]) > + (match_operand:IEEE128 4 "vsx_register_operand" "wa,wa") > + (match_operand:IEEE128 5 "vsx_register_operand" "wa,wa"))) > + (clobber (match_scratch:V2DI 6 "=0,&wa"))] Why do you use "wa" instead of "v" here? Won't it always need "v" in the end anyway? > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/float128-minmax-2.c > @@ -0,0 +1,70 @@ > +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ > +/* { dg-require-effective-target power10_ok } */ > +/* { dg-options "-mdejagnu-cpu=power10 -O2 -ffast-math" } */ > +/* { dg-final { scan-assembler-not "xscmpuqp" } } */ > +/* { dg-final { scan-assembler "xscmpeqqp" } } */ > +/* { dg-final { scan-assembler "xscmpgtqp" } } */ > +/* { dg-final { scan-assembler "xscmpgeqp" } } */ > +/* { dg-final { scan-assembler "xsmaxcqp" } } */ > +/* { dg-final { scan-assembler "xsmincqp" } } */ > +/* { dg-final { scan-assembler "xxsel" } } */ Please use \m \M. Segher