14031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman//===-- llvm/CodeGen/ISDOpcodes.h - CodeGen opcodes -------------*- C++ -*-===//
24031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman//
34031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman//                     The LLVM Compiler Infrastructure
44031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman//
54031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman// This file is distributed under the University of Illinois Open Source
64031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman// License. See LICENSE.TXT for details.
74031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman//
84031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman//===----------------------------------------------------------------------===//
94031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman//
104031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman// This file declares codegen opcodes and related utilities.
114031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman//
124031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman//===----------------------------------------------------------------------===//
134031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
144031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman#ifndef LLVM_CODEGEN_ISDOPCODES_H
154031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman#define LLVM_CODEGEN_ISDOPCODES_H
164031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
174031d59685cef09fad651dd39020ccca4c13ef89Dan Gohmannamespace llvm {
184031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
194031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman/// ISD namespace - This namespace contains an enum which represents all of the
204031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman/// SelectionDAG node types and value types.
214031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman///
224031d59685cef09fad651dd39020ccca4c13ef89Dan Gohmannamespace ISD {
234031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
244031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  //===--------------------------------------------------------------------===//
254031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// ISD::NodeType enum - This enum defines the target-independent operators
264031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// for a SelectionDAG.
274031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///
284031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// Targets may also define target-dependent operator codes for SDNodes. For
294031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// example, on x86, these are the enum values in the X86ISD namespace.
304031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// Targets should aim to use target-independent operators to model their
314031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// instruction sets as much as possible, and only use target-dependent
324031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// operators when they have special requirements.
334031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///
344031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// Finally, during and after selection proper, SNodes may use special
354031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// operator codes that correspond directly with MachineInstr opcodes. These
364031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// are used to represent selected instructions. See the isMachineOpcode()
374031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// and getMachineOpcode() member functions of SDNode.
384031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///
394031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  enum NodeType {
40f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// DELETED_NODE - This is an illegal value that is used to catch
41f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// errors.  This opcode is not a legal opcode for any node.
424031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    DELETED_NODE,
434031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
44f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// EntryToken - This is the marker used to indicate the start of a region.
454031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    EntryToken,
464031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
47f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// TokenFactor - This node takes multiple tokens as input and produces a
48f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// single token result. This is used to represent the fact that the operand
49f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// operators are independent of each other.
504031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TokenFactor,
514031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
52f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// AssertSext, AssertZext - These nodes record if a register contains a
53f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// value that has already been zero or sign extended from a narrower type.
54f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// These nodes take two operands.  The first is the node that has already
55f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// been extended, and the second is a value type node indicating the width
56f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// of the extension
574031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    AssertSext, AssertZext,
584031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
59f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Various leaf nodes.
609cf37e8b48732fccd4c301ed51aafed7074bd84eJakob Stoklund Olesen    BasicBlock, VALUETYPE, CONDCODE, Register, RegisterMask,
614031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    Constant, ConstantFP,
624031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    GlobalAddress, GlobalTLSAddress, FrameIndex,
634031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    JumpTable, ConstantPool, ExternalSymbol, BlockAddress,
644031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
65f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// The address of the GOT
664031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    GLOBAL_OFFSET_TABLE,
674031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
68f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and
69f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// llvm.returnaddress on the DAG.  These nodes take one operand, the index
70f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// of the frame or return address to return.  An index of zero corresponds
71f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// to the current function's frame or return address, an index of one to
72f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// the parent's frame or return address, and so on.
734031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FRAMEADDR, RETURNADDR,
744031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
75f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// FRAME_TO_ARGS_OFFSET - This node represents offset from frame pointer to
76f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// first (possible) on-stack argument. This is needed for correct stack
77f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// adjustment during unwind.
784031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FRAME_TO_ARGS_OFFSET,
794031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
80f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents
81f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// 'eh_return' gcc dwarf builtin, which is used to return from
82f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// exception. The general meaning is: adjust stack by OFFSET and pass
83f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// execution to HANDLER. Many platform-related details also :)
844031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    EH_RETURN,
854031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
86f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// RESULT, OUTCHAIN = EH_SJLJ_SETJMP(INCHAIN, buffer)
87f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// This corresponds to the eh.sjlj.setjmp intrinsic.
88f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// It takes an input chain and a pointer to the jump buffer as inputs
89f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// and returns an outchain.
9023ff7cff52702a8bff904d8ab4c9ca67cc19d6caJim Grosbach    EH_SJLJ_SETJMP,
915eb195153950bc7ebfc30649494a78b2096b5ef8Jim Grosbach
92f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// OUTCHAIN = EH_SJLJ_LONGJMP(INCHAIN, buffer)
93f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// This corresponds to the eh.sjlj.longjmp intrinsic.
94f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// It takes an input chain and a pointer to the jump buffer as inputs
95f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// and returns an outchain.
965eb195153950bc7ebfc30649494a78b2096b5ef8Jim Grosbach    EH_SJLJ_LONGJMP,
975eb195153950bc7ebfc30649494a78b2096b5ef8Jim Grosbach
98f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// TargetConstant* - Like Constant*, but the DAG does not do any folding,
99f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// simplification, or lowering of the constant. They are used for constants
100f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// which are known to fit in the immediate fields of their users, or for
101f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// carrying magic numbers which are not values which need to be
102f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// materialized in registers.
1034031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TargetConstant,
1044031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TargetConstantFP,
1054031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
106f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or
107f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// anything else with this node, and this is valid in the target-specific
108f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// dag, turning into a GlobalAddress operand.
1094031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TargetGlobalAddress,
1104031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TargetGlobalTLSAddress,
1114031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TargetFrameIndex,
1124031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TargetJumpTable,
1134031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TargetConstantPool,
1144031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TargetExternalSymbol,
1154031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TargetBlockAddress,
1164031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
11774500bdba3eae36a1a8a17d8bad0b971b9c212ecJakob Stoklund Olesen    /// TargetIndex - Like a constant pool entry, but with completely
11874500bdba3eae36a1a8a17d8bad0b971b9c212ecJakob Stoklund Olesen    /// target-dependent semantics. Holds target flags, a 32-bit index, and a
11974500bdba3eae36a1a8a17d8bad0b971b9c212ecJakob Stoklund Olesen    /// 64-bit index. Targets can use this however they like.
12074500bdba3eae36a1a8a17d8bad0b971b9c212ecJakob Stoklund Olesen    TargetIndex,
12174500bdba3eae36a1a8a17d8bad0b971b9c212ecJakob Stoklund Olesen
1224031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...)
1234031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// This node represents a target intrinsic function with no side effects.
1244031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// The first operand is the ID number of the intrinsic from the
1254031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// llvm::Intrinsic namespace.  The operands to the intrinsic follow.  The
1262bff8abbf2c02065556332d50c4e4cf86a09034dJim Grosbach    /// node returns the result of the intrinsic.
1274031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    INTRINSIC_WO_CHAIN,
1284031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
1294031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...)
1304031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// This node represents a target intrinsic function with side effects that
1314031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// returns a result.  The first operand is a chain pointer.  The second is
1324031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// the ID number of the intrinsic from the llvm::Intrinsic namespace.  The
1334031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// operands to the intrinsic follow.  The node has two results, the result
1344031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// of the intrinsic and an output chain.
1354031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    INTRINSIC_W_CHAIN,
1364031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
1374031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...)
1384031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// This node represents a target intrinsic function with side effects that
1394031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// does not return a result.  The first operand is a chain pointer.  The
1404031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// second is the ID number of the intrinsic from the llvm::Intrinsic
1414031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// namespace.  The operands to the intrinsic follow.
1424031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    INTRINSIC_VOID,
1434031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
144f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// CopyToReg - This node has three operands: a chain, a register number to
145f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// set to this value, and a value.
1464031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    CopyToReg,
1474031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
148f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// CopyFromReg - This node indicates that the input value is a virtual or
149f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// physical register that is defined outside of the scope of this
150f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// SelectionDAG.  The register is available from the RegisterSDNode object.
1514031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    CopyFromReg,
1524031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
153f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// UNDEF - An undefined node.
1544031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    UNDEF,
1554031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
156f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// EXTRACT_ELEMENT - This is used to get the lower or upper (determined by
157f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// a Constant, which is required to be operand #1) half of the integer or
158f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// float value specified as operand #0.  This is only for use before
159f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// legalization, for values that will be broken into multiple registers.
1604031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    EXTRACT_ELEMENT,
1614031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
162f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
163f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Given two values of the same integer value type, this produces a value
164f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// twice as big.  Like EXTRACT_ELEMENT, this can only be used before
165f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// legalization.
1664031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    BUILD_PAIR,
1674031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
168f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// MERGE_VALUES - This node takes multiple discrete operands and returns
169f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// them all as its individual results.  This nodes has exactly the same
170f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// number of inputs and outputs. This node is useful for some pieces of the
171f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// code generator that want to think about a single node with multiple
172f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// results, not multiple nodes.
1734031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    MERGE_VALUES,
1744031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
175f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Simple integer binary arithmetic operators.
1764031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ADD, SUB, MUL, SDIV, UDIV, SREM, UREM,
1774031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
178f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing
179f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// a signed/unsigned value of type i[2*N], and return the full value as
180f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// two results, each of type iN.
1814031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SMUL_LOHI, UMUL_LOHI,
1824031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
183f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// SDIVREM/UDIVREM - Divide two integers and produce both a quotient and
184f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// remainder result.
1854031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SDIVREM, UDIVREM,
1864031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
187f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// CARRY_FALSE - This node is used when folding other nodes,
188f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// like ADDC/SUBC, which indicate the carry result is always false.
1894031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    CARRY_FALSE,
1904031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
191f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Carry-setting nodes for multiple precision addition and subtraction.
192f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// These nodes take two operands of the same value type, and produce two
193f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// results.  The first result is the normal add or sub result, the second
194f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// result is the carry flag result.
1954031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ADDC, SUBC,
1964031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
197f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Carry-using nodes for multiple precision addition and subtraction. These
198f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// nodes take three operands: The first two are the normal lhs and rhs to
199f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// the add or sub, and the third is the input carry flag.  These nodes
200f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// produce two results; the normal result of the add or sub, and the output
201f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// carry flag.  These nodes both read and write a carry flag to allow them
202f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// to them to be chained together for add and sub of arbitrarily large
203f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// values.
2044031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ADDE, SUBE,
2054031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
206f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
207f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// These nodes take two operands: the normal LHS and RHS to the add. They
208f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// produce two results: the normal result of the add, and a boolean that
209f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// indicates if an overflow occurred (*not* a flag, because it may be store
210f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// to memory, etc.).  If the type of the boolean is not i1 then the high
211f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// bits conform to getBooleanContents.
212f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// These nodes are generated from llvm.[su]add.with.overflow intrinsics.
2134031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SADDO, UADDO,
2144031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
215f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Same for subtraction.
2164031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SSUBO, USUBO,
2174031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
218f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Same for multiplication.
2194031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SMULO, UMULO,
2204031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
221f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Simple binary floating point operators.
22233390848a7eca75301d04a59b89b516d83e19ee0Cameron Zwarich    FADD, FSUB, FMUL, FMA, FDIV, FREM,
2234031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
224f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.  NOTE: This
225f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// DAG node does not require that X and Y have the same type, just that the
226f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// are both floating point.  X and the result must have the same type.
227f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// FCOPYSIGN(f32, f64) is allowed.
2284031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FCOPYSIGN,
2294031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
230f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// INT = FGETSIGN(FP) - Return the sign bit of the specified floating point
231f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// value as an integer 0/1 value.
2324031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FGETSIGN,
2334031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
2344031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the
2354031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// specified, possibly variable, elements.  The number of elements is
2364031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// required to be a power of two.  The types of the operands must all be
2374031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// the same and must match the vector element type, except that integer
2384031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// types are allowed to be larger than the element type, in which case
2394031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// the operands are implicitly truncated.
2404031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    BUILD_VECTOR,
2414031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
2424031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element
2434031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// at IDX replaced with VAL.  If the type of VAL is larger than the vector
2444031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// element type then VAL is truncated before replacement.
2454031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    INSERT_VECTOR_ELT,
2464031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
2474031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR
2484031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// identified by the (potentially variable) element number IDX.  If the
2494031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// return type is an integer type larger than the element type of the
2504031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// vector, the result is extended to the width of the return type.
2514031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    EXTRACT_VECTOR_ELT,
2524031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
2534031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of
2544031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// vector type with the same length and element type, this produces a
2554031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// concatenated vector result value, with length equal to the sum of the
2564031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// lengths of the input vectors.
2574031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    CONCAT_VECTORS,
2584031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
259cfe33c46aa50f04adb0431243e7d25f79b719ac6David Greene    /// INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector
260cfe33c46aa50f04adb0431243e7d25f79b719ac6David Greene    /// with VECTOR2 inserted into VECTOR1 at the (potentially
261cfe33c46aa50f04adb0431243e7d25f79b719ac6David Greene    /// variable) element number IDX, which must be a multiple of the
262cfe33c46aa50f04adb0431243e7d25f79b719ac6David Greene    /// VECTOR2 vector length.  The elements of VECTOR1 starting at
263cfe33c46aa50f04adb0431243e7d25f79b719ac6David Greene    /// IDX are overwritten with VECTOR2.  Elements IDX through
264cfe33c46aa50f04adb0431243e7d25f79b719ac6David Greene    /// vector_length(VECTOR2) must be valid VECTOR1 indices.
265cfe33c46aa50f04adb0431243e7d25f79b719ac6David Greene    INSERT_SUBVECTOR,
266cfe33c46aa50f04adb0431243e7d25f79b719ac6David Greene
2674031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an
2686736e19f4c9af1181cedca54ba6e3a1420454928Bob Wilson    /// vector value) starting with the element number IDX, which must be a
2696736e19f4c9af1181cedca54ba6e3a1420454928Bob Wilson    /// constant multiple of the result vector length.
2704031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    EXTRACT_SUBVECTOR,
2714031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
272bf17cfa3f904e488e898ac2e3af706fd1a892f08Wesley Peck    /// VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as
2734031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// VEC1/VEC2.  A VECTOR_SHUFFLE node also contains an array of constant int
2744031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// values that indicate which value (or undef) each result element will
275bf17cfa3f904e488e898ac2e3af706fd1a892f08Wesley Peck    /// get.  These constant ints are accessible through the
276bf17cfa3f904e488e898ac2e3af706fd1a892f08Wesley Peck    /// ShuffleVectorSDNode class.  This is quite similar to the Altivec
2774031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// 'vperm' instruction, except that the indices must be constants and are
2784031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// in terms of the element size of VEC1/VEC2, not in terms of bytes.
2794031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    VECTOR_SHUFFLE,
2804031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
2814031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a
2824031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// scalar value into element 0 of the resultant vector type.  The top
2834031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// elements 1 to N-1 of the N-element vector are undefined.  The type
2844031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// of the operand must match the vector element type, except when they
2854031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// are integer types.  In this case the operand is allowed to be wider
2864031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// than the vector element type, and is implicitly truncated to it.
2874031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SCALAR_TO_VECTOR,
2884031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
289f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// MULHU/MULHS - Multiply high - Multiply two integers of type iN,
290f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// producing an unsigned/signed value of type i[2*N], then return the top
291f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// part.
2924031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    MULHU, MULHS,
2934031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
294e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    /// Bitwise operators - logical and, logical or, logical xor.
295e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    AND, OR, XOR,
296f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem
297e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    /// Shift and rotation operations.  After legalization, the type of the
298e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    /// shift amount is known to be TLI.getShiftAmountTy().  Before legalization
299e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    /// the shift amount can be any type, but care must be taken to ensure it is
300e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    /// large enough.  TLI.getShiftAmountTy() is i8 on some targets, but before
301e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    /// legalization, types like i1024 can occur and i8 doesn't have enough bits
302a6b20ced765b67a85d9219d0c8547fc9c133e14fMichael Liao    /// to represent the shift amount.
303a6b20ced765b67a85d9219d0c8547fc9c133e14fMichael Liao    /// When the 1st operand is a vector, the shift amount must be in the same
304a6b20ced765b67a85d9219d0c8547fc9c133e14fMichael Liao    /// type. (TLI.getShiftAmountTy() will return the same type when the input
305a6b20ced765b67a85d9219d0c8547fc9c133e14fMichael Liao    /// type is a vector.)
306e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    SHL, SRA, SRL, ROTL, ROTR,
307e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner
308e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    /// Byte Swap and Counting operators.
309e075118489baf15a7cea2e7f155b4799b93d6d02Chris Lattner    BSWAP, CTTZ, CTLZ, CTPOP,
3104031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
31163974b2144c87c962effdc0508c27643c8ad98b6Chandler Carruth    /// Bit counting operators with an undefined result for zero inputs.
31263974b2144c87c962effdc0508c27643c8ad98b6Chandler Carruth    CTTZ_ZERO_UNDEF, CTLZ_ZERO_UNDEF,
31363974b2144c87c962effdc0508c27643c8ad98b6Chandler Carruth
314f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Select(COND, TRUEVAL, FALSEVAL).  If the type of the boolean COND is not
315f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// i1 then the high bits must conform to getBooleanContents.
3164031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SELECT,
3174031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
318f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Select with a vector condition (op #0) and two vector operands (ops #1
319f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// and #2), returning a vector result.  All vectors have the same length.
320f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Much like the scalar select and setcc, each bit in the condition selects
321f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// whether the corresponding result element is taken from op #1 or op #2.
322f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// At first, the VSELECT condition is of vXi1 type. Later, targets may
323f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// change the condition type in order to match the VSELECT node using a
324f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// pattern. The condition follows the BooleanContent format of the target.
32528b77e968d2b01fc9da724762bd8ddcd80650e32Duncan Sands    VSELECT,
32628b77e968d2b01fc9da724762bd8ddcd80650e32Duncan Sands
327f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Select with condition operator - This selects between a true value and
328f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// a false value (ops #2 and #3) based on the boolean result of comparing
329f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// the lhs and rhs (ops #0 and #1) of a conditional expression with the
330f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// condition code in op #4, a CondCodeSDNode.
3314031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SELECT_CC,
3324031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
33394c22716d60ff5edf6a98a3c67e0faa001be1142Sylvestre Ledru    /// SetCC operator - This evaluates to a true value iff the condition is
334f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// true.  If the result value type is not i1 then the high bits conform
335f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// to getBooleanContents.  The operands to this are the left and right
336f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// operands to compare (ops #0, and #1) and the condition code to compare
337f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// them with (op #2) as a CondCodeSDNode. If the operands are vector types
338f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// then the result type must also be a vector type.
3394031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETCC,
3404031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
341f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded
342f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// integer shift operations, just like ADD/SUB_PARTS.  The operation
343f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// ordering is:
344f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///       [Lo,Hi] = op [LoLHS,HiLHS], Amt
3454031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SHL_PARTS, SRA_PARTS, SRL_PARTS,
3464031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
347f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Conversion operators.  These are all single input single output
348f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// operations.  For all of these, the result type must be strictly
349f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// wider or narrower (depending on the operation) than the source
350f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// type.
3514031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
352f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// SIGN_EXTEND - Used for integer types, replicating the sign bit
353f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// into new bits.
3544031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SIGN_EXTEND,
3554031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
356f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// ZERO_EXTEND - Used for integer types, zeroing the new bits.
3574031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ZERO_EXTEND,
3584031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
359f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// ANY_EXTEND - Used for integer types.  The high bits are undefined.
3604031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ANY_EXTEND,
3614031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
362f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// TRUNCATE - Completely drop the high bits.
3634031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TRUNCATE,
3644031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
365f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// [SU]INT_TO_FP - These operators convert integers (whose interpreted sign
366f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// depends on the first letter) to floating point.
3674031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SINT_TO_FP,
3684031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    UINT_TO_FP,
3694031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
370f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to
371f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// sign extend a small value in a large integer register (e.g. sign
372f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// extending the low 8 bits of a 32-bit register to fill the top 24 bits
373f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// with the 7th bit).  The size of the smaller type is indicated by the 1th
374f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// operand, a ValueType node.
3754031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SIGN_EXTEND_INREG,
3764031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
3774031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// FP_TO_[US]INT - Convert a floating point value to a signed or unsigned
3784031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// integer.
3794031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FP_TO_SINT,
3804031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FP_TO_UINT,
3814031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
3824031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type
3834031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// down to the precision of the destination VT.  TRUNC is a flag, which is
3844031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// always an integer that is zero or one.  If TRUNC is 0, this is a
3854031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// normal rounding, if it is 1, this FP_ROUND is known to not change the
3864031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// value of Y.
3874031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ///
3884031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// The TRUNC = 1 case is used in cases where we know that the value will
3894031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// not be modified by the node, because Y is not using any of the extra
3904031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// precision of source type.  This allows certain transformations like
3914031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// FP_EXTEND(FP_ROUND(X,1)) -> X which are not safe for
3924031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// FP_EXTEND(FP_ROUND(X,0)) because the extra bits aren't removed.
3934031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FP_ROUND,
3944031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
395f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// FLT_ROUNDS_ - Returns current rounding mode:
396f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// -1 Undefined
397f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///  0 Round to 0
398f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///  1 Round to nearest
399f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///  2 Round to +inf
400f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///  3 Round to -inf
4014031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FLT_ROUNDS_,
4024031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
4034031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// X = FP_ROUND_INREG(Y, VT) - This operator takes an FP register, and
4044031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// rounds it to a floating point value.  It then promotes it and returns it
4054031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// in a register of the same size.  This operation effectively just
4064031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// discards excess precision.  The type to round down to is specified by
4074031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// the VT operand, a VTSDNode.
4084031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FP_ROUND_INREG,
4094031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
4104031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
4114031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FP_EXTEND,
4124031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
413f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// BITCAST - This operator converts between integer, vector and FP
414f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// values, as if the value was stored to memory with one type and loaded
415f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// from the same address with the other type (or equivalently for vector
416f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// format conversions, etc).  The source and result are required to have
417f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// the same bit size (e.g.  f32 <-> i32).  This can also be used for
418f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// int-to-int or fp-to-fp conversions, but that is a noop, deleted by
419f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// getNode().
420bf17cfa3f904e488e898ac2e3af706fd1a892f08Wesley Peck    BITCAST,
4214031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
422f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// CONVERT_RNDSAT - This operator is used to support various conversions
423f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// between various types (float, signed, unsigned and vectors of those
424f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// types) with rounding and saturation. NOTE: Avoid using this operator as
425f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// most target don't support it and the operator might be removed in the
426f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// future. It takes the following arguments:
427f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   0) value
428f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   1) dest type (type to convert to)
429f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   2) src type (type to convert from)
430f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   3) rounding imm
431f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   4) saturation imm
432f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   5) ISD::CvtCode indicating the type of conversion to do
4334031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    CONVERT_RNDSAT,
4344031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
435f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// FP16_TO_FP32, FP32_TO_FP16 - These operators are used to perform
436f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// promotions and truncation for half-precision (16 bit) floating
437f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// numbers. We need special nodes since FP16 is a storage-only type with
438f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// special semantics of operations.
4394031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FP16_TO_FP32, FP32_TO_FP16,
4404031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
441f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW,
442f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// FLOG, FLOG2, FLOG10, FEXP, FEXP2,
443f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// FCEIL, FTRUNC, FRINT, FNEARBYINT, FFLOOR - Perform various unary
444f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// floating point operations. These are inspired by libm.
4454031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW,
4464031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FLOG, FLOG2, FLOG10, FEXP, FEXP2,
4474031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    FCEIL, FTRUNC, FRINT, FNEARBYINT, FFLOOR,
4488688a58c53b46d2dda9bf50dafd5195790a7ed58Evan Cheng
4498688a58c53b46d2dda9bf50dafd5195790a7ed58Evan Cheng    /// FSINCOS - Compute both fsin and fcos as a single operation.
4508688a58c53b46d2dda9bf50dafd5195790a7ed58Evan Cheng    FSINCOS,
4514031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
452f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// LOAD and STORE have token chains as their first operand, then the same
453f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// operands as an LLVM load/store instruction, then an offset node that
454f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// is added / subtracted from the base pointer to form the address (for
455f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// indexed memory ops).
4564031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    LOAD, STORE,
4574031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
458f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned
459f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// to a specified boundary.  This node always has two return values: a new
460f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// stack pointer value and a chain. The first operand is the token chain,
461f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// the second is the number of bytes to allocate, and the third is the
462f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// alignment boundary.  The size is guaranteed to be a multiple of the
463f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// stack alignment, and the alignment is guaranteed to be bigger than the
464f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// stack alignment (if required) or 0 to get standard stack alignment.
4654031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    DYNAMIC_STACKALLOC,
4664031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
467f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Control flow instructions.  These all have token chains.
4684031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
469f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// BR - Unconditional branch.  The first operand is the chain
470f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// operand, the second is the MBB to branch to.
4714031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    BR,
4724031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
473f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// BRIND - Indirect branch.  The first operand is the chain, the second
474f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// is the value to branch to, which must be of the same type as the
475f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// target's pointer type.
4764031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    BRIND,
4774031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
478f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// BR_JT - Jumptable branch. The first operand is the chain, the second
479f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// is the jumptable index, the last one is the jumptable entry index.
4804031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    BR_JT,
4814031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
482f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// BRCOND - Conditional branch.  The first operand is the chain, the
483f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// second is the condition, the third is the block to branch to if the
484f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// condition is true.  If the type of the condition is not i1, then the
485f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// high bits must conform to getBooleanContents.
4864031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    BRCOND,
4874031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
488f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// BR_CC - Conditional branch.  The behavior is like that of SELECT_CC, in
489f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// that the condition is represented as condition code, and two nodes to
490f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// compare, rather than as a combined SetCC node.  The operands in order
491f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// are chain, cc, lhs, rhs, block to branch to if condition is true.
4924031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    BR_CC,
4934031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
494f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// INLINEASM - Represents an inline asm block.  This node always has two
495f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// return values: a chain and a flag result.  The inputs are as follows:
496f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   Operand #0  : Input chain.
497f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   Operand #1  : a ExternalSymbolSDNode with a pointer to the asm string.
498f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   Operand #2  : a MDNodeSDNode with the !srcloc metadata.
499f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   Operand #3  : HasSideEffect, IsAlignStack bits.
500f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   After this, it is followed by a list of operands with this format:
501f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///     ConstantSDNode: Flags that encode whether it is a mem or not, the
502f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///                     of operands that follow, etc.  See InlineAsm.h.
503f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///     ... however many operands ...
504f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///   Operand #last: Optional, an incoming flag.
505f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    ///
506f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// The variable width operands are required to represent target addressing
507f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// modes as a single "operand", even though they may have multiple
508f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// SDOperands.
5094031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    INLINEASM,
5104031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
511f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// EH_LABEL - Represents a label in mid basic block used to track
512f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// locations needed for debug and exception handling tables.  These nodes
513f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// take a chain as input and return a chain.
5144031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    EH_LABEL,
5154031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
516f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// STACKSAVE - STACKSAVE has one operand, an input chain.  It produces a
517f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// value, the same type as the pointer type for the system, and an output
518f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// chain.
5194031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    STACKSAVE,
5204031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
521f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// STACKRESTORE has two operands, an input chain and a pointer to restore
522f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// to it returns an output chain.
5234031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    STACKRESTORE,
5244031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
525f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end
526f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// of a call sequence, and carry arbitrary information that target might
527f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// want to know.  The first operand is a chain, the rest are specified by
528f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// the target and not touched by the DAG optimizers.
529f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// CALLSEQ_START..CALLSEQ_END pairs may not be nested.
5304031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    CALLSEQ_START,  // Beginning of a call sequence
5314031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    CALLSEQ_END,    // End of a call sequence
5324031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
533f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE,
534f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// and the alignment. It returns a pair of values: the vaarg value and a
535f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// new chain.
5364031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    VAARG,
5374031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
538f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// VACOPY - VACOPY has 5 operands: an input chain, a destination pointer,
539f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the
540f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// source.
5414031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    VACOPY,
5424031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
543f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// VAEND, VASTART - VAEND and VASTART have three operands: an input chain,
544f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// pointer, and a SRCVALUE.
5454031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    VAEND, VASTART,
5464031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
547f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// SRCVALUE - This is a node type that holds a Value* that is used to
548f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// make reference to a value in the LLVM IR.
5494031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SRCVALUE,
550bf17cfa3f904e488e898ac2e3af706fd1a892f08Wesley Peck
551f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// MDNODE_SDNODE - This is a node that holdes an MDNode*, which is used to
552f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// reference metadata in the IR.
5534031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    MDNODE_SDNODE,
5544031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
555f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// PCMARKER - This corresponds to the pcmarker intrinsic.
5564031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    PCMARKER,
5574031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
558f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
559f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// The only operand is a chain and a value and a chain are produced.  The
560f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// value is the contents of the architecture specific cycle counter like
561f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// register (or other high accuracy low latency clock source)
5624031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    READCYCLECOUNTER,
5634031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
564f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// HANDLENODE node - Used as a handle for various purposes.
5654031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    HANDLENODE,
5664031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
567f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// INIT_TRAMPOLINE - This corresponds to the init_trampoline intrinsic.  It
568f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// takes as input a token chain, the pointer to the trampoline, the pointer
569f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// to the nested function, the pointer to pass for the 'nest' parameter, a
570f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// SRCVALUE for the trampoline and another for the nested function
571f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// (allowing targets to access the original Function*).
572f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// It produces a token chain as output.
5734a544a79bd735967f1d33fe675ae4566dbd17813Duncan Sands    INIT_TRAMPOLINE,
5744a544a79bd735967f1d33fe675ae4566dbd17813Duncan Sands
575f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// ADJUST_TRAMPOLINE - This corresponds to the adjust_trampoline intrinsic.
576f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// It takes a pointer to the trampoline and produces a (possibly) new
577f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// pointer to the same trampoline with platform-specific adjustments
578f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// applied.  The pointer it returns points to an executable block of code.
5794a544a79bd735967f1d33fe675ae4566dbd17813Duncan Sands    ADJUST_TRAMPOLINE,
5804031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
581f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// TRAP - Trapping instruction
5824031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    TRAP,
5834031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
584f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// DEBUGTRAP - Trap intended to get the attention of a debugger.
585a6063c6e29746d9425bdf46d680e28a48dcf58f9Dan Gohman    DEBUGTRAP,
586d4347e1af9141ec9f8e3e527367bfd16c0cc4ffbDan Gohman
587f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// PREFETCH - This corresponds to a prefetch intrinsic. The first operand
588f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// is the chain.  The other operands are the address to prefetch,
589f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// read / write specifier, locality specifier and instruction / data cache
590f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// specifier.
5914031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    PREFETCH,
5924031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
593f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope)
594f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// This corresponds to the fence instruction. It takes an input chain, and
595f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// two integer constants: an AtomicOrdering and a SynchronizationScope.
59614648468011c92a4210f8118721d58c25043daf8Eli Friedman    ATOMIC_FENCE,
59714648468011c92a4210f8118721d58c25043daf8Eli Friedman
598f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr)
599f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// This corresponds to "load atomic" instruction.
600327236cd6c211e54fc6288b0ac2b413901cc0611Eli Friedman    ATOMIC_LOAD,
601327236cd6c211e54fc6288b0ac2b413901cc0611Eli Friedman
602f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr, val)
603f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// This corresponds to "store atomic" instruction.
604327236cd6c211e54fc6288b0ac2b413901cc0611Eli Friedman    ATOMIC_STORE,
605327236cd6c211e54fc6288b0ac2b413901cc0611Eli Friedman
606f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap)
607f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// This corresponds to the cmpxchg instruction.
6084031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_CMP_SWAP,
6094031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
610f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt)
611f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amt)
612f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    /// These correspond to the atomicrmw instruction.
613327236cd6c211e54fc6288b0ac2b413901cc0611Eli Friedman    ATOMIC_SWAP,
6144031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_ADD,
6154031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_SUB,
6164031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_AND,
6174031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_OR,
6184031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_XOR,
6194031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_NAND,
6204031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_MIN,
6214031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_MAX,
6224031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_UMIN,
6234031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ATOMIC_LOAD_UMAX,
6244031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
625c05d30601ced172b55be81bb529df6be91d6ae15Nadav Rotem    /// This corresponds to the llvm.lifetime.* intrinsics. The first operand
626c05d30601ced172b55be81bb529df6be91d6ae15Nadav Rotem    /// is the chain and the second operand is the alloca pointer.
627c05d30601ced172b55be81bb529df6be91d6ae15Nadav Rotem    LIFETIME_START, LIFETIME_END,
628c05d30601ced172b55be81bb529df6be91d6ae15Nadav Rotem
6294031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// BUILTIN_OP_END - This must be the last enum value in this list.
6304031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    /// The target-specific pre-isel opcode values start here.
6314031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    BUILTIN_OP_END
6324031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  };
6334031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
6344031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// FIRST_TARGET_MEMORY_OPCODE - Target-specific pre-isel operations
6354031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// which do not reference a specific memory location should be less than
6364031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// this value. Those that do must not be less than this value, and can
6374031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// be used with SelectionDAG::getMemIntrinsicNode.
638c18f4efc5dd24adcc653806455fc7ae8508e9c66Elena Demikhovsky  static const int FIRST_TARGET_MEMORY_OPCODE = BUILTIN_OP_END+180;
6394031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
6404031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  //===--------------------------------------------------------------------===//
6414031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// MemIndexedMode enum - This enum defines the load / store indexed
6424031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// addressing modes.
6434031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///
6444031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// UNINDEXED    "Normal" load / store. The effective address is already
6454031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              computed and is available in the base pointer. The offset
6464031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              operand is always undefined. In addition to producing a
6474031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              chain, an unindexed load produces one value (result of the
6484031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              load); an unindexed store does not produce a value.
6494031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///
6504031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// PRE_INC      Similar to the unindexed mode where the effective address is
6514031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// PRE_DEC      the value of the base pointer add / subtract the offset.
6524031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              It considers the computation as being folded into the load /
6534031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              store operation (i.e. the load / store does the address
6544031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              computation as well as performing the memory transaction).
6554031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              The base operand is always undefined. In addition to
6564031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              producing a chain, pre-indexed load produces two values
6574031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              (result of the load and the result of the address
6584031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              computation); a pre-indexed store produces one value (result
6594031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              of the address computation).
6604031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///
6614031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// POST_INC     The effective address is the value of the base pointer. The
6624031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// POST_DEC     value of the offset operand is then added to / subtracted
6634031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              from the base after memory transaction. In addition to
6644031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              producing a chain, post-indexed load produces two values
6654031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              (the result of the load and the result of the base +/- offset
6664031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              computation); a post-indexed store produces one value (the
6674031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///              the result of the base +/- offset computation).
6684031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  enum MemIndexedMode {
6694031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    UNINDEXED = 0,
6704031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    PRE_INC,
6714031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    PRE_DEC,
6724031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    POST_INC,
6734031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    POST_DEC,
6744031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    LAST_INDEXED_MODE
6754031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  };
6764031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
6774031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  //===--------------------------------------------------------------------===//
6784031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// LoadExtType enum - This enum defines the three variants of LOADEXT
6794031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// (load with extension).
6804031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///
6814031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// SEXTLOAD loads the integer operand and sign extends it to a larger
6824031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///          integer result type.
6834031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// ZEXTLOAD loads the integer operand and zero extends it to a larger
6844031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///          integer result type.
68579976e9ff18265c5b8c991db0c2ff6d2edad94feBob Wilson  /// EXTLOAD  is used for two things: floating point extending loads and
68679976e9ff18265c5b8c991db0c2ff6d2edad94feBob Wilson  ///          integer extending loads [the top bits are undefined].
6874031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  enum LoadExtType {
6884031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    NON_EXTLOAD = 0,
6894031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    EXTLOAD,
6904031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SEXTLOAD,
6914031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    ZEXTLOAD,
6924031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    LAST_LOADEXT_TYPE
6934031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  };
6944031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
6954031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  //===--------------------------------------------------------------------===//
6964031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// ISD::CondCode enum - These are ordered carefully to make the bitfields
6974031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// below work out, when considering SETFALSE (something that never exists
6984031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// dynamically) as 0.  "U" -> Unsigned (for integer operands) or Unordered
6994031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// (for floating point), "L" -> Less than, "G" -> Greater than, "E" -> Equal
7004031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// to.  If the "N" column is 1, the result of the comparison is undefined if
7014031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// the input is a NAN.
7024031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///
7034031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// All of these (except for the 'always folded ops') should be handled for
7044031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// floating point.  For integer, only the SETEQ,SETNE,SETLT,SETLE,SETGT,
7054031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// SETGE,SETULT,SETULE,SETUGT, and SETUGE opcodes are used.
7064031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  ///
7074031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// Note that these are laid out in a specific order to allow bit-twiddling
7084031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// to transform conditions.
7094031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  enum CondCode {
7104031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    // Opcode          N U L G E       Intuitive operation
7114031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETFALSE,      //    0 0 0 0       Always false (always folded)
7124031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETOEQ,        //    0 0 0 1       True if ordered and equal
7134031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETOGT,        //    0 0 1 0       True if ordered and greater than
7144031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETOGE,        //    0 0 1 1       True if ordered and greater than or equal
7154031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETOLT,        //    0 1 0 0       True if ordered and less than
7164031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETOLE,        //    0 1 0 1       True if ordered and less than or equal
7174031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETONE,        //    0 1 1 0       True if ordered and operands are unequal
7184031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETO,          //    0 1 1 1       True if ordered (no nans)
7194031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETUO,         //    1 0 0 0       True if unordered: isnan(X) | isnan(Y)
7204031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETUEQ,        //    1 0 0 1       True if unordered or equal
7214031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETUGT,        //    1 0 1 0       True if unordered or greater than
7224031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETUGE,        //    1 0 1 1       True if unordered, greater than, or equal
7234031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETULT,        //    1 1 0 0       True if unordered or less than
7244031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETULE,        //    1 1 0 1       True if unordered, less than, or equal
7254031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETUNE,        //    1 1 1 0       True if unordered or not equal
7264031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETTRUE,       //    1 1 1 1       Always true (always folded)
7274031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    // Don't care operations: undefined if the input is a nan.
7284031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETFALSE2,     //  1 X 0 0 0       Always false (always folded)
7294031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETEQ,         //  1 X 0 0 1       True if equal
7304031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETGT,         //  1 X 0 1 0       True if greater than
7314031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETGE,         //  1 X 0 1 1       True if greater than or equal
7324031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETLT,         //  1 X 1 0 0       True if less than
7334031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETLE,         //  1 X 1 0 1       True if less than or equal
7344031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETNE,         //  1 X 1 1 0       True if not equal
7354031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETTRUE2,      //  1 X 1 1 1       Always true (always folded)
7364031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7374031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    SETCC_INVALID       // Marker value.
7384031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  };
7394031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7404031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// isSignedIntSetCC - Return true if this is a setcc instruction that
7414031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// performs a signed comparison when used with integer operands.
7424031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  inline bool isSignedIntSetCC(CondCode Code) {
7434031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    return Code == SETGT || Code == SETGE || Code == SETLT || Code == SETLE;
7444031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  }
7454031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7464031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// isUnsignedIntSetCC - Return true if this is a setcc instruction that
7474031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// performs an unsigned comparison when used with integer operands.
7484031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  inline bool isUnsignedIntSetCC(CondCode Code) {
7494031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    return Code == SETUGT || Code == SETUGE || Code == SETULT || Code == SETULE;
7504031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  }
7514031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7524031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// isTrueWhenEqual - Return true if the specified condition returns true if
7534031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// the two operands to the condition are equal.  Note that if one of the two
7544031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// operands is a NaN, this value is meaningless.
7554031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  inline bool isTrueWhenEqual(CondCode Cond) {
7564031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    return ((int)Cond & 1) != 0;
7574031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  }
7584031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7594031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// getUnorderedFlavor - This function returns 0 if the condition is always
7604031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// false if an operand is a NaN, 1 if the condition is always true if the
7614031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// operand is a NaN, and 2 if the condition is undefined if the operand is a
7624031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// NaN.
7634031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  inline unsigned getUnorderedFlavor(CondCode Cond) {
7644031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman    return ((int)Cond >> 3) & 3;
7654031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  }
7664031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7674031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// getSetCCInverse - Return the operation corresponding to !(X op Y), where
7684031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// 'op' is a valid SetCC operation.
7694031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  CondCode getSetCCInverse(CondCode Operation, bool isInteger);
7704031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7714031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// getSetCCSwappedOperands - Return the operation corresponding to (Y op X)
7724031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// when given the operation for (X op Y).
7734031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  CondCode getSetCCSwappedOperands(CondCode Operation);
7744031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7754031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// getSetCCOrOperation - Return the result of a logical OR between different
7764031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// comparisons of identical values: ((X op1 Y) | (X op2 Y)).  This
7774031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// function returns SETCC_INVALID if it is not possible to represent the
7784031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// resultant comparison.
7794031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  CondCode getSetCCOrOperation(CondCode Op1, CondCode Op2, bool isInteger);
7804031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7814031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// getSetCCAndOperation - Return the result of a logical AND between
7824031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// different comparisons of identical values: ((X op1 Y) & (X op2 Y)).  This
7834031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// function returns SETCC_INVALID if it is not possible to represent the
7844031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// resultant comparison.
7854031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, bool isInteger);
7864031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
7874031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  //===--------------------------------------------------------------------===//
7884031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// CvtCode enum - This enum defines the various converts CONVERT_RNDSAT
7894031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  /// supports.
7904031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  enum CvtCode {
791f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_FF,     /// Float from Float
792f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_FS,     /// Float from Signed
793f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_FU,     /// Float from Unsigned
794f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_SF,     /// Signed from Float
795f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_UF,     /// Unsigned from Float
796f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_SS,     /// Signed from Signed
797f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_SU,     /// Signed from Unsigned
798f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_US,     /// Unsigned from Signed
799f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_UU,     /// Unsigned from Unsigned
800f4341e4155e272ec7e72ff61e100bafb50fc8bd8Nadav Rotem    CVT_INVALID /// Marker - Invalid opcode
8014031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman  };
8024031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
8034031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman} // end llvm::ISD namespace
8044031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
8054031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman} // end llvm namespace
8064031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman
8074031d59685cef09fad651dd39020ccca4c13ef89Dan Gohman#endif
808