2012-12-12 05:25:42 +08:00
|
|
|
//===-- AMDGPUInstrInfo.td - AMDGPU DAG nodes --------------*- tablegen -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08: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
|
2012-12-12 05:25:42 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains DAG node defintions for the AMDGPU target.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// AMDGPU DAG Profiles
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def AMDGPUDTIntTernaryOp : SDTypeProfile<1, 3, [
|
|
|
|
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>, SDTCisInt<3>
|
|
|
|
]>;
|
|
|
|
|
2014-06-19 09:19:19 +08:00
|
|
|
def AMDGPUTrigPreOp : SDTypeProfile<1, 2,
|
|
|
|
[SDTCisSameAs<0, 1>, SDTCisFP<0>, SDTCisInt<2>]
|
|
|
|
>;
|
|
|
|
|
2014-08-16 01:30:25 +08:00
|
|
|
def AMDGPULdExpOp : SDTypeProfile<1, 2,
|
|
|
|
[SDTCisSameAs<0, 1>, SDTCisFP<0>, SDTCisInt<2>]
|
|
|
|
>;
|
|
|
|
|
2015-01-07 07:00:37 +08:00
|
|
|
def AMDGPUFPClassOp : SDTypeProfile<1, 2,
|
|
|
|
[SDTCisInt<0>, SDTCisFP<1>, SDTCisInt<2>]
|
|
|
|
>;
|
|
|
|
|
2017-02-22 08:27:34 +08:00
|
|
|
def AMDGPUFPPackOp : SDTypeProfile<1, 2,
|
|
|
|
[SDTCisFP<1>, SDTCisSameAs<1, 2>]
|
|
|
|
>;
|
|
|
|
|
2018-02-01 04:18:04 +08:00
|
|
|
def AMDGPUIntPackOp : SDTypeProfile<1, 2,
|
|
|
|
[SDTCisInt<1>, SDTCisSameAs<1, 2>]
|
|
|
|
>;
|
|
|
|
|
2014-06-19 09:19:19 +08:00
|
|
|
def AMDGPUDivScaleOp : SDTypeProfile<2, 3,
|
|
|
|
[SDTCisFP<0>, SDTCisInt<1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisSameAs<0, 4>]
|
|
|
|
>;
|
|
|
|
|
2015-02-14 12:22:00 +08:00
|
|
|
// float, float, float, vcc
|
|
|
|
def AMDGPUFmasOp : SDTypeProfile<1, 4,
|
|
|
|
[SDTCisFP<0>, SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisInt<4>]
|
|
|
|
>;
|
|
|
|
|
2016-07-20 00:27:56 +08:00
|
|
|
def AMDGPUKillSDT : SDTypeProfile<0, 1, [SDTCisInt<0>]>;
|
|
|
|
|
2017-03-18 04:41:45 +08:00
|
|
|
def AMDGPUIfOp : SDTypeProfile<1, 2,
|
2019-06-20 23:08:34 +08:00
|
|
|
[SDTCisVT<0, i1>, SDTCisVT<1, i1>, SDTCisVT<2, OtherVT>]
|
2017-03-18 04:41:45 +08:00
|
|
|
>;
|
|
|
|
|
|
|
|
def AMDGPUElseOp : SDTypeProfile<1, 2,
|
2019-06-20 23:08:34 +08:00
|
|
|
[SDTCisVT<0, i1>, SDTCisVT<1, i1>, SDTCisVT<2, OtherVT>]
|
2017-03-18 04:41:45 +08:00
|
|
|
>;
|
|
|
|
|
|
|
|
def AMDGPULoopOp : SDTypeProfile<0, 2,
|
2019-06-20 23:08:34 +08:00
|
|
|
[SDTCisVT<0, i1>, SDTCisVT<1, OtherVT>]
|
2017-03-18 04:41:45 +08:00
|
|
|
>;
|
|
|
|
|
|
|
|
def AMDGPUIfBreakOp : SDTypeProfile<1, 2,
|
2019-06-20 23:08:34 +08:00
|
|
|
[SDTCisVT<0, i1>, SDTCisVT<1, i1>, SDTCisVT<2, i1>]
|
2017-03-18 04:41:45 +08:00
|
|
|
>;
|
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// AMDGPU DAG Nodes
|
|
|
|
//
|
|
|
|
|
2017-03-18 04:41:45 +08:00
|
|
|
def AMDGPUif : SDNode<"AMDGPUISD::IF", AMDGPUIfOp, [SDNPHasChain]>;
|
|
|
|
def AMDGPUelse : SDNode<"AMDGPUISD::ELSE", AMDGPUElseOp, [SDNPHasChain]>;
|
|
|
|
def AMDGPUloop : SDNode<"AMDGPUISD::LOOP", AMDGPULoopOp, [SDNPHasChain]>;
|
|
|
|
|
2017-08-02 03:54:18 +08:00
|
|
|
def callseq_start : SDNode<"ISD::CALLSEQ_START",
|
|
|
|
SDCallSeqStart<[ SDTCisVT<0, i32>, SDTCisVT<1, i32> ]>,
|
|
|
|
[SDNPHasChain, SDNPOutGlue]
|
|
|
|
>;
|
|
|
|
|
|
|
|
def callseq_end : SDNode<"ISD::CALLSEQ_END",
|
|
|
|
SDCallSeqEnd<[ SDTCisVT<0, i32>, SDTCisVT<1, i32> ]>,
|
|
|
|
[SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]
|
|
|
|
>;
|
|
|
|
|
|
|
|
def AMDGPUcall : SDNode<"AMDGPUISD::CALL",
|
|
|
|
SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>,
|
|
|
|
[SDNPHasChain, SDNPOptInGlue, SDNPOutGlue,
|
|
|
|
SDNPVariadic]
|
|
|
|
>;
|
|
|
|
|
2019-02-05 04:00:07 +08:00
|
|
|
def AMDGPUtc_return: SDNode<"AMDGPUISD::TC_RETURN",
|
|
|
|
SDTypeProfile<0, 3, [SDTCisPtrTy<0>]>,
|
2017-08-12 04:42:08 +08:00
|
|
|
[SDNPHasChain, SDNPOptInGlue, SDNPVariadic]
|
|
|
|
>;
|
|
|
|
|
2017-04-25 01:49:13 +08:00
|
|
|
def AMDGPUtrap : SDNode<"AMDGPUISD::TRAP",
|
|
|
|
SDTypeProfile<0, -1, [SDTCisVT<0, i16>]>,
|
|
|
|
[SDNPHasChain, SDNPVariadic, SDNPSideEffect, SDNPInGlue]
|
|
|
|
>;
|
|
|
|
|
2016-05-14 04:39:18 +08:00
|
|
|
def AMDGPUconstdata_ptr : SDNode<
|
|
|
|
"AMDGPUISD::CONST_DATA_PTR", SDTypeProfile <1, 1, [SDTCisVT<0, iPTR>,
|
|
|
|
SDTCisVT<0, iPTR>]>
|
|
|
|
>;
|
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
// This argument to this node is a dword address.
|
|
|
|
def AMDGPUdwordaddr : SDNode<"AMDGPUISD::DWORDADDR", SDTIntUnaryOp>;
|
|
|
|
|
2017-01-21 05:24:26 +08:00
|
|
|
// Force dependencies for vector trunc stores
|
|
|
|
def R600dummy_chain : SDNode<"AMDGPUISD::DUMMY_CHAIN", SDTNone, [SDNPHasChain]>;
|
|
|
|
|
2019-09-10 02:10:31 +08:00
|
|
|
def AMDGPUcos_impl : SDNode<"AMDGPUISD::COS_HW", SDTFPUnaryOp>;
|
|
|
|
def AMDGPUsin_impl : SDNode<"AMDGPUISD::SIN_HW", SDTFPUnaryOp>;
|
2012-12-12 05:25:42 +08:00
|
|
|
// out = a - floor(a)
|
2019-09-10 02:10:31 +08:00
|
|
|
def AMDGPUfract_impl : SDNode<"AMDGPUISD::FRACT", SDTFPUnaryOp>;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2014-06-19 09:19:19 +08:00
|
|
|
// out = 1.0 / a
|
2019-09-10 02:10:31 +08:00
|
|
|
def AMDGPUrcp_impl : SDNode<"AMDGPUISD::RCP", SDTFPUnaryOp>;
|
2014-06-19 09:19:19 +08:00
|
|
|
|
|
|
|
// out = 1.0 / sqrt(a)
|
2019-09-10 02:10:31 +08:00
|
|
|
def AMDGPUrsq_impl : SDNode<"AMDGPUISD::RSQ", SDTFPUnaryOp>;
|
2014-06-19 09:19:19 +08:00
|
|
|
|
2014-06-25 06:13:39 +08:00
|
|
|
// out = 1.0 / sqrt(a)
|
2019-09-10 02:10:31 +08:00
|
|
|
def AMDGPUrsq_legacy_impl : SDNode<"AMDGPUISD::RSQ_LEGACY", SDTFPUnaryOp>;
|
|
|
|
def AMDGPUrcp_legacy_impl : SDNode<"AMDGPUISD::RCP_LEGACY", SDTFPUnaryOp>;
|
2014-06-25 06:13:39 +08:00
|
|
|
|
2018-06-27 23:33:33 +08:00
|
|
|
def AMDGPUrcp_iflag : SDNode<"AMDGPUISD::RCP_IFLAG", SDTFPUnaryOp>;
|
|
|
|
|
2014-06-25 06:13:39 +08:00
|
|
|
// out = 1.0 / sqrt(a) result clamped to +/- max_float.
|
2019-09-10 02:10:31 +08:00
|
|
|
def AMDGPUrsq_clamp_impl : SDNode<"AMDGPUISD::RSQ_CLAMP", SDTFPUnaryOp>;
|
2014-06-25 06:13:39 +08:00
|
|
|
|
2019-09-10 02:10:31 +08:00
|
|
|
def AMDGPUldexp_impl : SDNode<"AMDGPUISD::LDEXP", AMDGPULdExpOp>;
|
2014-08-16 01:30:25 +08:00
|
|
|
|
2019-09-11 01:17:05 +08:00
|
|
|
def AMDGPUpkrtz_f16_f32_impl : SDNode<"AMDGPUISD::CVT_PKRTZ_F16_F32", AMDGPUFPPackOp>;
|
|
|
|
def AMDGPUpknorm_i16_f32_impl : SDNode<"AMDGPUISD::CVT_PKNORM_I16_F32", AMDGPUFPPackOp>;
|
|
|
|
def AMDGPUpknorm_u16_f32_impl : SDNode<"AMDGPUISD::CVT_PKNORM_U16_F32", AMDGPUFPPackOp>;
|
|
|
|
def AMDGPUpk_i16_i32_impl : SDNode<"AMDGPUISD::CVT_PK_I16_I32", AMDGPUIntPackOp>;
|
|
|
|
def AMDGPUpk_u16_u32_impl : SDNode<"AMDGPUISD::CVT_PK_U16_U32", AMDGPUIntPackOp>;
|
2017-03-16 03:04:26 +08:00
|
|
|
def AMDGPUfp_to_f16 : SDNode<"AMDGPUISD::FP_TO_FP16" , SDTFPToIntOp>;
|
2017-04-01 03:53:03 +08:00
|
|
|
def AMDGPUfp16_zext : SDNode<"AMDGPUISD::FP16_ZEXT" , SDTFPToIntOp>;
|
2017-03-16 03:04:26 +08:00
|
|
|
|
2017-02-22 08:27:34 +08:00
|
|
|
|
2019-09-10 02:29:45 +08:00
|
|
|
def AMDGPUfp_class_impl : SDNode<"AMDGPUISD::FP_CLASS", AMDGPUFPClassOp>;
|
2015-01-07 07:00:37 +08:00
|
|
|
|
2014-11-14 07:03:09 +08:00
|
|
|
// out = max(a, b) a and b are floats, where a nan comparison fails.
|
|
|
|
// This is not commutative because this gives the second operand:
|
|
|
|
// x < nan ? x : nan -> nan
|
|
|
|
// nan < x ? nan : x -> x
|
|
|
|
def AMDGPUfmax_legacy : SDNode<"AMDGPUISD::FMAX_LEGACY", SDTFPBinOp,
|
2014-12-12 10:30:33 +08:00
|
|
|
[]
|
2012-12-12 05:25:42 +08:00
|
|
|
>;
|
|
|
|
|
2020-02-21 06:40:43 +08:00
|
|
|
def AMDGPUfmul_legacy_impl : SDNode<"AMDGPUISD::FMUL_LEGACY", SDTFPBinOp,
|
2016-07-27 00:45:45 +08:00
|
|
|
[SDNPCommutative, SDNPAssociative]
|
|
|
|
>;
|
|
|
|
|
2014-11-14 07:03:09 +08:00
|
|
|
// out = min(a, b) a and b are floats, where a nan comparison fails.
|
|
|
|
def AMDGPUfmin_legacy : SDNode<"AMDGPUISD::FMIN_LEGACY", SDTFPBinOp,
|
2014-12-12 10:30:33 +08:00
|
|
|
[]
|
2012-12-12 05:25:42 +08:00
|
|
|
>;
|
|
|
|
|
2014-11-15 04:08:52 +08:00
|
|
|
// FIXME: TableGen doesn't like commutative instructions with more
|
|
|
|
// than 2 operands.
|
|
|
|
// out = max(a, b, c) a, b and c are floats
|
|
|
|
def AMDGPUfmax3 : SDNode<"AMDGPUISD::FMAX3", SDTFPTernaryOp,
|
|
|
|
[/*SDNPCommutative, SDNPAssociative*/]
|
|
|
|
>;
|
|
|
|
|
|
|
|
// out = max(a, b, c) a, b, and c are signed ints
|
|
|
|
def AMDGPUsmax3 : SDNode<"AMDGPUISD::SMAX3", AMDGPUDTIntTernaryOp,
|
|
|
|
[/*SDNPCommutative, SDNPAssociative*/]
|
|
|
|
>;
|
|
|
|
|
|
|
|
// out = max(a, b, c) a, b and c are unsigned ints
|
|
|
|
def AMDGPUumax3 : SDNode<"AMDGPUISD::UMAX3", AMDGPUDTIntTernaryOp,
|
|
|
|
[/*SDNPCommutative, SDNPAssociative*/]
|
|
|
|
>;
|
|
|
|
|
|
|
|
// out = min(a, b, c) a, b and c are floats
|
|
|
|
def AMDGPUfmin3 : SDNode<"AMDGPUISD::FMIN3", SDTFPTernaryOp,
|
|
|
|
[/*SDNPCommutative, SDNPAssociative*/]
|
|
|
|
>;
|
|
|
|
|
|
|
|
// out = min(a, b, c) a, b and c are signed ints
|
|
|
|
def AMDGPUsmin3 : SDNode<"AMDGPUISD::SMIN3", AMDGPUDTIntTernaryOp,
|
|
|
|
[/*SDNPCommutative, SDNPAssociative*/]
|
|
|
|
>;
|
|
|
|
|
|
|
|
// out = min(a, b) a and b are unsigned ints
|
|
|
|
def AMDGPUumin3 : SDNode<"AMDGPUISD::UMIN3", AMDGPUDTIntTernaryOp,
|
|
|
|
[/*SDNPCommutative, SDNPAssociative*/]
|
|
|
|
>;
|
2014-06-12 01:50:44 +08:00
|
|
|
|
2015-05-01 01:15:56 +08:00
|
|
|
// out = (src0 + src1 > 0xFFFFFFFF) ? 1 : 0
|
|
|
|
def AMDGPUcarry : SDNode<"AMDGPUISD::CARRY", SDTIntBinOp, []>;
|
|
|
|
|
|
|
|
// out = (src1 > src0) ? 1 : 0
|
|
|
|
def AMDGPUborrow : SDNode<"AMDGPUISD::BORROW", SDTIntBinOp, []>;
|
|
|
|
|
2016-07-29 00:42:13 +08:00
|
|
|
def AMDGPUSetCCOp : SDTypeProfile<1, 3, [ // setcc
|
2019-06-14 04:23:02 +08:00
|
|
|
SDTCisInt<0>, SDTCisSameAs<1, 2>, SDTCisVT<3, OtherVT>
|
2016-07-29 00:42:13 +08:00
|
|
|
]>;
|
|
|
|
|
|
|
|
def AMDGPUsetcc : SDNode<"AMDGPUISD::SETCC", AMDGPUSetCCOp>;
|
2015-05-01 01:15:56 +08:00
|
|
|
|
2016-12-07 10:42:15 +08:00
|
|
|
def AMDGPUSetRegOp : SDTypeProfile<0, 2, [
|
|
|
|
SDTCisInt<0>, SDTCisInt<1>
|
|
|
|
]>;
|
|
|
|
|
|
|
|
def AMDGPUsetreg : SDNode<"AMDGPUISD::SETREG", AMDGPUSetRegOp, [
|
|
|
|
SDNPHasChain, SDNPSideEffect, SDNPOptInGlue, SDNPOutGlue]>;
|
|
|
|
|
|
|
|
def AMDGPUfma : SDNode<"AMDGPUISD::FMA_W_CHAIN", SDTFPTernaryOp, [
|
|
|
|
SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
|
|
|
|
|
|
|
|
def AMDGPUmul : SDNode<"AMDGPUISD::FMUL_W_CHAIN", SDTFPBinOp, [
|
|
|
|
SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
|
|
|
|
|
2014-06-12 01:50:44 +08:00
|
|
|
def AMDGPUcvt_f32_ubyte0 : SDNode<"AMDGPUISD::CVT_F32_UBYTE0",
|
|
|
|
SDTIntToFPOp, []>;
|
|
|
|
def AMDGPUcvt_f32_ubyte1 : SDNode<"AMDGPUISD::CVT_F32_UBYTE1",
|
|
|
|
SDTIntToFPOp, []>;
|
|
|
|
def AMDGPUcvt_f32_ubyte2 : SDNode<"AMDGPUISD::CVT_F32_UBYTE2",
|
|
|
|
SDTIntToFPOp, []>;
|
|
|
|
def AMDGPUcvt_f32_ubyte3 : SDNode<"AMDGPUISD::CVT_F32_UBYTE3",
|
|
|
|
SDTIntToFPOp, []>;
|
|
|
|
|
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
// urecip - This operation is a helper for integer division, it returns the
|
|
|
|
// result of 1 / a as a fractional unsigned integer.
|
|
|
|
// out = (2^32 / a) + e
|
|
|
|
// e is rounding error
|
|
|
|
def AMDGPUurecip : SDNode<"AMDGPUISD::URECIP", SDTIntUnaryOp>;
|
|
|
|
|
2014-06-19 09:19:19 +08:00
|
|
|
// Special case divide preop and flags.
|
|
|
|
def AMDGPUdiv_scale : SDNode<"AMDGPUISD::DIV_SCALE", AMDGPUDivScaleOp>;
|
|
|
|
|
|
|
|
// Special case divide FMA with scale and flags (src0 = Quotient,
|
|
|
|
// src1 = Denominator, src2 = Numerator).
|
2020-04-06 07:49:09 +08:00
|
|
|
def AMDGPUdiv_fmas_impl : SDNode<"AMDGPUISD::DIV_FMAS", AMDGPUFmasOp,
|
2019-05-02 12:01:39 +08:00
|
|
|
[SDNPOptInGlue]>;
|
2014-06-19 09:19:19 +08:00
|
|
|
|
|
|
|
// Single or double precision division fixup.
|
|
|
|
// Special case divide fixup and flags(src0 = Quotient, src1 =
|
|
|
|
// Denominator, src2 = Numerator).
|
2019-12-20 23:52:03 +08:00
|
|
|
def AMDGPUdiv_fixup_impl : SDNode<"AMDGPUISD::DIV_FIXUP", SDTFPTernaryOp>;
|
2014-06-19 09:19:19 +08:00
|
|
|
|
2019-09-09 05:44:09 +08:00
|
|
|
def AMDGPUfmad_ftz_impl : SDNode<"AMDGPUISD::FMAD_FTZ", SDTFPTernaryOp>;
|
2017-02-25 07:00:29 +08:00
|
|
|
|
2014-06-19 09:19:19 +08:00
|
|
|
// Look Up 2.0 / pi src0 with segment select src1[4:0]
|
|
|
|
def AMDGPUtrig_preop : SDNode<"AMDGPUISD::TRIG_PREOP", AMDGPUTrigPreOp>;
|
|
|
|
|
2013-02-07 01:32:29 +08:00
|
|
|
def AMDGPUregister_load : SDNode<"AMDGPUISD::REGISTER_LOAD",
|
|
|
|
SDTypeProfile<1, 2, [SDTCisPtrTy<1>, SDTCisInt<2>]>,
|
|
|
|
[SDNPHasChain, SDNPMayLoad]>;
|
|
|
|
|
|
|
|
def AMDGPUregister_store : SDNode<"AMDGPUISD::REGISTER_STORE",
|
|
|
|
SDTypeProfile<0, 3, [SDTCisPtrTy<1>, SDTCisInt<2>]>,
|
|
|
|
[SDNPHasChain, SDNPMayStore]>;
|
2013-08-16 09:12:06 +08:00
|
|
|
|
2013-08-26 23:05:49 +08:00
|
|
|
// MSKOR instructions are atomic memory instructions used mainly for storing
|
|
|
|
// 8-bit and 16-bit values. The definition is:
|
|
|
|
//
|
|
|
|
// MSKOR(dst, mask, src) MEM[dst] = ((MEM[dst] & ~mask) | src)
|
|
|
|
//
|
|
|
|
// src0: vec4(src, 0, 0, mask)
|
2014-11-14 07:03:09 +08:00
|
|
|
// src1: dst - rat offset (aka pointer) in dwords
|
2013-08-16 09:12:06 +08:00
|
|
|
def AMDGPUstore_mskor : SDNode<"AMDGPUISD::STORE_MSKOR",
|
|
|
|
SDTypeProfile<0, 2, []>,
|
|
|
|
[SDNPHasChain, SDNPMayStore, SDNPMemOperand]>;
|
2013-11-28 05:23:20 +08:00
|
|
|
|
AMDGPU: Implement {BUFFER,FLAT}_ATOMIC_CMPSWAP{,_X2}
Summary:
Implement BUFFER_ATOMIC_CMPSWAP{,_X2} instructions on all GCN targets, and FLAT_ATOMIC_CMPSWAP{,_X2} on CI+.
32-bit instruction variants tested manually on Kabini and Bonaire. Tests and parts of code provided by Jan Veselý.
Patch by: Vedran Miletić
Reviewers: arsenm, tstellarAMD, nhaehnle
Subscribers: jvesely, scchan, kanarayan, arsenm
Differential Revision: http://reviews.llvm.org/D17280
llvm-svn: 265170
2016-04-02 02:27:37 +08:00
|
|
|
def AMDGPUatomic_cmp_swap : SDNode<"AMDGPUISD::ATOMIC_CMP_SWAP",
|
|
|
|
SDTypeProfile<1, 2, [SDTCisPtrTy<1>, SDTCisVec<2>]>,
|
|
|
|
[SDNPHasChain, SDNPMayStore, SDNPMayLoad,
|
|
|
|
SDNPMemOperand]>;
|
|
|
|
|
2013-11-28 05:23:20 +08:00
|
|
|
def AMDGPUround : SDNode<"ISD::FROUND",
|
|
|
|
SDTypeProfile<1, 1, [SDTCisFP<0>, SDTCisSameAs<0,1>]>>;
|
2014-03-18 02:58:11 +08:00
|
|
|
|
2020-02-11 07:06:17 +08:00
|
|
|
def AMDGPUbfe_u32_impl : SDNode<"AMDGPUISD::BFE_U32", AMDGPUDTIntTernaryOp>;
|
|
|
|
def AMDGPUbfe_i32_impl : SDNode<"AMDGPUISD::BFE_I32", AMDGPUDTIntTernaryOp>;
|
2014-04-01 02:21:13 +08:00
|
|
|
def AMDGPUbfi : SDNode<"AMDGPUISD::BFI", AMDGPUDTIntTernaryOp>;
|
|
|
|
def AMDGPUbfm : SDNode<"AMDGPUISD::BFM", SDTIntBinOp>;
|
2014-03-18 02:58:11 +08:00
|
|
|
|
2020-02-07 10:54:41 +08:00
|
|
|
def AMDGPUffbh_u32_impl : SDNode<"AMDGPUISD::FFBH_U32", SDTIntBitCountUnaryOp>;
|
|
|
|
def AMDGPUffbh_i32_impl : SDNode<"AMDGPUISD::FFBH_I32", SDTIntBitCountUnaryOp>;
|
2016-01-12 01:02:00 +08:00
|
|
|
|
2020-02-08 00:08:52 +08:00
|
|
|
def AMDGPUffbl_b32_impl : SDNode<"AMDGPUISD::FFBL_B32", SDTIntBitCountUnaryOp>;
|
2017-10-13 03:37:14 +08:00
|
|
|
|
2016-08-27 09:32:27 +08:00
|
|
|
// Signed and unsigned 24-bit multiply. The highest 8-bits are ignore
|
|
|
|
// when performing the mulitply. The result is a 32-bit value.
|
2019-09-09 06:11:51 +08:00
|
|
|
def AMDGPUmul_u24_impl : SDNode<"AMDGPUISD::MUL_U24", SDTIntBinOp,
|
2016-08-27 09:32:27 +08:00
|
|
|
[SDNPCommutative, SDNPAssociative]
|
2014-04-08 03:45:41 +08:00
|
|
|
>;
|
2019-09-09 06:11:51 +08:00
|
|
|
def AMDGPUmul_i24_impl : SDNode<"AMDGPUISD::MUL_I24", SDTIntBinOp,
|
2016-08-27 09:32:27 +08:00
|
|
|
[SDNPCommutative, SDNPAssociative]
|
|
|
|
>;
|
|
|
|
|
|
|
|
def AMDGPUmulhi_u24 : SDNode<"AMDGPUISD::MULHI_U24", SDTIntBinOp,
|
|
|
|
[SDNPCommutative, SDNPAssociative]
|
|
|
|
>;
|
|
|
|
def AMDGPUmulhi_i24 : SDNode<"AMDGPUISD::MULHI_I24", SDTIntBinOp,
|
|
|
|
[SDNPCommutative, SDNPAssociative]
|
2014-04-08 03:45:41 +08:00
|
|
|
>;
|
2014-05-23 02:00:15 +08:00
|
|
|
|
|
|
|
def AMDGPUmad_u24 : SDNode<"AMDGPUISD::MAD_U24", AMDGPUDTIntTernaryOp,
|
|
|
|
[]
|
|
|
|
>;
|
|
|
|
def AMDGPUmad_i24 : SDNode<"AMDGPUISD::MAD_I24", AMDGPUDTIntTernaryOp,
|
|
|
|
[]
|
|
|
|
>;
|
2014-06-14 00:38:59 +08:00
|
|
|
|
2016-01-29 04:53:42 +08:00
|
|
|
def AMDGPUsmed3 : SDNode<"AMDGPUISD::SMED3", AMDGPUDTIntTernaryOp,
|
|
|
|
[]
|
|
|
|
>;
|
|
|
|
|
|
|
|
def AMDGPUumed3 : SDNode<"AMDGPUISD::UMED3", AMDGPUDTIntTernaryOp,
|
|
|
|
[]
|
|
|
|
>;
|
|
|
|
|
2019-09-10 02:29:37 +08:00
|
|
|
def AMDGPUfmed3_impl : SDNode<"AMDGPUISD::FMED3", SDTFPTernaryOp, []>;
|
2016-01-29 04:53:42 +08:00
|
|
|
|
2020-02-18 11:26:04 +08:00
|
|
|
def AMDGPUfdot2_impl : SDNode<"AMDGPUISD::FDOT2",
|
2018-08-01 09:31:30 +08:00
|
|
|
SDTypeProfile<1, 4, [SDTCisSameAs<0, 3>, SDTCisSameAs<1, 2>,
|
|
|
|
SDTCisFP<0>, SDTCisVec<1>,
|
|
|
|
SDTCisInt<4>]>,
|
2018-07-17 02:19:59 +08:00
|
|
|
[]>;
|
|
|
|
|
2018-06-13 07:50:37 +08:00
|
|
|
def AMDGPUperm : SDNode<"AMDGPUISD::PERM", AMDGPUDTIntTernaryOp, []>;
|
|
|
|
|
2016-12-06 04:23:10 +08:00
|
|
|
// SI+ export
|
|
|
|
def AMDGPUExportOp : SDTypeProfile<0, 8, [
|
2017-01-17 15:26:53 +08:00
|
|
|
SDTCisInt<0>, // i8 tgt
|
|
|
|
SDTCisInt<1>, // i8 en
|
|
|
|
// i32 or f32 src0
|
|
|
|
SDTCisSameAs<3, 2>, // f32 src1
|
|
|
|
SDTCisSameAs<4, 2>, // f32 src2
|
|
|
|
SDTCisSameAs<5, 2>, // f32 src3
|
|
|
|
SDTCisInt<6>, // i1 compr
|
2016-12-06 04:23:10 +08:00
|
|
|
// skip done
|
2017-01-17 15:26:53 +08:00
|
|
|
SDTCisInt<1> // i1 vm
|
|
|
|
|
2016-12-06 04:23:10 +08:00
|
|
|
]>;
|
|
|
|
|
|
|
|
|
|
|
|
def R600ExportOp : SDTypeProfile<0, 7, [SDTCisFP<0>, SDTCisInt<1>]>;
|
|
|
|
|
|
|
|
def R600_EXPORT: SDNode<"AMDGPUISD::R600_EXPORT", R600ExportOp,
|
|
|
|
[SDNPHasChain, SDNPSideEffect]>;
|
2016-07-20 00:27:56 +08:00
|
|
|
|
2014-06-14 00:38:59 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Flow Control Profile Types
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Branch instruction where second and third are basic blocks
|
|
|
|
def SDTIL_BRCond : SDTypeProfile<0, 2, [
|
|
|
|
SDTCisVT<0, OtherVT>
|
|
|
|
]>;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Flow Control DAG Nodes
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
def IL_brcond : SDNode<"AMDGPUISD::BRANCH_COND", SDTIL_BRCond, [SDNPHasChain]>;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Call/Return DAG Nodes
|
|
|
|
//===----------------------------------------------------------------------===//
|
2016-06-23 04:15:28 +08:00
|
|
|
def AMDGPUendpgm : SDNode<"AMDGPUISD::ENDPGM", SDTNone,
|
|
|
|
[SDNPHasChain, SDNPOptInGlue]>;
|
|
|
|
|
2017-03-22 06:18:10 +08:00
|
|
|
def AMDGPUreturn_to_epilog : SDNode<"AMDGPUISD::RETURN_TO_EPILOG", SDTNone,
|
2016-01-14 01:23:04 +08:00
|
|
|
[SDNPHasChain, SDNPOptInGlue, SDNPVariadic]>;
|
2017-03-22 06:18:10 +08:00
|
|
|
|
2017-05-18 05:56:25 +08:00
|
|
|
def AMDGPUret_flag : SDNode<"AMDGPUISD::RET_FLAG", SDTypeProfile<0, 1, [SDTCisPtrTy<0>]>,
|
2017-03-22 06:18:10 +08:00
|
|
|
[SDNPHasChain, SDNPOptInGlue, SDNPVariadic]
|
|
|
|
>;
|
2019-09-10 02:10:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Intrinsic/Custom node compatability PatFrags
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def AMDGPUrcp : PatFrags<(ops node:$src), [(int_amdgcn_rcp node:$src),
|
|
|
|
(AMDGPUrcp_impl node:$src)]>;
|
|
|
|
def AMDGPUrcp_legacy : PatFrags<(ops node:$src), [(int_amdgcn_rcp_legacy node:$src),
|
|
|
|
(AMDGPUrcp_legacy_impl node:$src)]>;
|
|
|
|
|
|
|
|
def AMDGPUrsq_legacy : PatFrags<(ops node:$src), [(int_amdgcn_rsq_legacy node:$src),
|
|
|
|
(AMDGPUrsq_legacy_impl node:$src)]>;
|
|
|
|
|
|
|
|
def AMDGPUrsq : PatFrags<(ops node:$src), [(int_amdgcn_rsq node:$src),
|
|
|
|
(AMDGPUrsq_impl node:$src)]>;
|
|
|
|
|
|
|
|
def AMDGPUrsq_clamp : PatFrags<(ops node:$src), [(int_amdgcn_rsq_clamp node:$src),
|
|
|
|
(AMDGPUrsq_clamp_impl node:$src)]>;
|
|
|
|
|
|
|
|
def AMDGPUsin : PatFrags<(ops node:$src), [(int_amdgcn_sin node:$src),
|
|
|
|
(AMDGPUsin_impl node:$src)]>;
|
|
|
|
def AMDGPUcos : PatFrags<(ops node:$src), [(int_amdgcn_cos node:$src),
|
|
|
|
(AMDGPUcos_impl node:$src)]>;
|
|
|
|
def AMDGPUfract : PatFrags<(ops node:$src), [(int_amdgcn_fract node:$src),
|
|
|
|
(AMDGPUfract_impl node:$src)]>;
|
|
|
|
|
|
|
|
def AMDGPUldexp : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_ldexp node:$src0, node:$src1),
|
|
|
|
(AMDGPUldexp_impl node:$src0, node:$src1)]>;
|
2019-09-10 02:29:37 +08:00
|
|
|
|
2019-09-10 02:29:45 +08:00
|
|
|
def AMDGPUfp_class : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_class node:$src0, node:$src1),
|
|
|
|
(AMDGPUfp_class_impl node:$src0, node:$src1)]>;
|
|
|
|
|
2019-09-10 02:29:37 +08:00
|
|
|
def AMDGPUfmed3 : PatFrags<(ops node:$src0, node:$src1, node:$src2),
|
|
|
|
[(int_amdgcn_fmed3 node:$src0, node:$src1, node:$src2),
|
|
|
|
(AMDGPUfmed3_impl node:$src0, node:$src1, node:$src2)]>;
|
2019-09-11 01:16:59 +08:00
|
|
|
|
2019-12-20 23:52:03 +08:00
|
|
|
def AMDGPUdiv_fixup : PatFrags<(ops node:$src0, node:$src1, node:$src2),
|
|
|
|
[(int_amdgcn_div_fixup node:$src0, node:$src1, node:$src2),
|
|
|
|
(AMDGPUdiv_fixup_impl node:$src0, node:$src1, node:$src2)]>;
|
|
|
|
|
2019-09-11 01:16:59 +08:00
|
|
|
def AMDGPUffbh_i32 : PatFrags<(ops node:$src),
|
|
|
|
[(int_amdgcn_sffbh node:$src),
|
|
|
|
(AMDGPUffbh_i32_impl node:$src)]>;
|
2019-09-11 01:17:05 +08:00
|
|
|
|
2020-02-07 10:54:41 +08:00
|
|
|
def AMDGPUffbh_u32 : PatFrags<(ops node:$src),
|
|
|
|
[(ctlz_zero_undef node:$src),
|
|
|
|
(AMDGPUffbh_u32_impl node:$src)]>;
|
|
|
|
|
2020-02-08 00:08:52 +08:00
|
|
|
def AMDGPUffbl_b32 : PatFrags<(ops node:$src),
|
|
|
|
[(cttz_zero_undef node:$src),
|
|
|
|
(AMDGPUffbl_b32_impl node:$src)]>;
|
|
|
|
|
2019-09-11 01:17:05 +08:00
|
|
|
def AMDGPUpkrtz_f16_f32 : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_cvt_pkrtz node:$src0, node:$src1),
|
|
|
|
(AMDGPUpkrtz_f16_f32_impl node:$src0, node:$src1)]>;
|
|
|
|
|
|
|
|
def AMDGPUpknorm_i16_f32 : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_cvt_pknorm_i16 node:$src0, node:$src1),
|
|
|
|
(AMDGPUpknorm_i16_f32_impl node:$src0, node:$src1)]>;
|
|
|
|
|
|
|
|
def AMDGPUpknorm_u16_f32 : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_cvt_pknorm_u16 node:$src0, node:$src1),
|
|
|
|
(AMDGPUpknorm_u16_f32_impl node:$src0, node:$src1)]>;
|
|
|
|
|
|
|
|
def AMDGPUpk_i16_i32 : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_cvt_pk_i16 node:$src0, node:$src1),
|
|
|
|
(AMDGPUpk_i16_i32_impl node:$src0, node:$src1)]>;
|
|
|
|
|
|
|
|
def AMDGPUpk_u16_u32 : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_cvt_pk_u16 node:$src0, node:$src1),
|
|
|
|
(AMDGPUpk_u16_u32_impl node:$src0, node:$src1)]>;
|
2019-09-09 05:44:09 +08:00
|
|
|
|
|
|
|
def AMDGPUfmad_ftz : PatFrags<(ops node:$src0, node:$src1, node:$src2),
|
|
|
|
[(int_amdgcn_fmad_ftz node:$src0, node:$src1, node:$src2),
|
|
|
|
(AMDGPUfmad_ftz_impl node:$src0, node:$src1, node:$src2)]>;
|
2019-09-09 06:11:51 +08:00
|
|
|
|
|
|
|
def AMDGPUmul_u24 : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_mul_u24 node:$src0, node:$src1),
|
|
|
|
(AMDGPUmul_u24_impl node:$src0, node:$src1)]>;
|
|
|
|
|
|
|
|
def AMDGPUmul_i24 : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_mul_i24 node:$src0, node:$src1),
|
|
|
|
(AMDGPUmul_i24_impl node:$src0, node:$src1)]>;
|
2020-02-11 07:06:17 +08:00
|
|
|
|
|
|
|
def AMDGPUbfe_i32 : PatFrags<(ops node:$src0, node:$src1, node:$src2),
|
|
|
|
[(int_amdgcn_sbfe node:$src0, node:$src1, node:$src2),
|
|
|
|
(AMDGPUbfe_i32_impl node:$src0, node:$src1, node:$src2)]>;
|
|
|
|
|
|
|
|
def AMDGPUbfe_u32 : PatFrags<(ops node:$src0, node:$src1, node:$src2),
|
|
|
|
[(int_amdgcn_ubfe node:$src0, node:$src1, node:$src2),
|
|
|
|
(AMDGPUbfe_u32_impl node:$src0, node:$src1, node:$src2)]>;
|
2020-02-21 06:40:43 +08:00
|
|
|
|
|
|
|
def AMDGPUfmul_legacy : PatFrags<(ops node:$src0, node:$src1),
|
|
|
|
[(int_amdgcn_fmul_legacy node:$src0, node:$src1),
|
|
|
|
(AMDGPUfmul_legacy_impl node:$src0, node:$src1)]>;
|
2020-02-18 11:26:04 +08:00
|
|
|
|
|
|
|
def AMDGPUfdot2 : PatFrags<(ops node:$src0, node:$src1, node:$src2, node:$clamp),
|
|
|
|
[(int_amdgcn_fdot2 node:$src0, node:$src1, node:$src2, node:$clamp),
|
|
|
|
(AMDGPUfdot2_impl node:$src0, node:$src1, node:$src2, node:$clamp)]>;
|
2020-04-06 07:49:09 +08:00
|
|
|
|
|
|
|
def AMDGPUdiv_fmas : PatFrags<(ops node:$src0, node:$src1, node:$src2, node:$vcc),
|
|
|
|
[(int_amdgcn_div_fmas node:$src0, node:$src1, node:$src2, node:$vcc),
|
|
|
|
(AMDGPUdiv_fmas_impl node:$src0, node:$src1, node:$src2, node:$vcc)]>;
|