2010-04-14 20:44:34 +02:00
|
|
|
//===-- llvm/CodeGen/ISDOpcodes.h - CodeGen opcodes -------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2010-04-14 20:44:34 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares codegen opcodes and related utilities.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_ISDOPCODES_H
|
|
|
|
#define LLVM_CODEGEN_ISDOPCODES_H
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
/// ISD namespace - This namespace contains an enum which represents all of the
|
|
|
|
/// SelectionDAG node types and value types.
|
|
|
|
///
|
|
|
|
namespace ISD {
|
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
/// ISD::NodeType enum - This enum defines the target-independent operators
|
|
|
|
/// for a SelectionDAG.
|
|
|
|
///
|
|
|
|
/// Targets may also define target-dependent operator codes for SDNodes. For
|
|
|
|
/// example, on x86, these are the enum values in the X86ISD namespace.
|
|
|
|
/// Targets should aim to use target-independent operators to model their
|
|
|
|
/// instruction sets as much as possible, and only use target-dependent
|
|
|
|
/// operators when they have special requirements.
|
|
|
|
///
|
|
|
|
/// Finally, during and after selection proper, SNodes may use special
|
|
|
|
/// operator codes that correspond directly with MachineInstr opcodes. These
|
|
|
|
/// are used to represent selected instructions. See the isMachineOpcode()
|
|
|
|
/// and getMachineOpcode() member functions of SDNode.
|
|
|
|
///
|
|
|
|
enum NodeType {
|
2012-07-23 11:04:00 +02:00
|
|
|
/// DELETED_NODE - This is an illegal value that is used to catch
|
|
|
|
/// errors. This opcode is not a legal opcode for any node.
|
2010-04-14 20:44:34 +02:00
|
|
|
DELETED_NODE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// EntryToken - This is the marker used to indicate the start of a region.
|
2010-04-14 20:44:34 +02:00
|
|
|
EntryToken,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// TokenFactor - This node takes multiple tokens as input and produces a
|
|
|
|
/// single token result. This is used to represent the fact that the operand
|
|
|
|
/// operators are independent of each other.
|
2010-04-14 20:44:34 +02:00
|
|
|
TokenFactor,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// AssertSext, AssertZext - These nodes record if a register contains a
|
|
|
|
/// value that has already been zero or sign extended from a narrower type.
|
|
|
|
/// These nodes take two operands. The first is the node that has already
|
|
|
|
/// been extended, and the second is a value type node indicating the width
|
|
|
|
/// of the extension
|
2010-04-14 20:44:34 +02:00
|
|
|
AssertSext, AssertZext,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Various leaf nodes.
|
2012-01-19 00:52:12 +01:00
|
|
|
BasicBlock, VALUETYPE, CONDCODE, Register, RegisterMask,
|
2010-04-14 20:44:34 +02:00
|
|
|
Constant, ConstantFP,
|
|
|
|
GlobalAddress, GlobalTLSAddress, FrameIndex,
|
|
|
|
JumpTable, ConstantPool, ExternalSymbol, BlockAddress,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// The address of the GOT
|
2010-04-14 20:44:34 +02:00
|
|
|
GLOBAL_OFFSET_TABLE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and
|
|
|
|
/// llvm.returnaddress on the DAG. These nodes take one operand, the index
|
|
|
|
/// of the frame or return address to return. An index of zero corresponds
|
|
|
|
/// to the current function's frame or return address, an index of one to
|
|
|
|
/// the parent's frame or return address, and so on.
|
[COFF, ARM64] Implement Intrinsic.sponentry for AArch64
Summary: This patch adds Intrinsic.sponentry. This intrinsic is required to correctly support setjmp for AArch64 Windows platform.
Patch by: Yin Ma (yinma@codeaurora.org)
Reviewers: mgrang, ssijaric, eli.friedman, TomTan, mstorsjo, rnk, compnerd, efriedma
Reviewed By: efriedma
Subscribers: efriedma, javed.absar, kristof.beyls, chrib, llvm-commits
Differential Revision: https://reviews.llvm.org/D53996
llvm-svn: 345909
2018-11-02 00:22:25 +01:00
|
|
|
FRAMEADDR, RETURNADDR, ADDROFRETURNADDR, SPONENTRY,
|
2010-04-14 20:44:34 +02:00
|
|
|
|
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.
These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.
Naming suggestions at this point are welcome, I'm happy to re-run sed.
Reviewers: majnemer, nicholas
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11011
llvm-svn: 241633
2015-07-08 00:25:32 +02:00
|
|
|
/// LOCAL_RECOVER - Represents the llvm.localrecover intrinsic.
|
|
|
|
/// Materializes the offset from the local object pointer of another
|
|
|
|
/// function to a particular local object passed to llvm.localescape. The
|
|
|
|
/// operand is the MCSymbol label used to represent this offset, since
|
|
|
|
/// typically the offset is not known until after code generation of the
|
|
|
|
/// parent.
|
|
|
|
LOCAL_RECOVER,
|
2015-01-13 01:48:10 +01:00
|
|
|
|
2014-05-06 18:51:25 +02:00
|
|
|
/// READ_REGISTER, WRITE_REGISTER - This node represents llvm.register on
|
|
|
|
/// the DAG, which implements the named register global variables extension.
|
|
|
|
READ_REGISTER,
|
|
|
|
WRITE_REGISTER,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// FRAME_TO_ARGS_OFFSET - This node represents offset from frame pointer to
|
|
|
|
/// first (possible) on-stack argument. This is needed for correct stack
|
|
|
|
/// adjustment during unwind.
|
2010-04-14 20:44:34 +02:00
|
|
|
FRAME_TO_ARGS_OFFSET,
|
|
|
|
|
Add ISD::EH_DWARF_CFA, simplify @llvm.eh.dwarf.cfa on Mips, fix on PowerPC
LLVM has an @llvm.eh.dwarf.cfa intrinsic, used to lower the GCC-compatible
__builtin_dwarf_cfa() builtin. As pointed out in PR26761, this is currently
broken on PowerPC (and likely on ARM as well). Currently, @llvm.eh.dwarf.cfa is
lowered using:
ADD(FRAMEADDR, FRAME_TO_ARGS_OFFSET)
where FRAME_TO_ARGS_OFFSET defaults to the constant zero. On x86,
FRAME_TO_ARGS_OFFSET is lowered to 2*SlotSize. This setup, however, does not
work for PowerPC. Because of the way that the stack layout works, the canonical
frame address is not exactly (FRAMEADDR + FRAME_TO_ARGS_OFFSET) on PowerPC
(there is a lower save-area offset as well), so it is not just a matter of
implementing FRAME_TO_ARGS_OFFSET for PowerPC (unless we redefine its
semantics -- We can do that, since it is currently used only for
@llvm.eh.dwarf.cfa lowering, but the better to directly lower the CFA construct
itself (since it can be easily represented as a fixed-offset FrameIndex)). Mips
currently does this, but by using a custom lowering for ADD that specifically
recognizes the (FRAMEADDR, FRAME_TO_ARGS_OFFSET) pattern.
This change introduces a ISD::EH_DWARF_CFA node, which by default expands using
the existing logic, but can be directly lowered by the target. Mips is updated
to use this method (which simplifies its implementation, and I suspect makes it
more robust), and updates PowerPC to do the same.
Fixes PR26761.
Differential Revision: https://reviews.llvm.org/D24038
llvm-svn: 280350
2016-09-01 12:28:47 +02:00
|
|
|
/// EH_DWARF_CFA - This node represents the pointer to the DWARF Canonical
|
|
|
|
/// Frame Address (CFA), generally the value of the stack pointer at the
|
|
|
|
/// call site in the previous frame.
|
|
|
|
EH_DWARF_CFA,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents
|
|
|
|
/// 'eh_return' gcc dwarf builtin, which is used to return from
|
|
|
|
/// exception. The general meaning is: adjust stack by OFFSET and pass
|
|
|
|
/// execution to HANDLER. Many platform-related details also :)
|
2010-04-14 20:44:34 +02:00
|
|
|
EH_RETURN,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// RESULT, OUTCHAIN = EH_SJLJ_SETJMP(INCHAIN, buffer)
|
|
|
|
/// This corresponds to the eh.sjlj.setjmp intrinsic.
|
|
|
|
/// It takes an input chain and a pointer to the jump buffer as inputs
|
|
|
|
/// and returns an outchain.
|
2010-05-26 22:22:18 +02:00
|
|
|
EH_SJLJ_SETJMP,
|
2010-05-22 03:06:18 +02:00
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// OUTCHAIN = EH_SJLJ_LONGJMP(INCHAIN, buffer)
|
|
|
|
/// This corresponds to the eh.sjlj.longjmp intrinsic.
|
|
|
|
/// It takes an input chain and a pointer to the jump buffer as inputs
|
|
|
|
/// and returns an outchain.
|
2010-05-22 03:06:18 +02:00
|
|
|
EH_SJLJ_LONGJMP,
|
|
|
|
|
2015-07-17 00:34:16 +02:00
|
|
|
/// OUTCHAIN = EH_SJLJ_SETUP_DISPATCH(INCHAIN)
|
|
|
|
/// The target initializes the dispatch table here.
|
|
|
|
EH_SJLJ_SETUP_DISPATCH,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// TargetConstant* - Like Constant*, but the DAG does not do any folding,
|
|
|
|
/// simplification, or lowering of the constant. They are used for constants
|
|
|
|
/// which are known to fit in the immediate fields of their users, or for
|
|
|
|
/// carrying magic numbers which are not values which need to be
|
|
|
|
/// materialized in registers.
|
2010-04-14 20:44:34 +02:00
|
|
|
TargetConstant,
|
|
|
|
TargetConstantFP,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or
|
|
|
|
/// anything else with this node, and this is valid in the target-specific
|
|
|
|
/// dag, turning into a GlobalAddress operand.
|
2010-04-14 20:44:34 +02:00
|
|
|
TargetGlobalAddress,
|
|
|
|
TargetGlobalTLSAddress,
|
|
|
|
TargetFrameIndex,
|
|
|
|
TargetJumpTable,
|
|
|
|
TargetConstantPool,
|
|
|
|
TargetExternalSymbol,
|
|
|
|
TargetBlockAddress,
|
|
|
|
|
2015-06-22 19:46:53 +02:00
|
|
|
MCSymbol,
|
|
|
|
|
2012-08-08 00:37:05 +02:00
|
|
|
/// TargetIndex - Like a constant pool entry, but with completely
|
|
|
|
/// target-dependent semantics. Holds target flags, a 32-bit index, and a
|
|
|
|
/// 64-bit index. Targets can use this however they like.
|
|
|
|
TargetIndex,
|
|
|
|
|
2010-04-14 20:44:34 +02:00
|
|
|
/// RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...)
|
|
|
|
/// This node represents a target intrinsic function with no side effects.
|
|
|
|
/// The first operand is the ID number of the intrinsic from the
|
|
|
|
/// llvm::Intrinsic namespace. The operands to the intrinsic follow. The
|
2010-06-18 19:40:42 +02:00
|
|
|
/// node returns the result of the intrinsic.
|
2010-04-14 20:44:34 +02:00
|
|
|
INTRINSIC_WO_CHAIN,
|
|
|
|
|
|
|
|
/// RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...)
|
|
|
|
/// This node represents a target intrinsic function with side effects that
|
|
|
|
/// returns a result. The first operand is a chain pointer. The second is
|
|
|
|
/// the ID number of the intrinsic from the llvm::Intrinsic namespace. The
|
|
|
|
/// operands to the intrinsic follow. The node has two results, the result
|
|
|
|
/// of the intrinsic and an output chain.
|
|
|
|
INTRINSIC_W_CHAIN,
|
|
|
|
|
|
|
|
/// OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...)
|
|
|
|
/// This node represents a target intrinsic function with side effects that
|
|
|
|
/// does not return a result. The first operand is a chain pointer. The
|
|
|
|
/// second is the ID number of the intrinsic from the llvm::Intrinsic
|
|
|
|
/// namespace. The operands to the intrinsic follow.
|
|
|
|
INTRINSIC_VOID,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// CopyToReg - This node has three operands: a chain, a register number to
|
|
|
|
/// set to this value, and a value.
|
2010-04-14 20:44:34 +02:00
|
|
|
CopyToReg,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// CopyFromReg - This node indicates that the input value is a virtual or
|
|
|
|
/// physical register that is defined outside of the scope of this
|
|
|
|
/// SelectionDAG. The register is available from the RegisterSDNode object.
|
2010-04-14 20:44:34 +02:00
|
|
|
CopyFromReg,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// UNDEF - An undefined node.
|
2010-04-14 20:44:34 +02:00
|
|
|
UNDEF,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// EXTRACT_ELEMENT - This is used to get the lower or upper (determined by
|
|
|
|
/// a Constant, which is required to be operand #1) half of the integer or
|
|
|
|
/// float value specified as operand #0. This is only for use before
|
|
|
|
/// legalization, for values that will be broken into multiple registers.
|
2010-04-14 20:44:34 +02:00
|
|
|
EXTRACT_ELEMENT,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
|
|
|
|
/// Given two values of the same integer value type, this produces a value
|
|
|
|
/// twice as big. Like EXTRACT_ELEMENT, this can only be used before
|
[DAGCombine] Handle big endian correctly in CombineConsecutiveLoads
Summary:
Found out, at code inspection, that there was a fault in
DAGCombiner::CombineConsecutiveLoads for big-endian targets.
A BUILD_PAIR is always having the least significant bits of
the composite value in element 0. So when we are doing the checks
for consecutive loads, for big endian targets, we should check
if the load to elt 1 is at the lower address and the load
to elt 0 is at the higher address.
Normally this bug only resulted in missed oppurtunities for
doing the load combine. I guess that in some rare situation it
could lead to faulty combines, but I've not seen that happen.
Note that this patch actually will trigger load combine for
some big endian regression tests.
One example is test/CodeGen/PowerPC/anon_aggr.ll where we now get
t76: i64,ch = load<LD8[FixedStack-9]
instead of
t37: i32,ch = load<LD4[FixedStack-10]>
t35: i32,ch = load<LD4[FixedStack-9]>
t41: i64 = build_pair t37, t35
before legalization. Then the legalization will split the LD8
into two loads, so the end result is the same. That should
verify that the transfomation is correct now.
Reviewers: niravd, hfinkel
Reviewed By: niravd
Subscribers: nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D40444
llvm-svn: 319771
2017-12-05 15:50:05 +01:00
|
|
|
/// legalization. The lower part of the composite value should be in
|
|
|
|
/// element 0 and the upper part should be in element 1.
|
2010-04-14 20:44:34 +02:00
|
|
|
BUILD_PAIR,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// MERGE_VALUES - This node takes multiple discrete operands and returns
|
|
|
|
/// them all as its individual results. This nodes has exactly the same
|
|
|
|
/// number of inputs and outputs. This node is useful for some pieces of the
|
|
|
|
/// code generator that want to think about a single node with multiple
|
|
|
|
/// results, not multiple nodes.
|
2010-04-14 20:44:34 +02:00
|
|
|
MERGE_VALUES,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Simple integer binary arithmetic operators.
|
2010-04-14 20:44:34 +02:00
|
|
|
ADD, SUB, MUL, SDIV, UDIV, SREM, UREM,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing
|
|
|
|
/// a signed/unsigned value of type i[2*N], and return the full value as
|
|
|
|
/// two results, each of type iN.
|
2010-04-14 20:44:34 +02:00
|
|
|
SMUL_LOHI, UMUL_LOHI,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// SDIVREM/UDIVREM - Divide two integers and produce both a quotient and
|
|
|
|
/// remainder result.
|
2010-04-14 20:44:34 +02:00
|
|
|
SDIVREM, UDIVREM,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// CARRY_FALSE - This node is used when folding other nodes,
|
|
|
|
/// like ADDC/SUBC, which indicate the carry result is always false.
|
2010-04-14 20:44:34 +02:00
|
|
|
CARRY_FALSE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Carry-setting nodes for multiple precision addition and subtraction.
|
|
|
|
/// These nodes take two operands of the same value type, and produce two
|
|
|
|
/// results. The first result is the normal add or sub result, the second
|
|
|
|
/// result is the carry flag result.
|
2017-04-30 21:24:09 +02:00
|
|
|
/// FIXME: These nodes are deprecated in favor of ADDCARRY and SUBCARRY.
|
|
|
|
/// They are kept around for now to provide a smooth transition path
|
|
|
|
/// toward the use of ADDCARRY/SUBCARRY and will eventually be removed.
|
2010-04-14 20:44:34 +02:00
|
|
|
ADDC, SUBC,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Carry-using nodes for multiple precision addition and subtraction. These
|
|
|
|
/// nodes take three operands: The first two are the normal lhs and rhs to
|
|
|
|
/// the add or sub, and the third is the input carry flag. These nodes
|
|
|
|
/// produce two results; the normal result of the add or sub, and the output
|
|
|
|
/// carry flag. These nodes both read and write a carry flag to allow them
|
|
|
|
/// to them to be chained together for add and sub of arbitrarily large
|
|
|
|
/// values.
|
2010-04-14 20:44:34 +02:00
|
|
|
ADDE, SUBE,
|
|
|
|
|
2017-04-30 21:24:09 +02:00
|
|
|
/// Carry-using nodes for multiple precision addition and subtraction.
|
|
|
|
/// These nodes take three operands: The first two are the normal lhs and
|
|
|
|
/// rhs to the add or sub, and the third is a boolean indicating if there
|
|
|
|
/// is an incoming carry. These nodes produce two results: the normal
|
|
|
|
/// result of the add or sub, and the output carry so they can be chained
|
|
|
|
/// together. The use of this opcode is preferable to adde/sube if the
|
|
|
|
/// target supports it, as the carry is a regular value rather than a
|
|
|
|
/// glue, which allows further optimisation.
|
|
|
|
ADDCARRY, SUBCARRY,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
|
|
|
|
/// These nodes take two operands: the normal LHS and RHS to the add. They
|
|
|
|
/// produce two results: the normal result of the add, and a boolean that
|
|
|
|
/// indicates if an overflow occurred (*not* a flag, because it may be store
|
|
|
|
/// to memory, etc.). If the type of the boolean is not i1 then the high
|
|
|
|
/// bits conform to getBooleanContents.
|
|
|
|
/// These nodes are generated from llvm.[su]add.with.overflow intrinsics.
|
2010-04-14 20:44:34 +02:00
|
|
|
SADDO, UADDO,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Same for subtraction.
|
2010-04-14 20:44:34 +02:00
|
|
|
SSUBO, USUBO,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Same for multiplication.
|
2010-04-14 20:44:34 +02:00
|
|
|
SMULO, UMULO,
|
|
|
|
|
2018-10-23 01:08:40 +02:00
|
|
|
/// RESULT = [US]ADDSAT(LHS, RHS) - Perform saturation addition on 2
|
2018-10-16 19:35:41 +02:00
|
|
|
/// integers with the same bit width (W). If the true value of LHS + RHS
|
2018-10-23 01:08:40 +02:00
|
|
|
/// exceeds the largest value that can be represented by W bits, the
|
2018-10-16 19:35:41 +02:00
|
|
|
/// resulting value is this maximum value. Otherwise, if this value is less
|
2018-10-23 01:08:40 +02:00
|
|
|
/// than the smallest value that can be represented by W bits, the
|
2018-10-16 19:35:41 +02:00
|
|
|
/// resulting value is this minimum value.
|
2018-10-23 01:08:40 +02:00
|
|
|
SADDSAT, UADDSAT,
|
2018-10-16 19:35:41 +02:00
|
|
|
|
2018-10-29 17:54:37 +01:00
|
|
|
/// RESULT = [US]SUBSAT(LHS, RHS) - Perform saturation subtraction on 2
|
|
|
|
/// integers with the same bit width (W). If the true value of LHS - RHS
|
|
|
|
/// exceeds the largest value that can be represented by W bits, the
|
|
|
|
/// resulting value is this maximum value. Otherwise, if this value is less
|
|
|
|
/// than the smallest value that can be represented by W bits, the
|
|
|
|
/// resulting value is this minimum value.
|
|
|
|
SSUBSAT, USUBSAT,
|
|
|
|
|
2019-02-04 18:18:11 +01:00
|
|
|
/// RESULT = [US]MULFIX(LHS, RHS, SCALE) - Perform fixed point multiplication on
|
2018-12-12 07:29:14 +01:00
|
|
|
/// 2 integers with the same width and scale. SCALE represents the scale of
|
|
|
|
/// both operands as fixed point numbers. This SCALE parameter must be a
|
|
|
|
/// constant integer. A scale of zero is effectively performing
|
|
|
|
/// multiplication on 2 integers.
|
2019-02-04 18:18:11 +01:00
|
|
|
SMULFIX, UMULFIX,
|
2018-12-12 07:29:14 +01:00
|
|
|
|
2019-05-21 21:17:19 +02:00
|
|
|
/// Same as the corresponding unsaturated fixed point instructions, but the
|
|
|
|
/// result is clamped between the min and max values representable by the
|
|
|
|
/// bits of the first 2 operands.
|
|
|
|
SMULFIXSAT,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Simple binary floating point operators.
|
2015-02-20 23:10:33 +01:00
|
|
|
FADD, FSUB, FMUL, FDIV, FREM,
|
|
|
|
|
2017-01-27 00:27:59 +01:00
|
|
|
/// Constrained versions of the binary floating point operators.
|
|
|
|
/// These will be lowered to the simple operators before final selection.
|
|
|
|
/// They are used to limit optimizations while the DAG is being
|
|
|
|
/// optimized.
|
|
|
|
STRICT_FADD, STRICT_FSUB, STRICT_FMUL, STRICT_FDIV, STRICT_FREM,
|
2017-08-24 06:18:24 +02:00
|
|
|
STRICT_FMA,
|
2017-01-27 00:27:59 +01:00
|
|
|
|
2017-05-25 23:31:00 +02:00
|
|
|
/// Constrained versions of libm-equivalent floating point intrinsics.
|
|
|
|
/// These will be lowered to the equivalent non-constrained pseudo-op
|
|
|
|
/// (or expanded to the equivalent library call) before final selection.
|
|
|
|
/// They are used to limit optimizations while the DAG is being optimized.
|
|
|
|
STRICT_FSQRT, STRICT_FPOW, STRICT_FPOWI, STRICT_FSIN, STRICT_FCOS,
|
|
|
|
STRICT_FEXP, STRICT_FEXP2, STRICT_FLOG, STRICT_FLOG10, STRICT_FLOG2,
|
2018-10-30 22:01:29 +01:00
|
|
|
STRICT_FRINT, STRICT_FNEARBYINT, STRICT_FMAXNUM, STRICT_FMINNUM,
|
2018-11-05 16:59:49 +01:00
|
|
|
STRICT_FCEIL, STRICT_FFLOOR, STRICT_FROUND, STRICT_FTRUNC,
|
2017-05-25 23:31:00 +02:00
|
|
|
|
2019-05-13 15:23:30 +02:00
|
|
|
/// X = STRICT_FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating
|
|
|
|
/// point type down to the precision of the destination VT. TRUNC is a
|
|
|
|
/// flag, which is always an integer that is zero or one. If TRUNC is 0,
|
|
|
|
/// this is a normal rounding, if it is 1, this FP_ROUND is known to not
|
|
|
|
/// change the value of Y.
|
|
|
|
///
|
|
|
|
/// The TRUNC = 1 case is used in cases where we know that the value will
|
|
|
|
/// not be modified by the node, because Y is not using any of the extra
|
|
|
|
/// precision of source type. This allows certain transformations like
|
|
|
|
/// STRICT_FP_EXTEND(STRICT_FP_ROUND(X,1)) -> X which are not safe for
|
|
|
|
/// STRICT_FP_EXTEND(STRICT_FP_ROUND(X,0)) because the extra bits aren't
|
|
|
|
/// removed.
|
|
|
|
/// It is used to limit optimizations while the DAG is being optimized.
|
|
|
|
STRICT_FP_ROUND,
|
|
|
|
|
|
|
|
/// X = STRICT_FP_EXTEND(Y) - Extend a smaller FP type into a larger FP
|
|
|
|
/// type.
|
|
|
|
/// It is used to limit optimizations while the DAG is being optimized.
|
|
|
|
STRICT_FP_EXTEND,
|
|
|
|
|
2015-02-20 23:10:33 +01:00
|
|
|
/// FMA - Perform a * b + c with no intermediate rounding step.
|
|
|
|
FMA,
|
|
|
|
|
|
|
|
/// FMAD - Perform a * b + c, while getting the same result as the
|
|
|
|
/// separately rounded operations.
|
|
|
|
FMAD,
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// FCOPYSIGN(X, Y) - Return the value of X with the sign of Y. NOTE: This
|
2015-04-30 01:33:32 +02:00
|
|
|
/// DAG node does not require that X and Y have the same type, just that
|
|
|
|
/// they are both floating point. X and the result must have the same type.
|
2012-07-23 11:04:00 +02:00
|
|
|
/// FCOPYSIGN(f32, f64) is allowed.
|
2010-04-14 20:44:34 +02:00
|
|
|
FCOPYSIGN,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// INT = FGETSIGN(FP) - Return the sign bit of the specified floating point
|
|
|
|
/// value as an integer 0/1 value.
|
2010-04-14 20:44:34 +02:00
|
|
|
FGETSIGN,
|
|
|
|
|
2016-04-14 03:42:16 +02:00
|
|
|
/// Returns platform specific canonical encoding of a floating point number.
|
|
|
|
FCANONICALIZE,
|
|
|
|
|
2010-04-14 20:44:34 +02:00
|
|
|
/// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the
|
|
|
|
/// specified, possibly variable, elements. The number of elements is
|
|
|
|
/// required to be a power of two. The types of the operands must all be
|
|
|
|
/// the same and must match the vector element type, except that integer
|
|
|
|
/// types are allowed to be larger than the element type, in which case
|
|
|
|
/// the operands are implicitly truncated.
|
|
|
|
BUILD_VECTOR,
|
|
|
|
|
|
|
|
/// INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element
|
|
|
|
/// at IDX replaced with VAL. If the type of VAL is larger than the vector
|
|
|
|
/// element type then VAL is truncated before replacement.
|
|
|
|
INSERT_VECTOR_ELT,
|
|
|
|
|
|
|
|
/// EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR
|
|
|
|
/// identified by the (potentially variable) element number IDX. If the
|
|
|
|
/// return type is an integer type larger than the element type of the
|
2017-01-24 15:21:29 +01:00
|
|
|
/// vector, the result is extended to the width of the return type. In
|
|
|
|
/// that case, the high bits are undefined.
|
2010-04-14 20:44:34 +02:00
|
|
|
EXTRACT_VECTOR_ELT,
|
|
|
|
|
|
|
|
/// CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of
|
|
|
|
/// vector type with the same length and element type, this produces a
|
|
|
|
/// concatenated vector result value, with length equal to the sum of the
|
|
|
|
/// lengths of the input vectors.
|
|
|
|
CONCAT_VECTORS,
|
|
|
|
|
2011-01-26 20:13:22 +01:00
|
|
|
/// INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector
|
|
|
|
/// with VECTOR2 inserted into VECTOR1 at the (potentially
|
|
|
|
/// variable) element number IDX, which must be a multiple of the
|
|
|
|
/// VECTOR2 vector length. The elements of VECTOR1 starting at
|
|
|
|
/// IDX are overwritten with VECTOR2. Elements IDX through
|
|
|
|
/// vector_length(VECTOR2) must be valid VECTOR1 indices.
|
|
|
|
INSERT_SUBVECTOR,
|
|
|
|
|
2010-04-14 20:44:34 +02:00
|
|
|
/// EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an
|
2011-01-07 05:58:56 +01:00
|
|
|
/// vector value) starting with the element number IDX, which must be a
|
|
|
|
/// constant multiple of the result vector length.
|
2010-04-14 20:44:34 +02:00
|
|
|
EXTRACT_SUBVECTOR,
|
|
|
|
|
2010-11-23 04:31:01 +01:00
|
|
|
/// VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as
|
2010-04-14 20:44:34 +02:00
|
|
|
/// VEC1/VEC2. A VECTOR_SHUFFLE node also contains an array of constant int
|
|
|
|
/// values that indicate which value (or undef) each result element will
|
2010-11-23 04:31:01 +01:00
|
|
|
/// get. These constant ints are accessible through the
|
|
|
|
/// ShuffleVectorSDNode class. This is quite similar to the Altivec
|
2010-04-14 20:44:34 +02:00
|
|
|
/// 'vperm' instruction, except that the indices must be constants and are
|
|
|
|
/// in terms of the element size of VEC1/VEC2, not in terms of bytes.
|
|
|
|
VECTOR_SHUFFLE,
|
|
|
|
|
|
|
|
/// SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a
|
|
|
|
/// scalar value into element 0 of the resultant vector type. The top
|
|
|
|
/// elements 1 to N-1 of the N-element vector are undefined. The type
|
|
|
|
/// of the operand must match the vector element type, except when they
|
|
|
|
/// are integer types. In this case the operand is allowed to be wider
|
|
|
|
/// than the vector element type, and is implicitly truncated to it.
|
|
|
|
SCALAR_TO_VECTOR,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// MULHU/MULHS - Multiply high - Multiply two integers of type iN,
|
|
|
|
/// producing an unsigned/signed value of type i[2*N], then return the top
|
|
|
|
/// part.
|
2010-04-14 20:44:34 +02:00
|
|
|
MULHU, MULHS,
|
|
|
|
|
2015-05-15 11:03:15 +02:00
|
|
|
/// [US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned
|
|
|
|
/// integers.
|
|
|
|
SMIN, SMAX, UMIN, UMAX,
|
|
|
|
|
2011-02-13 20:09:16 +01:00
|
|
|
/// Bitwise operators - logical and, logical or, logical xor.
|
|
|
|
AND, OR, XOR,
|
2012-07-23 11:04:00 +02:00
|
|
|
|
2017-03-14 22:26:58 +01:00
|
|
|
/// ABS - Determine the unsigned absolute value of a signed integer value of
|
|
|
|
/// the same bitwidth.
|
|
|
|
/// Note: A value of INT_MIN will return INT_MIN, no saturation or overflow
|
|
|
|
/// is performed.
|
|
|
|
ABS,
|
|
|
|
|
2011-02-13 20:09:16 +01:00
|
|
|
/// Shift and rotation operations. After legalization, the type of the
|
|
|
|
/// shift amount is known to be TLI.getShiftAmountTy(). Before legalization
|
|
|
|
/// the shift amount can be any type, but care must be taken to ensure it is
|
|
|
|
/// large enough. TLI.getShiftAmountTy() is i8 on some targets, but before
|
|
|
|
/// legalization, types like i1024 can occur and i8 doesn't have enough bits
|
2013-03-01 19:40:30 +01:00
|
|
|
/// to represent the shift amount.
|
|
|
|
/// When the 1st operand is a vector, the shift amount must be in the same
|
|
|
|
/// type. (TLI.getShiftAmountTy() will return the same type when the input
|
|
|
|
/// type is a vector.)
|
2018-12-05 12:12:12 +01:00
|
|
|
/// For rotates and funnel shifts, the shift amount is treated as an unsigned
|
|
|
|
/// amount modulo the element size of the first operand.
|
|
|
|
///
|
|
|
|
/// Funnel 'double' shifts take 3 operands, 2 inputs and the shift amount.
|
|
|
|
/// fshl(X,Y,Z): (X << (Z % BW)) | (Y >> (BW - (Z % BW)))
|
|
|
|
/// fshr(X,Y,Z): (X << (BW - (Z % BW))) | (Y >> (Z % BW))
|
|
|
|
SHL, SRA, SRL, ROTL, ROTR, FSHL, FSHR,
|
2011-02-13 20:09:16 +01:00
|
|
|
|
|
|
|
/// Byte Swap and Counting operators.
|
2015-11-12 13:29:09 +01:00
|
|
|
BSWAP, CTTZ, CTLZ, CTPOP, BITREVERSE,
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2011-12-13 02:56:10 +01:00
|
|
|
/// Bit counting operators with an undefined result for zero inputs.
|
|
|
|
CTTZ_ZERO_UNDEF, CTLZ_ZERO_UNDEF,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Select(COND, TRUEVAL, FALSEVAL). If the type of the boolean COND is not
|
|
|
|
/// i1 then the high bits must conform to getBooleanContents.
|
2010-04-14 20:44:34 +02:00
|
|
|
SELECT,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Select with a vector condition (op #0) and two vector operands (ops #1
|
|
|
|
/// and #2), returning a vector result. All vectors have the same length.
|
|
|
|
/// Much like the scalar select and setcc, each bit in the condition selects
|
|
|
|
/// whether the corresponding result element is taken from op #1 or op #2.
|
|
|
|
/// At first, the VSELECT condition is of vXi1 type. Later, targets may
|
|
|
|
/// change the condition type in order to match the VSELECT node using a
|
|
|
|
/// pattern. The condition follows the BooleanContent format of the target.
|
2011-09-06 21:07:46 +02:00
|
|
|
VSELECT,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Select with condition operator - This selects between a true value and
|
|
|
|
/// a false value (ops #2 and #3) based on the boolean result of comparing
|
|
|
|
/// the lhs and rhs (ops #0 and #1) of a conditional expression with the
|
|
|
|
/// condition code in op #4, a CondCodeSDNode.
|
2010-04-14 20:44:34 +02:00
|
|
|
SELECT_CC,
|
|
|
|
|
2012-09-27 12:14:43 +02:00
|
|
|
/// SetCC operator - This evaluates to a true value iff the condition is
|
2012-07-23 11:04:00 +02:00
|
|
|
/// true. If the result value type is not i1 then the high bits conform
|
|
|
|
/// to getBooleanContents. The operands to this are the left and right
|
|
|
|
/// operands to compare (ops #0, and #1) and the condition code to compare
|
|
|
|
/// them with (op #2) as a CondCodeSDNode. If the operands are vector types
|
|
|
|
/// then the result type must also be a vector type.
|
2010-04-14 20:44:34 +02:00
|
|
|
SETCC,
|
|
|
|
|
2017-06-01 13:14:17 +02:00
|
|
|
/// Like SetCC, ops #0 and #1 are the LHS and RHS operands to compare, but
|
|
|
|
/// op #2 is a boolean indicating if there is an incoming carry. This
|
|
|
|
/// operator checks the result of "LHS - RHS - Carry", and can be used to
|
2018-05-26 16:40:42 +02:00
|
|
|
/// compare two wide integers:
|
|
|
|
/// (setcccarry lhshi rhshi (subcarry lhslo rhslo) cc).
|
2017-06-01 13:14:17 +02:00
|
|
|
/// Only valid for integers.
|
|
|
|
SETCCCARRY,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded
|
2015-11-12 14:18:20 +01:00
|
|
|
/// integer shift operations. The operation ordering is:
|
2012-07-23 11:04:00 +02:00
|
|
|
/// [Lo,Hi] = op [LoLHS,HiLHS], Amt
|
2010-04-14 20:44:34 +02:00
|
|
|
SHL_PARTS, SRA_PARTS, SRL_PARTS,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Conversion operators. These are all single input single output
|
|
|
|
/// operations. For all of these, the result type must be strictly
|
|
|
|
/// wider or narrower (depending on the operation) than the source
|
|
|
|
/// type.
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// SIGN_EXTEND - Used for integer types, replicating the sign bit
|
|
|
|
/// into new bits.
|
2010-04-14 20:44:34 +02:00
|
|
|
SIGN_EXTEND,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// ZERO_EXTEND - Used for integer types, zeroing the new bits.
|
2010-04-14 20:44:34 +02:00
|
|
|
ZERO_EXTEND,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// ANY_EXTEND - Used for integer types. The high bits are undefined.
|
2010-04-14 20:44:34 +02:00
|
|
|
ANY_EXTEND,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// TRUNCATE - Completely drop the high bits.
|
2010-04-14 20:44:34 +02:00
|
|
|
TRUNCATE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// [SU]INT_TO_FP - These operators convert integers (whose interpreted sign
|
|
|
|
/// depends on the first letter) to floating point.
|
2010-04-14 20:44:34 +02:00
|
|
|
SINT_TO_FP,
|
|
|
|
UINT_TO_FP,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to
|
|
|
|
/// sign extend a small value in a large integer register (e.g. sign
|
|
|
|
/// extending the low 8 bits of a 32-bit register to fill the top 24 bits
|
|
|
|
/// with the 7th bit). The size of the smaller type is indicated by the 1th
|
|
|
|
/// operand, a ValueType node.
|
2010-04-14 20:44:34 +02:00
|
|
|
SIGN_EXTEND_INREG,
|
|
|
|
|
2014-07-10 14:32:32 +02:00
|
|
|
/// ANY_EXTEND_VECTOR_INREG(Vector) - This operator represents an
|
|
|
|
/// in-register any-extension of the low lanes of an integer vector. The
|
|
|
|
/// result type must have fewer elements than the operand type, and those
|
|
|
|
/// elements must be larger integer types such that the total size of the
|
2018-11-13 20:45:21 +01:00
|
|
|
/// operand type is less than or equal to the size of the result type. Each
|
|
|
|
/// of the low operand elements is any-extended into the corresponding,
|
|
|
|
/// wider result elements with the high bits becoming undef.
|
|
|
|
/// NOTE: The type legalizer prefers to make the operand and result size
|
|
|
|
/// the same to allow expansion to shuffle vector during op legalization.
|
2014-07-10 14:32:32 +02:00
|
|
|
ANY_EXTEND_VECTOR_INREG,
|
|
|
|
|
|
|
|
/// SIGN_EXTEND_VECTOR_INREG(Vector) - This operator represents an
|
|
|
|
/// in-register sign-extension of the low lanes of an integer vector. The
|
|
|
|
/// result type must have fewer elements than the operand type, and those
|
|
|
|
/// elements must be larger integer types such that the total size of the
|
2018-11-13 20:45:21 +01:00
|
|
|
/// operand type is less than or equal to the size of the result type. Each
|
|
|
|
/// of the low operand elements is sign-extended into the corresponding,
|
|
|
|
/// wider result elements.
|
|
|
|
/// NOTE: The type legalizer prefers to make the operand and result size
|
|
|
|
/// the same to allow expansion to shuffle vector during op legalization.
|
2014-07-10 14:32:32 +02:00
|
|
|
SIGN_EXTEND_VECTOR_INREG,
|
|
|
|
|
2014-07-09 12:58:18 +02:00
|
|
|
/// ZERO_EXTEND_VECTOR_INREG(Vector) - This operator represents an
|
|
|
|
/// in-register zero-extension of the low lanes of an integer vector. The
|
|
|
|
/// result type must have fewer elements than the operand type, and those
|
|
|
|
/// elements must be larger integer types such that the total size of the
|
2018-11-13 20:45:21 +01:00
|
|
|
/// operand type is less than or equal to the size of the result type. Each
|
|
|
|
/// of the low operand elements is zero-extended into the corresponding,
|
|
|
|
/// wider result elements.
|
|
|
|
/// NOTE: The type legalizer prefers to make the operand and result size
|
|
|
|
/// the same to allow expansion to shuffle vector during op legalization.
|
2014-07-09 12:58:18 +02:00
|
|
|
ZERO_EXTEND_VECTOR_INREG,
|
|
|
|
|
2010-04-14 20:44:34 +02:00
|
|
|
/// FP_TO_[US]INT - Convert a floating point value to a signed or unsigned
|
2018-04-20 17:07:55 +02:00
|
|
|
/// integer. These have the same semantics as fptosi and fptoui in IR. If
|
|
|
|
/// the FP value cannot fit in the integer type, the results are undefined.
|
2010-04-14 20:44:34 +02:00
|
|
|
FP_TO_SINT,
|
|
|
|
FP_TO_UINT,
|
|
|
|
|
|
|
|
/// X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type
|
|
|
|
/// down to the precision of the destination VT. TRUNC is a flag, which is
|
|
|
|
/// always an integer that is zero or one. If TRUNC is 0, this is a
|
|
|
|
/// normal rounding, if it is 1, this FP_ROUND is known to not change the
|
|
|
|
/// value of Y.
|
|
|
|
///
|
|
|
|
/// The TRUNC = 1 case is used in cases where we know that the value will
|
|
|
|
/// not be modified by the node, because Y is not using any of the extra
|
|
|
|
/// precision of source type. This allows certain transformations like
|
|
|
|
/// FP_EXTEND(FP_ROUND(X,1)) -> X which are not safe for
|
|
|
|
/// FP_EXTEND(FP_ROUND(X,0)) because the extra bits aren't removed.
|
|
|
|
FP_ROUND,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// FLT_ROUNDS_ - Returns current rounding mode:
|
|
|
|
/// -1 Undefined
|
|
|
|
/// 0 Round to 0
|
|
|
|
/// 1 Round to nearest
|
|
|
|
/// 2 Round to +inf
|
|
|
|
/// 3 Round to -inf
|
2010-04-14 20:44:34 +02:00
|
|
|
FLT_ROUNDS_,
|
|
|
|
|
|
|
|
/// X = FP_ROUND_INREG(Y, VT) - This operator takes an FP register, and
|
|
|
|
/// rounds it to a floating point value. It then promotes it and returns it
|
|
|
|
/// in a register of the same size. This operation effectively just
|
|
|
|
/// discards excess precision. The type to round down to is specified by
|
|
|
|
/// the VT operand, a VTSDNode.
|
|
|
|
FP_ROUND_INREG,
|
|
|
|
|
|
|
|
/// X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
|
|
|
|
FP_EXTEND,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// BITCAST - This operator converts between integer, vector and FP
|
|
|
|
/// values, as if the value was stored to memory with one type and loaded
|
|
|
|
/// from the same address with the other type (or equivalently for vector
|
|
|
|
/// format conversions, etc). The source and result are required to have
|
|
|
|
/// the same bit size (e.g. f32 <-> i32). This can also be used for
|
|
|
|
/// int-to-int or fp-to-fp conversions, but that is a noop, deleted by
|
|
|
|
/// getNode().
|
2016-05-10 11:01:54 +02:00
|
|
|
///
|
|
|
|
/// This operator is subtly different from the bitcast instruction from
|
|
|
|
/// LLVM-IR since this node may change the bits in the register. For
|
|
|
|
/// example, this occurs on big-endian NEON and big-endian MSA where the
|
|
|
|
/// layout of the bits in the register depends on the vector type and this
|
|
|
|
/// operator acts as a shuffle operation for some vector type combinations.
|
2010-11-23 04:31:01 +01:00
|
|
|
BITCAST,
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2013-11-15 02:34:59 +01:00
|
|
|
/// ADDRSPACECAST - This operator converts between pointers of different
|
|
|
|
/// address spaces.
|
|
|
|
ADDRSPACECAST,
|
|
|
|
|
2014-07-17 12:51:23 +02:00
|
|
|
/// FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions
|
|
|
|
/// and truncation for half-precision (16 bit) floating numbers. These nodes
|
|
|
|
/// form a semi-softened interface for dealing with f16 (as an i16), which
|
|
|
|
/// is often a storage-only type but has native conversions.
|
|
|
|
FP16_TO_FP, FP_TO_FP16,
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2019-02-01 04:46:28 +01:00
|
|
|
/// Perform various unary floating-point operations inspired by libm. For
|
|
|
|
/// FPOWI, the result is undefined if if the integer operand doesn't fit
|
|
|
|
/// into 32 bits.
|
[DAGCombiner] try to convert pow(x, 1/3) to cbrt(x)
This is a follow-up suggested in D51630 and originally proposed as an IR transform in D49040.
Copying the motivational statement by @evandro from that patch:
"This transformation helps some benchmarks in SPEC CPU2000 and CPU2006, such as 188.ammp,
447.dealII, 453.povray, and especially 300.twolf, as well as some proprietary benchmarks.
Otherwise, no regressions on x86-64 or A64."
I'm proposing to add only the minimum support for a DAG node here. Since we don't have an
LLVM IR intrinsic for cbrt, and there are no other DAG ways to create a FCBRT node yet, I
don't think we need to worry about DAG builder, legalization, a strict variant, etc. We
should be able to expand as needed when adding more functionality/transforms. For reference,
these are transform suggestions currently listed in SimplifyLibCalls.cpp:
// * cbrt(expN(X)) -> expN(x/3)
// * cbrt(sqrt(x)) -> pow(x,1/6)
// * cbrt(cbrt(x)) -> pow(x,1/9)
Also, given that we bail out on long double for now, there should not be any logical
differences between platforms (unless there's some platform out there that has pow()
but not cbrt()).
Differential Revision: https://reviews.llvm.org/D51753
llvm-svn: 342348
2018-09-16 18:50:26 +02:00
|
|
|
FNEG, FABS, FSQRT, FCBRT, FSIN, FCOS, FPOWI, FPOW,
|
2010-04-14 20:44:34 +02:00
|
|
|
FLOG, FLOG2, FLOG10, FEXP, FEXP2,
|
2013-08-08 00:49:12 +02:00
|
|
|
FCEIL, FTRUNC, FRINT, FNEARBYINT, FROUND, FFLOOR,
|
2019-05-28 22:47:44 +02:00
|
|
|
LROUND, LLROUND, LRINT, LLRINT,
|
2019-05-16 15:15:27 +02:00
|
|
|
|
2015-08-11 11:13:05 +02:00
|
|
|
/// FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two
|
|
|
|
/// values.
|
2018-10-22 18:27:27 +02:00
|
|
|
//
|
|
|
|
/// In the case where a single input is a NaN (either signaling or quiet),
|
|
|
|
/// the non-NaN input is returned.
|
2015-08-11 11:13:05 +02:00
|
|
|
///
|
|
|
|
/// The return value of (FMINNUM 0.0, -0.0) could be either 0.0 or -0.0.
|
2014-10-22 01:01:01 +02:00
|
|
|
FMINNUM, FMAXNUM,
|
2018-10-22 18:27:27 +02:00
|
|
|
|
|
|
|
/// FMINNUM_IEEE/FMAXNUM_IEEE - Perform floating-point minimum or maximum on
|
|
|
|
/// two values, following the IEEE-754 2008 definition. This differs from
|
|
|
|
/// FMINNUM/FMAXNUM in the handling of signaling NaNs. If one input is a
|
|
|
|
/// signaling NaN, returns a quiet NaN.
|
|
|
|
FMINNUM_IEEE, FMAXNUM_IEEE,
|
|
|
|
|
[NFC] Rename minnan and maxnan to minimum and maximum
Summary:
Changes all uses of minnan/maxnan to minimum/maximum
globally. These names emphasize that the semantic difference between
these operations is more than just NaN-propagation.
Reviewers: arsenm, aheejin, dschuff, javed.absar
Subscribers: jholewinski, sdardis, wdng, sbc100, jgravelle-google, jrtc27, atanasyan, llvm-commits
Differential Revision: https://reviews.llvm.org/D53112
llvm-svn: 345218
2018-10-25 00:49:55 +02:00
|
|
|
/// FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0
|
|
|
|
/// as less than 0.0. While FMINNUM_IEEE/FMAXNUM_IEEE follow IEEE 754-2008
|
|
|
|
/// semantics, FMINIMUM/FMAXIMUM follow IEEE 754-2018 draft semantics.
|
|
|
|
FMINIMUM, FMAXIMUM,
|
2014-10-22 01:01:01 +02:00
|
|
|
|
2013-01-29 03:32:37 +01:00
|
|
|
/// FSINCOS - Compute both fsin and fcos as a single operation.
|
|
|
|
FSINCOS,
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// LOAD and STORE have token chains as their first operand, then the same
|
|
|
|
/// operands as an LLVM load/store instruction, then an offset node that
|
|
|
|
/// is added / subtracted from the base pointer to form the address (for
|
|
|
|
/// indexed memory ops).
|
2010-04-14 20:44:34 +02:00
|
|
|
LOAD, STORE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned
|
|
|
|
/// to a specified boundary. This node always has two return values: a new
|
|
|
|
/// stack pointer value and a chain. The first operand is the token chain,
|
|
|
|
/// the second is the number of bytes to allocate, and the third is the
|
|
|
|
/// alignment boundary. The size is guaranteed to be a multiple of the
|
|
|
|
/// stack alignment, and the alignment is guaranteed to be bigger than the
|
|
|
|
/// stack alignment (if required) or 0 to get standard stack alignment.
|
2010-04-14 20:44:34 +02:00
|
|
|
DYNAMIC_STACKALLOC,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Control flow instructions. These all have token chains.
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// BR - Unconditional branch. The first operand is the chain
|
|
|
|
/// operand, the second is the MBB to branch to.
|
2010-04-14 20:44:34 +02:00
|
|
|
BR,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// BRIND - Indirect branch. The first operand is the chain, the second
|
|
|
|
/// is the value to branch to, which must be of the same type as the
|
|
|
|
/// target's pointer type.
|
2010-04-14 20:44:34 +02:00
|
|
|
BRIND,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// BR_JT - Jumptable branch. The first operand is the chain, the second
|
|
|
|
/// is the jumptable index, the last one is the jumptable entry index.
|
2010-04-14 20:44:34 +02:00
|
|
|
BR_JT,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// BRCOND - Conditional branch. The first operand is the chain, the
|
|
|
|
/// second is the condition, the third is the block to branch to if the
|
|
|
|
/// condition is true. If the type of the condition is not i1, then the
|
|
|
|
/// high bits must conform to getBooleanContents.
|
2010-04-14 20:44:34 +02:00
|
|
|
BRCOND,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// BR_CC - Conditional branch. The behavior is like that of SELECT_CC, in
|
|
|
|
/// that the condition is represented as condition code, and two nodes to
|
|
|
|
/// compare, rather than as a combined SetCC node. The operands in order
|
|
|
|
/// are chain, cc, lhs, rhs, block to branch to if condition is true.
|
2010-04-14 20:44:34 +02:00
|
|
|
BR_CC,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// INLINEASM - Represents an inline asm block. This node always has two
|
|
|
|
/// return values: a chain and a flag result. The inputs are as follows:
|
|
|
|
/// Operand #0 : Input chain.
|
|
|
|
/// Operand #1 : a ExternalSymbolSDNode with a pointer to the asm string.
|
|
|
|
/// Operand #2 : a MDNodeSDNode with the !srcloc metadata.
|
|
|
|
/// Operand #3 : HasSideEffect, IsAlignStack bits.
|
|
|
|
/// After this, it is followed by a list of operands with this format:
|
|
|
|
/// ConstantSDNode: Flags that encode whether it is a mem or not, the
|
|
|
|
/// of operands that follow, etc. See InlineAsm.h.
|
|
|
|
/// ... however many operands ...
|
|
|
|
/// Operand #last: Optional, an incoming flag.
|
|
|
|
///
|
|
|
|
/// The variable width operands are required to represent target addressing
|
|
|
|
/// modes as a single "operand", even though they may have multiple
|
|
|
|
/// SDOperands.
|
2010-04-14 20:44:34 +02:00
|
|
|
INLINEASM,
|
|
|
|
|
2019-02-08 21:48:56 +01:00
|
|
|
/// INLINEASM_BR - Terminator version of inline asm. Used by asm-goto.
|
|
|
|
INLINEASM_BR,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// EH_LABEL - Represents a label in mid basic block used to track
|
|
|
|
/// locations needed for debug and exception handling tables. These nodes
|
|
|
|
/// take a chain as input and return a chain.
|
2010-04-14 20:44:34 +02:00
|
|
|
EH_LABEL,
|
|
|
|
|
2017-09-05 22:14:58 +02:00
|
|
|
/// ANNOTATION_LABEL - Represents a mid basic block label used by
|
|
|
|
/// annotations. This should remain within the basic block and be ordered
|
|
|
|
/// with respect to other call instructions, but loads and stores may float
|
|
|
|
/// past it.
|
|
|
|
ANNOTATION_LABEL,
|
|
|
|
|
2015-11-10 00:07:48 +01:00
|
|
|
/// CATCHPAD - Represents a catchpad instruction.
|
|
|
|
CATCHPAD,
|
|
|
|
|
2015-09-10 02:25:23 +02:00
|
|
|
/// CATCHRET - Represents a return from a catch block funclet. Used for
|
|
|
|
/// MSVC compatible exception handling. Takes a chain operand and a
|
|
|
|
/// destination basic block operand.
|
2015-08-28 01:27:47 +02:00
|
|
|
CATCHRET,
|
|
|
|
|
2015-09-10 02:25:23 +02:00
|
|
|
/// CLEANUPRET - Represents a return from a cleanup block funclet. Used for
|
|
|
|
/// MSVC compatible exception handling. Takes only a chain operand.
|
2015-08-28 01:27:47 +02:00
|
|
|
CLEANUPRET,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// STACKSAVE - STACKSAVE has one operand, an input chain. It produces a
|
|
|
|
/// value, the same type as the pointer type for the system, and an output
|
|
|
|
/// chain.
|
2010-04-14 20:44:34 +02:00
|
|
|
STACKSAVE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// STACKRESTORE has two operands, an input chain and a pointer to restore
|
|
|
|
/// to it returns an output chain.
|
2010-04-14 20:44:34 +02:00
|
|
|
STACKRESTORE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end
|
|
|
|
/// of a call sequence, and carry arbitrary information that target might
|
|
|
|
/// want to know. The first operand is a chain, the rest are specified by
|
|
|
|
/// the target and not touched by the DAG optimizers.
|
2017-05-09 15:35:13 +02:00
|
|
|
/// Targets that may use stack to pass call arguments define additional
|
|
|
|
/// operands:
|
|
|
|
/// - size of the call frame part that must be set up within the
|
|
|
|
/// CALLSEQ_START..CALLSEQ_END pair,
|
|
|
|
/// - part of the call frame prepared prior to CALLSEQ_START.
|
|
|
|
/// Both these parameters must be constants, their sum is the total call
|
|
|
|
/// frame size.
|
2012-07-23 11:04:00 +02:00
|
|
|
/// CALLSEQ_START..CALLSEQ_END pairs may not be nested.
|
2010-04-14 20:44:34 +02:00
|
|
|
CALLSEQ_START, // Beginning of a call sequence
|
|
|
|
CALLSEQ_END, // End of a call sequence
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE,
|
|
|
|
/// and the alignment. It returns a pair of values: the vaarg value and a
|
|
|
|
/// new chain.
|
2010-04-14 20:44:34 +02:00
|
|
|
VAARG,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// VACOPY - VACOPY has 5 operands: an input chain, a destination pointer,
|
|
|
|
/// a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the
|
|
|
|
/// source.
|
2010-04-14 20:44:34 +02:00
|
|
|
VACOPY,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// VAEND, VASTART - VAEND and VASTART have three operands: an input chain,
|
|
|
|
/// pointer, and a SRCVALUE.
|
2010-04-14 20:44:34 +02:00
|
|
|
VAEND, VASTART,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// SRCVALUE - This is a node type that holds a Value* that is used to
|
|
|
|
/// make reference to a value in the LLVM IR.
|
2010-04-14 20:44:34 +02:00
|
|
|
SRCVALUE,
|
2010-11-23 04:31:01 +01:00
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// MDNODE_SDNODE - This is a node that holdes an MDNode*, which is used to
|
|
|
|
/// reference metadata in the IR.
|
2010-04-14 20:44:34 +02:00
|
|
|
MDNODE_SDNODE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// PCMARKER - This corresponds to the pcmarker intrinsic.
|
2010-04-14 20:44:34 +02:00
|
|
|
PCMARKER,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
|
2015-08-28 03:49:59 +02:00
|
|
|
/// It produces a chain and one i64 value. The only operand is a chain.
|
|
|
|
/// If i64 is not legal, the result will be expanded into smaller values.
|
|
|
|
/// Still, it returns an i64, so targets should set legality for i64.
|
|
|
|
/// The result is the content of the architecture-specific cycle
|
|
|
|
/// counter-like register (or other high accuracy low latency clock source).
|
2010-04-14 20:44:34 +02:00
|
|
|
READCYCLECOUNTER,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// HANDLENODE node - Used as a handle for various purposes.
|
2010-04-14 20:44:34 +02:00
|
|
|
HANDLENODE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// INIT_TRAMPOLINE - This corresponds to the init_trampoline intrinsic. It
|
|
|
|
/// takes as input a token chain, the pointer to the trampoline, the pointer
|
|
|
|
/// to the nested function, the pointer to pass for the 'nest' parameter, a
|
|
|
|
/// SRCVALUE for the trampoline and another for the nested function
|
|
|
|
/// (allowing targets to access the original Function*).
|
|
|
|
/// It produces a token chain as output.
|
2011-09-06 15:37:06 +02:00
|
|
|
INIT_TRAMPOLINE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// ADJUST_TRAMPOLINE - This corresponds to the adjust_trampoline intrinsic.
|
|
|
|
/// It takes a pointer to the trampoline and produces a (possibly) new
|
|
|
|
/// pointer to the same trampoline with platform-specific adjustments
|
|
|
|
/// applied. The pointer it returns points to an executable block of code.
|
2011-09-06 15:37:06 +02:00
|
|
|
ADJUST_TRAMPOLINE,
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// TRAP - Trapping instruction
|
2010-04-14 20:44:34 +02:00
|
|
|
TRAP,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// DEBUGTRAP - Trap intended to get the attention of a debugger.
|
2012-05-14 20:58:10 +02:00
|
|
|
DEBUGTRAP,
|
2012-05-11 02:19:32 +02:00
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// PREFETCH - This corresponds to a prefetch intrinsic. The first operand
|
|
|
|
/// is the chain. The other operands are the address to prefetch,
|
|
|
|
/// read / write specifier, locality specifier and instruction / data cache
|
|
|
|
/// specifier.
|
2010-04-14 20:44:34 +02:00
|
|
|
PREFETCH,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope)
|
|
|
|
/// This corresponds to the fence instruction. It takes an input chain, and
|
|
|
|
/// two integer constants: an AtomicOrdering and a SynchronizationScope.
|
2011-07-28 00:21:52 +02:00
|
|
|
ATOMIC_FENCE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr)
|
|
|
|
/// This corresponds to "load atomic" instruction.
|
2011-08-24 22:50:09 +02:00
|
|
|
ATOMIC_LOAD,
|
|
|
|
|
2013-12-26 15:43:33 +01:00
|
|
|
/// OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val)
|
2012-07-23 11:04:00 +02:00
|
|
|
/// This corresponds to "store atomic" instruction.
|
2011-08-24 22:50:09 +02:00
|
|
|
ATOMIC_STORE,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap)
|
2013-09-26 14:22:36 +02:00
|
|
|
/// For double-word atomic operations:
|
|
|
|
/// ValLo, ValHi, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmpLo, cmpHi,
|
|
|
|
/// swapLo, swapHi)
|
2012-07-23 11:04:00 +02:00
|
|
|
/// This corresponds to the cmpxchg instruction.
|
2010-04-14 20:44:34 +02:00
|
|
|
ATOMIC_CMP_SWAP,
|
|
|
|
|
IR: add "cmpxchg weak" variant to support permitted failure.
This commit adds a weak variant of the cmpxchg operation, as described
in C++11. A cmpxchg instruction with this modifier is permitted to
fail to store, even if the comparison indicated it should.
As a result, cmpxchg instructions must return a flag indicating
success in addition to their original iN value loaded. Thus, for
uniformity *all* cmpxchg instructions now return "{ iN, i1 }". The
second flag is 1 when the store succeeded.
At the DAG level, a new ATOMIC_CMP_SWAP_WITH_SUCCESS node has been
added as the natural representation for the new cmpxchg instructions.
It is a strong cmpxchg.
By default this gets Expanded to the existing ATOMIC_CMP_SWAP during
Legalization, so existing backends should see no change in behaviour.
If they wish to deal with the enhanced node instead, they can call
setOperationAction on it. Beware: as a node with 2 results, it cannot
be selected from TableGen.
Currently, no use is made of the extra information provided in this
patch. Test updates are almost entirely adapting the input IR to the
new scheme.
Summary for out of tree users:
------------------------------
+ Legacy Bitcode files are upgraded during read.
+ Legacy assembly IR files will be invalid.
+ Front-ends must adapt to different type for "cmpxchg".
+ Backends should be unaffected by default.
llvm-svn: 210903
2014-06-13 16:24:07 +02:00
|
|
|
/// Val, Success, OUTCHAIN
|
|
|
|
/// = ATOMIC_CMP_SWAP_WITH_SUCCESS(INCHAIN, ptr, cmp, swap)
|
|
|
|
/// N.b. this is still a strong cmpxchg operation, so
|
|
|
|
/// Success == "Val == cmp".
|
|
|
|
ATOMIC_CMP_SWAP_WITH_SUCCESS,
|
|
|
|
|
2012-07-23 11:04:00 +02:00
|
|
|
/// Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt)
|
|
|
|
/// Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amt)
|
2013-09-26 14:22:36 +02:00
|
|
|
/// For double-word atomic operations:
|
|
|
|
/// ValLo, ValHi, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amtLo, amtHi)
|
|
|
|
/// ValLo, ValHi, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amtLo, amtHi)
|
2012-07-23 11:04:00 +02:00
|
|
|
/// These correspond to the atomicrmw instruction.
|
2011-08-24 22:50:09 +02:00
|
|
|
ATOMIC_SWAP,
|
2010-04-14 20:44:34 +02:00
|
|
|
ATOMIC_LOAD_ADD,
|
|
|
|
ATOMIC_LOAD_SUB,
|
|
|
|
ATOMIC_LOAD_AND,
|
2018-02-12 18:03:11 +01:00
|
|
|
ATOMIC_LOAD_CLR,
|
2010-04-14 20:44:34 +02:00
|
|
|
ATOMIC_LOAD_OR,
|
|
|
|
ATOMIC_LOAD_XOR,
|
|
|
|
ATOMIC_LOAD_NAND,
|
|
|
|
ATOMIC_LOAD_MIN,
|
|
|
|
ATOMIC_LOAD_MAX,
|
|
|
|
ATOMIC_LOAD_UMIN,
|
|
|
|
ATOMIC_LOAD_UMAX,
|
2019-01-22 19:36:06 +01:00
|
|
|
ATOMIC_LOAD_FADD,
|
|
|
|
ATOMIC_LOAD_FSUB,
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2015-04-28 09:57:37 +02:00
|
|
|
// Masked load and store - consecutive vector load and store operations
|
|
|
|
// with additional mask operand that prevents memory accesses to the
|
|
|
|
// masked-off lanes.
|
2018-08-29 06:45:32 +02:00
|
|
|
//
|
|
|
|
// Val, OutChain = MLOAD(BasePtr, Mask, PassThru)
|
|
|
|
// OutChain = MSTORE(Value, BasePtr, Mask)
|
2014-12-04 10:40:44 +01:00
|
|
|
MLOAD, MSTORE,
|
|
|
|
|
2015-04-28 09:57:37 +02:00
|
|
|
// Masked gather and scatter - load and store operations for a vector of
|
|
|
|
// random addresses with additional mask operand that prevents memory
|
|
|
|
// accesses to the masked-off lanes.
|
2018-08-29 06:45:32 +02:00
|
|
|
//
|
|
|
|
// Val, OutChain = GATHER(InChain, PassThru, Mask, BasePtr, Index, Scale)
|
|
|
|
// OutChain = SCATTER(InChain, Value, Mask, BasePtr, Index, Scale)
|
|
|
|
//
|
|
|
|
// The Index operand can have more vector elements than the other operands
|
|
|
|
// due to type legalization. The extra elements are ignored.
|
2015-04-28 09:57:37 +02:00
|
|
|
MGATHER, MSCATTER,
|
|
|
|
|
2012-09-06 11:17:37 +02:00
|
|
|
/// This corresponds to the llvm.lifetime.* intrinsics. The first operand
|
|
|
|
/// is the chain and the second operand is the alloca pointer.
|
|
|
|
LIFETIME_START, LIFETIME_END,
|
|
|
|
|
Extend the statepoint intrinsic to allow statepoints to be marked as transitions from GC-aware code to code that is not GC-aware.
This changes the shape of the statepoint intrinsic from:
@llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 unused, ...call args, i32 # deopt args, ...deopt args, ...gc args)
to:
@llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 flags, ...call args, i32 # transition args, ...transition args, i32 # deopt args, ...deopt args, ...gc args)
This extension offers the backend the opportunity to insert (somewhat) arbitrary code to manage the transition from GC-aware code to code that is not GC-aware and back.
In order to support the injection of transition code, this extension wraps the STATEPOINT ISD node generated by the usual lowering lowering with two additional nodes: GC_TRANSITION_START and GC_TRANSITION_END. The transition arguments that were passed passed to the intrinsic (if any) are lowered and provided as operands to these nodes and may be used by the backend during code generation.
Eventually, the lowering of the GC_TRANSITION_{START,END} nodes should be informed by the GC strategy in use for the function containing the intrinsic call; for now, these nodes are instead replaced with no-ops.
Differential Revision: http://reviews.llvm.org/D9501
llvm-svn: 236888
2015-05-08 20:07:42 +02:00
|
|
|
/// GC_TRANSITION_START/GC_TRANSITION_END - These operators mark the
|
|
|
|
/// beginning and end of GC transition sequence, and carry arbitrary
|
|
|
|
/// information that target might need for lowering. The first operand is
|
|
|
|
/// a chain, the rest are specified by the target and not touched by the DAG
|
|
|
|
/// optimizers. GC_TRANSITION_START..GC_TRANSITION_END pairs may not be
|
|
|
|
/// nested.
|
|
|
|
GC_TRANSITION_START,
|
|
|
|
GC_TRANSITION_END,
|
|
|
|
|
2015-12-01 12:40:55 +01:00
|
|
|
/// GET_DYNAMIC_AREA_OFFSET - get offset from native SP to the address of
|
|
|
|
/// the most recent dynamic alloca. For most targets that would be 0, but
|
|
|
|
/// for some others (e.g. PowerPC, PowerPC64) that would be compile-time
|
|
|
|
/// known nonzero constant. The only operand here is the chain.
|
|
|
|
GET_DYNAMIC_AREA_OFFSET,
|
|
|
|
|
2017-05-09 12:43:25 +02:00
|
|
|
/// Generic reduction nodes. These nodes represent horizontal vector
|
|
|
|
/// reduction operations, producing a scalar result.
|
|
|
|
/// The STRICT variants perform reductions in sequential order. The first
|
|
|
|
/// operand is an initial scalar accumulator value, and the second operand
|
|
|
|
/// is the vector to reduce.
|
|
|
|
VECREDUCE_STRICT_FADD, VECREDUCE_STRICT_FMUL,
|
|
|
|
/// These reductions are non-strict, and have a single vector operand.
|
|
|
|
VECREDUCE_FADD, VECREDUCE_FMUL,
|
[SDAG][AArch64] Legalize VECREDUCE
Fixes https://bugs.llvm.org/show_bug.cgi?id=36796.
Implement basic legalizations (PromoteIntRes, PromoteIntOp,
ExpandIntRes, ScalarizeVecOp, WidenVecOp) for VECREDUCE opcodes.
There are more legalizations missing (esp float legalizations),
but there's no way to test them right now, so I'm not adding them.
This also includes a few more changes to make this work somewhat
reasonably:
* Add support for expanding VECREDUCE in SDAG. Usually
experimental.vector.reduce is expanded prior to codegen, but if the
target does have native vector reduce, it may of course still be
necessary to expand due to legalization issues. This uses a shuffle
reduction if possible, followed by a naive scalar reduction.
* Allow the result type of integer VECREDUCE to be larger than the
vector element type. For example we need to be able to reduce a v8i8
into an (nominally) i32 result type on AArch64.
* Use the vector operand type rather than the scalar result type to
determine the action, so we can control exactly which vector types are
supported. Also change the legalize vector op code to handle
operations that only have vector operands, but no vector results, as
is the case for VECREDUCE.
* Default VECREDUCE to Expand. On AArch64 (only target using VECREDUCE),
explicitly specify for which vector types the reductions are supported.
This does not handle anything related to VECREDUCE_STRICT_*.
Differential Revision: https://reviews.llvm.org/D58015
llvm-svn: 355860
2019-03-11 21:22:13 +01:00
|
|
|
/// FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.
|
|
|
|
VECREDUCE_FMAX, VECREDUCE_FMIN,
|
|
|
|
/// Integer reductions may have a result type larger than the vector element
|
|
|
|
/// type. However, the reduction is performed using the vector element type
|
|
|
|
/// and the value in the top bits is unspecified.
|
2017-05-09 12:43:25 +02:00
|
|
|
VECREDUCE_ADD, VECREDUCE_MUL,
|
|
|
|
VECREDUCE_AND, VECREDUCE_OR, VECREDUCE_XOR,
|
|
|
|
VECREDUCE_SMAX, VECREDUCE_SMIN, VECREDUCE_UMAX, VECREDUCE_UMIN,
|
|
|
|
|
2010-04-14 20:44:34 +02:00
|
|
|
/// BUILTIN_OP_END - This must be the last enum value in this list.
|
|
|
|
/// The target-specific pre-isel opcode values start here.
|
|
|
|
BUILTIN_OP_END
|
|
|
|
};
|
|
|
|
|
|
|
|
/// FIRST_TARGET_MEMORY_OPCODE - Target-specific pre-isel operations
|
|
|
|
/// which do not reference a specific memory location should be less than
|
|
|
|
/// this value. Those that do must not be less than this value, and can
|
|
|
|
/// be used with SelectionDAG::getMemIntrinsicNode.
|
2017-11-25 19:32:43 +01:00
|
|
|
static const int FIRST_TARGET_MEMORY_OPCODE = BUILTIN_OP_END+400;
|
2010-04-14 20:44:34 +02:00
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
/// MemIndexedMode enum - This enum defines the load / store indexed
|
|
|
|
/// addressing modes.
|
|
|
|
///
|
|
|
|
/// UNINDEXED "Normal" load / store. The effective address is already
|
|
|
|
/// computed and is available in the base pointer. The offset
|
|
|
|
/// operand is always undefined. In addition to producing a
|
|
|
|
/// chain, an unindexed load produces one value (result of the
|
|
|
|
/// load); an unindexed store does not produce a value.
|
|
|
|
///
|
|
|
|
/// PRE_INC Similar to the unindexed mode where the effective address is
|
|
|
|
/// PRE_DEC the value of the base pointer add / subtract the offset.
|
|
|
|
/// It considers the computation as being folded into the load /
|
|
|
|
/// store operation (i.e. the load / store does the address
|
|
|
|
/// computation as well as performing the memory transaction).
|
|
|
|
/// The base operand is always undefined. In addition to
|
|
|
|
/// producing a chain, pre-indexed load produces two values
|
|
|
|
/// (result of the load and the result of the address
|
|
|
|
/// computation); a pre-indexed store produces one value (result
|
|
|
|
/// of the address computation).
|
|
|
|
///
|
|
|
|
/// POST_INC The effective address is the value of the base pointer. The
|
|
|
|
/// POST_DEC value of the offset operand is then added to / subtracted
|
|
|
|
/// from the base after memory transaction. In addition to
|
|
|
|
/// producing a chain, post-indexed load produces two values
|
|
|
|
/// (the result of the load and the result of the base +/- offset
|
|
|
|
/// computation); a post-indexed store produces one value (the
|
|
|
|
/// the result of the base +/- offset computation).
|
|
|
|
enum MemIndexedMode {
|
|
|
|
UNINDEXED = 0,
|
|
|
|
PRE_INC,
|
|
|
|
PRE_DEC,
|
|
|
|
POST_INC,
|
2017-03-15 18:43:40 +01:00
|
|
|
POST_DEC
|
2010-04-14 20:44:34 +02:00
|
|
|
};
|
|
|
|
|
2017-03-15 18:43:40 +01:00
|
|
|
static const int LAST_INDEXED_MODE = POST_DEC + 1;
|
|
|
|
|
2019-08-06 11:46:13 +02:00
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
/// MemIndexType enum - This enum defines how to interpret MGATHER/SCATTER's
|
|
|
|
/// index parameter when calculating addresses.
|
|
|
|
///
|
|
|
|
/// SIGNED_SCALED Addr = Base + ((signed)Index * sizeof(element))
|
|
|
|
/// SIGNED_UNSCALED Addr = Base + (signed)Index
|
|
|
|
/// UNSIGNED_SCALED Addr = Base + ((unsigned)Index * sizeof(element))
|
|
|
|
/// UNSIGNED_UNSCALED Addr = Base + (unsigned)Index
|
|
|
|
enum MemIndexType {
|
|
|
|
SIGNED_SCALED = 0,
|
|
|
|
SIGNED_UNSCALED,
|
|
|
|
UNSIGNED_SCALED,
|
|
|
|
UNSIGNED_UNSCALED
|
|
|
|
};
|
|
|
|
|
|
|
|
static const int LAST_MEM_INDEX_TYPE = UNSIGNED_UNSCALED + 1;
|
|
|
|
|
2010-04-14 20:44:34 +02:00
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
/// LoadExtType enum - This enum defines the three variants of LOADEXT
|
|
|
|
/// (load with extension).
|
|
|
|
///
|
|
|
|
/// SEXTLOAD loads the integer operand and sign extends it to a larger
|
|
|
|
/// integer result type.
|
|
|
|
/// ZEXTLOAD loads the integer operand and zero extends it to a larger
|
|
|
|
/// integer result type.
|
2010-08-20 01:39:00 +02:00
|
|
|
/// EXTLOAD is used for two things: floating point extending loads and
|
|
|
|
/// integer extending loads [the top bits are undefined].
|
2010-04-14 20:44:34 +02:00
|
|
|
enum LoadExtType {
|
|
|
|
NON_EXTLOAD = 0,
|
|
|
|
EXTLOAD,
|
|
|
|
SEXTLOAD,
|
2017-03-15 18:43:40 +01:00
|
|
|
ZEXTLOAD
|
2010-04-14 20:44:34 +02:00
|
|
|
};
|
|
|
|
|
2017-03-15 18:43:40 +01:00
|
|
|
static const int LAST_LOADEXT_TYPE = ZEXTLOAD + 1;
|
|
|
|
|
2015-01-14 02:35:17 +01:00
|
|
|
NodeType getExtForLoadExtType(bool IsFP, LoadExtType);
|
2014-03-06 18:34:12 +01:00
|
|
|
|
2010-04-14 20:44:34 +02:00
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
/// ISD::CondCode enum - These are ordered carefully to make the bitfields
|
|
|
|
/// below work out, when considering SETFALSE (something that never exists
|
|
|
|
/// dynamically) as 0. "U" -> Unsigned (for integer operands) or Unordered
|
|
|
|
/// (for floating point), "L" -> Less than, "G" -> Greater than, "E" -> Equal
|
|
|
|
/// to. If the "N" column is 1, the result of the comparison is undefined if
|
|
|
|
/// the input is a NAN.
|
|
|
|
///
|
|
|
|
/// All of these (except for the 'always folded ops') should be handled for
|
|
|
|
/// floating point. For integer, only the SETEQ,SETNE,SETLT,SETLE,SETGT,
|
|
|
|
/// SETGE,SETULT,SETULE,SETUGT, and SETUGE opcodes are used.
|
|
|
|
///
|
|
|
|
/// Note that these are laid out in a specific order to allow bit-twiddling
|
|
|
|
/// to transform conditions.
|
|
|
|
enum CondCode {
|
|
|
|
// Opcode N U L G E Intuitive operation
|
|
|
|
SETFALSE, // 0 0 0 0 Always false (always folded)
|
|
|
|
SETOEQ, // 0 0 0 1 True if ordered and equal
|
|
|
|
SETOGT, // 0 0 1 0 True if ordered and greater than
|
|
|
|
SETOGE, // 0 0 1 1 True if ordered and greater than or equal
|
|
|
|
SETOLT, // 0 1 0 0 True if ordered and less than
|
|
|
|
SETOLE, // 0 1 0 1 True if ordered and less than or equal
|
|
|
|
SETONE, // 0 1 1 0 True if ordered and operands are unequal
|
|
|
|
SETO, // 0 1 1 1 True if ordered (no nans)
|
|
|
|
SETUO, // 1 0 0 0 True if unordered: isnan(X) | isnan(Y)
|
|
|
|
SETUEQ, // 1 0 0 1 True if unordered or equal
|
|
|
|
SETUGT, // 1 0 1 0 True if unordered or greater than
|
|
|
|
SETUGE, // 1 0 1 1 True if unordered, greater than, or equal
|
|
|
|
SETULT, // 1 1 0 0 True if unordered or less than
|
|
|
|
SETULE, // 1 1 0 1 True if unordered, less than, or equal
|
|
|
|
SETUNE, // 1 1 1 0 True if unordered or not equal
|
|
|
|
SETTRUE, // 1 1 1 1 Always true (always folded)
|
|
|
|
// Don't care operations: undefined if the input is a nan.
|
|
|
|
SETFALSE2, // 1 X 0 0 0 Always false (always folded)
|
|
|
|
SETEQ, // 1 X 0 0 1 True if equal
|
|
|
|
SETGT, // 1 X 0 1 0 True if greater than
|
|
|
|
SETGE, // 1 X 0 1 1 True if greater than or equal
|
|
|
|
SETLT, // 1 X 1 0 0 True if less than
|
|
|
|
SETLE, // 1 X 1 0 1 True if less than or equal
|
|
|
|
SETNE, // 1 X 1 1 0 True if not equal
|
|
|
|
SETTRUE2, // 1 X 1 1 1 Always true (always folded)
|
|
|
|
|
|
|
|
SETCC_INVALID // Marker value.
|
|
|
|
};
|
|
|
|
|
2016-07-11 22:50:39 +02:00
|
|
|
/// Return true if this is a setcc instruction that performs a signed
|
|
|
|
/// comparison when used with integer operands.
|
2010-04-14 20:44:34 +02:00
|
|
|
inline bool isSignedIntSetCC(CondCode Code) {
|
|
|
|
return Code == SETGT || Code == SETGE || Code == SETLT || Code == SETLE;
|
|
|
|
}
|
|
|
|
|
2016-07-11 22:50:39 +02:00
|
|
|
/// Return true if this is a setcc instruction that performs an unsigned
|
|
|
|
/// comparison when used with integer operands.
|
2010-04-14 20:44:34 +02:00
|
|
|
inline bool isUnsignedIntSetCC(CondCode Code) {
|
|
|
|
return Code == SETUGT || Code == SETUGE || Code == SETULT || Code == SETULE;
|
|
|
|
}
|
|
|
|
|
2016-07-11 22:50:39 +02:00
|
|
|
/// Return true if the specified condition returns true if the two operands to
|
|
|
|
/// the condition are equal. Note that if one of the two operands is a NaN,
|
|
|
|
/// this value is meaningless.
|
2010-04-14 20:44:34 +02:00
|
|
|
inline bool isTrueWhenEqual(CondCode Cond) {
|
|
|
|
return ((int)Cond & 1) != 0;
|
|
|
|
}
|
|
|
|
|
2016-07-11 22:50:39 +02:00
|
|
|
/// This function returns 0 if the condition is always false if an operand is
|
|
|
|
/// a NaN, 1 if the condition is always true if the operand is a NaN, and 2 if
|
|
|
|
/// the condition is undefined if the operand is a NaN.
|
2010-04-14 20:44:34 +02:00
|
|
|
inline unsigned getUnorderedFlavor(CondCode Cond) {
|
|
|
|
return ((int)Cond >> 3) & 3;
|
|
|
|
}
|
|
|
|
|
2016-07-11 22:50:39 +02:00
|
|
|
/// Return the operation corresponding to !(X op Y), where 'op' is a valid
|
|
|
|
/// SetCC operation.
|
2010-04-14 20:44:34 +02:00
|
|
|
CondCode getSetCCInverse(CondCode Operation, bool isInteger);
|
|
|
|
|
2016-07-11 22:50:39 +02:00
|
|
|
/// Return the operation corresponding to (Y op X) when given the operation
|
|
|
|
/// for (X op Y).
|
2010-04-14 20:44:34 +02:00
|
|
|
CondCode getSetCCSwappedOperands(CondCode Operation);
|
|
|
|
|
2016-07-11 22:50:39 +02:00
|
|
|
/// Return the result of a logical OR between different comparisons of
|
|
|
|
/// identical values: ((X op1 Y) | (X op2 Y)). This function returns
|
|
|
|
/// SETCC_INVALID if it is not possible to represent the resultant comparison.
|
2010-04-14 20:44:34 +02:00
|
|
|
CondCode getSetCCOrOperation(CondCode Op1, CondCode Op2, bool isInteger);
|
|
|
|
|
2016-07-11 22:50:39 +02:00
|
|
|
/// Return the result of a logical AND between different comparisons of
|
|
|
|
/// identical values: ((X op1 Y) & (X op2 Y)). This function returns
|
|
|
|
/// SETCC_INVALID if it is not possible to represent the resultant comparison.
|
2010-04-14 20:44:34 +02:00
|
|
|
CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, bool isInteger);
|
|
|
|
|
2015-06-23 11:49:53 +02:00
|
|
|
} // end llvm::ISD namespace
|
2010-04-14 20:44:34 +02:00
|
|
|
|
2015-06-23 11:49:53 +02:00
|
|
|
} // end llvm namespace
|
2010-04-14 20:44:34 +02:00
|
|
|
|
|
|
|
#endif
|