diff options
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/md.texi | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index 30f1e09..ce46320 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -6349,13 +6349,21 @@ operand 0, otherwise (operand 2 + operand 3) is moved. @itemx @samp{cond_smax@var{mode}} @itemx @samp{cond_umin@var{mode}} @itemx @samp{cond_umax@var{mode}} -Perform an elementwise operation on vector operands 2 and 3, -under the control of the vector mask in operand 1, and store the result -in operand 0. This is equivalent to: +When operand 1 is true, perform an operation on operands 2 and 3 and +store the result in operand 0, otherwise store operand 4 in operand 0. +The operation works elementwise if the operands are vectors. + +The scalar case is equivalent to: + +@smallexample +op0 = op1 ? op2 @var{op} op3 : op4; +@end smallexample + +while the vector case is equivalent to: @smallexample -for (i = 0; i < GET_MODE_NUNITS (@var{n}); i++) - op0[i] = op1[i] ? op2[i] @var{op} op3[i] : op2[i]; +for (i = 0; i < GET_MODE_NUNITS (@var{m}); i++) + op0[i] = op1[i] ? op2[i] @var{op} op3[i] : op4[i]; @end smallexample where, for example, @var{op} is @code{+} for @samp{cond_add@var{mode}}. @@ -6364,8 +6372,9 @@ When defined for floating-point modes, the contents of @samp{op3[i]} are not interpreted if @var{op1[i]} is false, just like they would not be in a normal C @samp{?:} condition. -Operands 0, 2 and 3 all have mode @var{m}, while operand 1 has the mode -returned by @code{TARGET_VECTORIZE_GET_MASK_MODE}. +Operands 0, 2, 3 and 4 all have mode @var{m}. Operand 1 is a scalar +integer if @var{m} is scalar, otherwise it has the mode returned by +@code{TARGET_VECTORIZE_GET_MASK_MODE}. @cindex @code{neg@var{mode}cc} instruction pattern @item @samp{neg@var{mode}cc} |