diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -8989,6 +8989,50 @@ data, as is the case with the :ref:`vector ` data type. The result value has the same type as its operand. +.. _i_neg: + +'``neg``' Instruction +^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + = neg [nsw] [nuw] ; yields ty:result + + +Overview: +""""""""" + +The 'neg' instruction is a standard instruction that performs a two's complement negation operation on an integer value. + +The 'neg' instruction takes a single operand, which must be an integer value, and returns its negation. + + +Arguments: +"""""""""" + +The argument to the '``neg``' instruction must be a +:ref:`integer-value< ` or :ref:`vector `. + + +Semantics: +"""""""""" + +For a constant integer operand, the 'neg' instruction computes the two's complement negation of the operand and returns the result as a constant integer. + + +For a register or variable integer operand, the 'neg' instruction computes the two's complement negation of the operand and stores the result in the destination register or variable. + + +Example: +"""""""" + +.. code-block:: text + + = neg int %val ; yields int:result = -%var + .. _i_fneg: '``fneg``' Instruction